|
1 | 1 | This documentation repository consists mainly of content written in Markdown format. These files are converted into HTML for displaying on a website. Most Markdown files become a single article on the documentation site. Other files contain reusable content which is inserted into multiple articles. The repository also contains YAML files (e.g. for variable text), image files, JavaScript/TypeScript files, etc.
|
2 | 2 |
|
| 3 | +## Content guidelines |
| 4 | + |
| 5 | +### Bullet lists |
| 6 | + |
| 7 | +The bulleted points in a bullet list should always be denoted in Markdown using an asterisk, not a hyphen. |
| 8 | + |
3 | 9 | ### Using variables
|
4 | 10 |
|
5 |
| -Within Markdown files, with the exception of the `title` field in the metadata at the start of a file, always use the Liquid syntax variables rather than text if a variable has been defined for that text. For example: |
| 11 | +Within Markdown files, with the exception of the `title` field in the metadata at the start of a file, **always use the Liquid syntax variables rather than text** if a variable has been defined for that text. This ensures consistency and makes it easier to update product names globally. |
| 12 | + |
| 13 | +**Important**: Variables must be used in all content, including reusable content, data files, and regular articles. The only exception is the `title` field in frontmatter metadata. |
6 | 14 |
|
7 |
| -| Use this variable | Don't use this text | File where variable is defined | |
8 |
| -| --- | --- | --- | |
9 |
| -| `{% data variables.product.prodname_dotcom %}` | GitHub | data/variables/product.yml | |
10 |
| -| `{% data variables.product.prodname_ghe_server %}` | GitHub Enterprise Server | data/variables/product.yml | |
11 |
| -| `{% data variables.product.prodname_copilot_short %}` | Copilot | data/variables/product.yml | |
12 |
| -| `{% data variables.product.prodname_copilot %}` | GitHub Copilot | data/variables/product.yml | |
13 |
| -| `{% data variables.copilot.copilot_code-review_short %}` | Copilot code review | data/variables/copilot.yml | |
14 |
| -| `{% data variables.enterprise.prodname_managed_user %}` | managed user account | data/variables/enterprise.yml | |
15 |
| -| `{% data variables.code-scanning.codeql_workflow %}` | CodeQL analysis workflow | data/variables/code-scanning.yml | |
| 15 | +For example: |
| 16 | + |
| 17 | +| Use this variable | Don't use this text | File where variable is defined | |
| 18 | +| -------------------------------------------------------- | ------------------------ | -------------------------------- | |
| 19 | +| `{% data variables.product.github %}` | GitHub | data/variables/product.yml | |
| 20 | +| `{% data variables.product.prodname_ghe_server %}` | GitHub Enterprise Server | data/variables/product.yml | |
| 21 | +| `{% data variables.product.prodname_copilot_short %}` | Copilot | data/variables/product.yml | |
| 22 | +| `{% data variables.product.prodname_copilot %}` | GitHub Copilot | data/variables/product.yml | |
| 23 | +| `{% data variables.copilot.copilot_code-review_short %}` | Copilot code review | data/variables/copilot.yml | |
| 24 | +| `{% data variables.enterprise.prodname_managed_user %}` | managed user account | data/variables/enterprise.yml | |
| 25 | +| `{% data variables.code-scanning.codeql_workflow %}` | CodeQL analysis workflow | data/variables/code-scanning.yml | |
16 | 26 |
|
17 | 27 | There are many more variables. These are stored in various YAML files within the `data/variables` directory.
|
18 | 28 |
|
| 29 | +**How to find variables**: Check the `data/variables` directory for existing variables before writing hardcoded text. Common variable files include: |
| 30 | + |
| 31 | +* `data/variables/product.yml` - Product names and variations |
| 32 | +* `data/variables/copilot.yml` - Copilot-specific terms |
| 33 | +* `data/variables/enterprise.yml` - Enterprise-specific terms |
| 34 | +* `data/variables/code-scanning.yml` - Code scanning terms |
| 35 | + |
| 36 | +### Reusable text |
| 37 | + |
| 38 | +Reusables are long strings of reusable text, such as paragraphs or procedural lists, that are referenced in multiple content files. This makes it easier for us to maintain content and ensure that it is accurate across all files where the content is needed. |
| 39 | + |
| 40 | +Each reusable lives in its own Markdown file. The path and filename of each reusable determines what its path will be in the data object. For example, a file named `/data/reusables/foo/bar.md` will be accessible as `{% data reusables.foo.bar %}` in articles. |
| 41 | + |
| 42 | +Examples where you should create a reusable: |
| 43 | + |
| 44 | +* You are documenting a new feature for a public preview. You need to create a note to display in all new articles about the new feature. Create a new reusable for the note and use it in all articles where it is needed. |
| 45 | +* You are documenting billing for a new feature and need to briefly mention how the feature is billed and link to content about billing in several articles. Create a new reusable with the brief mention and a link to the content on billing. Aim to use the reusable in all places where you want to mention billing for the feature. |
| 46 | + |
19 | 47 | ### Links to other articles
|
20 | 48 |
|
21 |
| -`[AUTOTITLE]` is the correct way to specify the title of a linked article, when that article is another page on the docs.github.com site. Do not suggest replacing the placeholder link text `[AUTOTITLE]` with the actual page title or using the `{% link %}` Liquid tag. |
| 49 | +`[AUTOTITLE]` is the **only correct way** to specify the title of a linked article when that article is another page on the docs.github.com site. |
| 50 | + |
| 51 | +You can replace the placeholder link text `[AUTOTITLE]` only when linking to an anchor in the same article or when linking to an anchor in another article and the actual article title would be confusing. |
| 52 | + |
| 53 | +Never use the `{% link %}` Liquid tag for internal documentation links. The `[AUTOTITLE]` placeholder automatically pulls the correct title and ensures links remain valid when titles change. |
| 54 | + |
| 55 | +Examples: |
| 56 | + |
| 57 | +* ✅ Correct: `For more information, see [AUTOTITLE](/copilot/using-github-copilot).` |
| 58 | +* ❌ Incorrect: `For more information, see [Using GitHub Copilot](/copilot/using-github-copilot).` |
| 59 | +* ❌ Incorrect: `For more information, see {% link /copilot/using-github-copilot %}.` |
22 | 60 |
|
23 | 61 | ### Creating a pull request
|
24 | 62 |
|
25 |
| -When creating a pull request as a result of a request to do so in Copilot Chat, the first line of the PR description should always be the following (in italics): `_This pull request was created as a result of the following prompt in Copilot Chat._` Then, within a collapsed section, quote the original prompt from Copilot Chat. The clickable text that expands the collapsed section should be: Original prompt - submitted by @GITHUB-USER-ID. Where @GITHUB-USER-ID is the @ user name of the GitHub user who submitted the prompt. |
| 63 | +When creating a pull request as a result of a request to do so in Copilot Chat, the first line of the PR description should **always** be the following (in italics): |
| 64 | + |
| 65 | +`_This pull request was created as a result of the following prompt in Copilot Chat._` |
| 66 | + |
| 67 | +Then, within a collapsed section, quote the original prompt from Copilot Chat: |
| 68 | + |
| 69 | +```markdown |
| 70 | +<details> |
| 71 | +<summary>Original prompt - submitted by @GITHUB-USER-ID</summary> |
| 72 | + |
| 73 | +> [Original prompt text here] |
| 74 | + |
| 75 | +</details> |
| 76 | +``` |
| 77 | + |
| 78 | +This helps reviewers understand the context and intent behind the automated changes. |
| 79 | + |
| 80 | +## Development and testing guidelines |
| 81 | + |
| 82 | +### Content changes |
| 83 | + |
| 84 | +Before committing content changes, always: |
| 85 | + |
| 86 | +1. **Use the content linter** to validate content: `npm run lint-content -- --paths <file-paths>` |
| 87 | +2. **Check for proper variable usage** in your content |
| 88 | +3. **Verify [AUTOTITLE] links** point to existing articles |
| 89 | +4. **Run tests** on changed content: `npm run test -- src/content-render/tests/render-changed-and-deleted-files.js` |
| 90 | + |
| 91 | +### Script and code changes |
| 92 | + |
| 93 | +For TypeScript, JavaScript, and SCSS files: |
| 94 | + |
| 95 | +1. **Run Prettier** to check formatting: `npm run prettier-check` |
| 96 | +2. **Run the linter**: `npm run lint` |
| 97 | +3. **Run TypeScript checks**: `npm run tsc` |
| 98 | +4. **Run relevant tests**: `npm test` |
| 99 | + |
| 100 | +### Environment setup |
| 101 | + |
| 102 | +When testing changes in your development environment: |
| 103 | + |
| 104 | +1. Install dependencies: `npm ci` |
| 105 | +2. For content changes, ensure the content linter runs successfully |
| 106 | +3. For script changes, ensure all formatting and linting checks pass |
| 107 | +4. Always verify your changes don't break existing functionality |
0 commit comments