From 08ac1ff8aa00cf4d457b456b107cd275b24467c5 Mon Sep 17 00:00:00 2001 From: Jesse Maxwell Date: Mon, 9 Jan 2017 19:43:56 -0600 Subject: [PATCH 1/2] Create a standard for XML files --- .../coding-standards/xml-coding-standard.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 guides/v2.1/coding-standards/xml-coding-standard.md diff --git a/guides/v2.1/coding-standards/xml-coding-standard.md b/guides/v2.1/coding-standards/xml-coding-standard.md new file mode 100644 index 00000000000..ea865df4fe0 --- /dev/null +++ b/guides/v2.1/coding-standards/xml-coding-standard.md @@ -0,0 +1,59 @@ +--- +layout: default +group: coding-standards +subgroup: Coding standards +title: XML Coding Standards +menu_title: XML Coding Standards +menu_order: 100 +contributor_name: SwiftOtter Studios +contributor_link: https://swiftotter.com/ +version: 2.1 +github_link: coding-standards/xml-coding-standard.md +--- + +# XML Coding Standard + +### Name attribute + +The `name` attribute should adhere to the guidelines listed below. The `name` attribute should: + +- Be unique to the project. +- Use a namespace approach where each child block's name contains its parent's name as well. +- Have segments separated by a `.` (period). +- Be all lowercase. +- Never use `_` (underscores). + +*Example:* + +```xml + + + + + + + +``` + +### As attribute + +The `as` attribute should follow the guidelines below. The value of `as`: + +- Only needs to be unique to the block that contains it. +- Should be as concise as possible, but with enough clarity to be understood within the block. +- Can use an `_` (underscore) as a separator. +- Should only be added if necessary. +- Should be all lowercase. + + +*Example:* + +```xml + + + + + + + +``` From 23550d7eb4d1665d62dba8a997ef9b576158cec7 Mon Sep 17 00:00:00 2001 From: Jesse Maxwell Date: Mon, 9 Jan 2017 19:46:19 -0600 Subject: [PATCH 2/2] Update to clarify that the focus is layout XML --- guides/v2.1/coding-standards/xml-coding-standard.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/v2.1/coding-standards/xml-coding-standard.md b/guides/v2.1/coding-standards/xml-coding-standard.md index ea865df4fe0..e34c288a10d 100644 --- a/guides/v2.1/coding-standards/xml-coding-standard.md +++ b/guides/v2.1/coding-standards/xml-coding-standard.md @@ -2,8 +2,8 @@ layout: default group: coding-standards subgroup: Coding standards -title: XML Coding Standards -menu_title: XML Coding Standards +title: Layout XML Coding Standards +menu_title: Layout XML Coding Standards menu_order: 100 contributor_name: SwiftOtter Studios contributor_link: https://swiftotter.com/ @@ -11,7 +11,7 @@ version: 2.1 github_link: coding-standards/xml-coding-standard.md --- -# XML Coding Standard +# Layout XML Coding Standard ### Name attribute