|
| 1 | +--- |
| 2 | +description: 'Documentation and content creation standards' |
| 3 | +applyTo: '**/*.md' |
| 4 | +--- |
| 5 | + |
| 6 | +## Markdown Content Rules |
| 7 | + |
| 8 | +The following markdown content rules are enforced in the validators: |
| 9 | + |
| 10 | +1. **Headings**: Use appropriate heading levels (H2, H3, etc.) to structure your content. Do not use an H1 heading, as this will be generated based on the title. |
| 11 | +2. **Lists**: Use bullet points or numbered lists for lists. Ensure proper indentation and spacing. |
| 12 | +3. **Code Blocks**: Use fenced code blocks for code snippets. Specify the language for syntax highlighting. |
| 13 | +4. **Links**: Use standard Markdown link syntax. |
| 14 | +5. **Images**: Use HTML `<img>` tags for images. See the "Images" section for examples and guidelines. |
| 15 | +6. **Tables**: Use markdown tables for tabular data. Ensure proper formatting and alignment. |
| 16 | +7. **Whitespace**: Use appropriate whitespace to separate sections and improve readability. |
| 17 | +8. **Front Matter**: Include YAML front matter at the beginning of the file with required metadata fields. |
| 18 | + |
| 19 | +## Formatting and Structure |
| 20 | + |
| 21 | +Follow these guidelines for formatting and structuring your markdown content: |
| 22 | + |
| 23 | +- **Headings**: Use `##` for H2 and `###` for H3. Ensure that headings are used hierarchically. Recommend restructuring if the content includes H4, and more strongly recommend for H5. |
| 24 | +- **Lists**: Use `-` for bullet points and `1.` for numbered lists. Indent nested lists with four spaces to match the linter configuration. Prefer dashes `-` over asterisks `*` for unordered lists. Generally: |
| 25 | + - Limit a single list to at most nine items when reasonable. |
| 26 | + - Avoid more than two levels of nesting. |
| 27 | + - Punctuate and capitalize list items consistently. Do not add end punctuation to list items that are not complete sentences unless they complete the introductory sentence. If list items complete an introductory sentence, end each (except the last) with a comma, omit the "and" before the last, and end the last item with appropriate punctuation. |
| 28 | +- **Code Blocks**: Use triple backticks to create fenced code blocks. Specify the language after the opening backticks for syntax highlighting (e.g., kt, java, xml). |
| 29 | +- **Links**: Ensure the link text is descriptive and the URL is valid. |
| 30 | +- **Tables**: Use `|` to create tables. Ensure that columns are properly aligned and headers are included. |
| 31 | + - Include leading and trailing pipes to conform to the linter setting (MD055: `leading_and_trailing`). |
| 32 | +- **Line Length**: There is no enforced hard limit. |
| 33 | +- **Whitespace**: Use blank lines to separate sections and improve readability. Avoid excessive whitespace. |
| 34 | + |
| 35 | +### Writing Style and Tone |
| 36 | + |
| 37 | +- Keep content factual, brief, and focused. Avoid duplicating other sections of the guide and refrain from advertising commercial tools or services. |
| 38 | +- Address the reader directly in the second person ("you"). Prefer active voice over passive voice. |
| 39 | +- Ensure cohesion and coherence: link ideas logically; keep each paragraph focused on one idea; lead sections with the key point; use bullet points for scannability when appropriate. |
| 40 | +- Write for an international audience with a basic technical background. Avoid hard-to-translate slang. |
| 41 | +- Provide context and orientation: use a unique page heading, a concise introduction, and links to background information where helpful. |
| 42 | + |
| 43 | +### Content Length and Organization |
| 44 | + |
| 45 | +- Use short, scannable pages where possible (roughly one to two screens of text). For extensive sections, consider moving details to a supporting document and linking to it for clarity and conciseness. |
| 46 | +- For digital content, favor shorter, cross-linked pages. If the content is intended for print, longer, comprehensive pages are acceptable. |
| 47 | + |
| 48 | +### Gender Neutrality |
| 49 | + |
| 50 | +- Avoid gendered pronouns (she/her/hers/herself, he/him/his/himself) and constructions like "he/she", "s/he", "his or her". |
| 51 | +- Prefer alternatives: |
| 52 | + - Omit the pronoun where possible. |
| 53 | + - Use articles ("the", "a") where appropriate. |
| 54 | + - Use plural nouns and pronouns ("they") when it improves clarity. |
| 55 | + - Use the second person ("you") or imperative form. |
| 56 | + |
| 57 | +### Language and Conventions |
| 58 | + |
| 59 | +- Use American spelling and terminology. |
| 60 | +- Title capitalization follows the Chicago Manual of Style: |
| 61 | + - Capitalize first and last words; nouns, pronouns, verbs, adjectives, adverbs, and subordinating conjunctions. |
| 62 | + - Lowercase articles, prepositions, and coordinating conjunctions (except when first or last). |
| 63 | +- Numbers: spell out zero through ten; use numerals for numbers greater than ten. |
| 64 | +- Android versions: write as "Android X (API level YY)" and avoid codenames. |
| 65 | +- Contractions: prefer common contractions (e.g., "don't", "can't", "it's"). |
| 66 | + |
| 67 | +### Abbreviations |
| 68 | + |
| 69 | +- On first use, spell out the term followed by the abbreviation in parentheses; use the abbreviation alone on subsequent uses within the chapter. |
| 70 | +- If the term appears only once, prefer the full term instead of the abbreviation. |
| 71 | +- In titles/headings, abbreviations are acceptable, but introduce them properly in the following text. |
| 72 | +- Use "a" or "an" based on pronunciation (e.g., a URL, an APK). |
| 73 | +- Form plurals by adding "s" unless the abbreviation already represents a plural noun (e.g., APIs, CSS). |
| 74 | +- For common file formats like APK, IPA, or ZIP, do not prefix with a dot unless referring explicitly to the file extension. |
| 75 | + |
| 76 | +### In-project Identifiers |
| 77 | + |
| 78 | +Use special identifiers to reference project components consistently: |
| 79 | + |
| 80 | +- Tests: `@MASTG-TEST-0001` |
| 81 | +- Tools: `@MASTG-TOOL-0034` |
| 82 | +- Similar patterns may exist for other entities (e.g., best practices, techniques) following `@MASTG-<KIND>-NNNN`. |
| 83 | +- Weaknesses: `@MASWE-0123` (this one is an exception to the usual pattern) |
| 84 | + |
| 85 | +Usage rules: |
| 86 | + |
| 87 | +- In body text (Markdown content), include the leading `@` when referencing an item. |
| 88 | +- In YAML front matter, omit the `@` and use the bare identifier (e.g., `MASTG-TEST-0001`). |
| 89 | + |
| 90 | +Examples: |
| 91 | + |
| 92 | +```markdown |
| 93 | +You can validate this with @MASTG-TEST-0001 and compare results using @MASTG-TOOL-0034. |
| 94 | +``` |
| 95 | + |
| 96 | +```yaml |
| 97 | +weakness: MASWE-0069 |
| 98 | +best-practices: [MASTG-BEST-0010, MASTG-BEST-0011, MASTG-BEST-0012] |
| 99 | +``` |
| 100 | +
|
| 101 | +### Punctuation and Typographic Conventions |
| 102 | +
|
| 103 | +- After a colon, lowercase the first word unless it is a proper noun or starts two or more complete sentences or a direct question. |
| 104 | +- Use the serial comma (Oxford comma). |
| 105 | +- Use straight quotes and apostrophes (not curly quotes/apostrophes). |
| 106 | +- Never use Horizontal rules like `---`. |
| 107 | +- Emphasis/strong style: underscores for emphasis (`_text_`), asterisks for strong (`**text**`). |
| 108 | +- Trailing punctuation allowed in headings (MD026) is limited to: `.,;:` |
| 109 | +- Always prefer commas or parentheses over em-dashes, en-dashes, or hyphens. |
| 110 | + |
| 111 | +## Images |
| 112 | + |
| 113 | +For MASTG chapters and related content, always embed pictures using an HTML `<img>` element rather than Markdown image syntax: |
| 114 | + |
| 115 | +- Put `src` as the first attribute. |
| 116 | +- Optionally specify a `width` (e.g., `width="80%"`). |
| 117 | +- Store images in the appropriate directory (e.g., `Document/Images/Chapters` for MASTG chapters). |
| 118 | +- Inline HTML is permitted; the linter rule MD033 is disabled to allow this. |
| 119 | + |
| 120 | +Example: |
| 121 | + |
| 122 | +```markdown |
| 123 | +<img src="Images/Chapters/0x05b/r2_pd_10.png" width="80%" /> |
| 124 | +``` |
| 125 | + |
| 126 | +Note: The linter does not require alt text for images (MD045 is disabled); however, including descriptive context in the surrounding text is helpful for accessibility. |
| 127 | + |
| 128 | +## Validation Requirements |
| 129 | + |
| 130 | +Ensure compliance with the following validation requirements: |
| 131 | + |
| 132 | +- **Content Rules**: Ensure that the content follows the markdown content rules specified above. |
| 133 | +- **Formatting**: Ensure that the content is appropriately formatted and structured according to the guidelines. |
| 134 | +- **Validation**: Run the validation tools to check for compliance with the rules and guidelines. |
0 commit comments