Skip to content

Commit 74f1650

Browse files
committed
Formatting and organziational fixes
1 parent 812fc78 commit 74f1650

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

.github/copilot-instructions.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ ms.date: 07-29-2025
99
## Introduction
1010
This document contains repository-specific instructions for GitHub Copilot when assisting with the `dotnet/AspNetCore.Docs` repository. **Unless otherwise specified, all ".NET" references refer to modern .NET, not .NET Framework.**
1111

12+
## General Guidelines
13+
14+
### Issue Handling
15+
When creating a PR for an issue:
16+
1. Read the full issue and all linked references
17+
2. Study code samples from linked PRs for pre-release features
18+
3. For labeled issues:
19+
- **new-feature:** State which version introduced the feature
20+
- **bug:** Focus on correcting technical inaccuracies
21+
4. When you're assigned an issue, after you've completed your work and the workflows (status checks) have run, check to make sure there are no build warnings under the OpenPublishing.Build status check. If there are, open the build report (under View Details) and resolve any build warnings you introduced.
22+
23+
### Markdown File Naming and Organization
24+
- If you're adding a new Markdown file, it should be named in all lowercase with hyphens separating words. Also, omit any filler words such as "the" or "a" from the file name.
25+
26+
### API References and Verification
27+
- Never guess API documentation IDs, always verify. If unable to verfy, say so.
28+
- Check if features were introduced after .NET Core 3.1
29+
- Default to most compatible syntax when uncertain
30+
31+
### Links and References
32+
- Use relative links for files within this repo
33+
- When adding external links into a document, strip out the language/culture segment of the URL if present (example: remove the `en-us` or `en` part of links to English versions of webpages)
34+
- For learn.microsoft.com links, remove `https://learn.microsoft.com/en-us` from URLs
35+
- Use cross-references for APIs: `<xref:api-doc-ID>`
36+
- Get doc ID from the relevant XML doc in dotnet-api-docs, and omit the first two characters of the doc ID
37+
1238
## Repository-Specific Guidelines
1339
- Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
1440
- **Repository Exceptions**:
@@ -21,30 +47,13 @@ This document contains repository-specific instructions for GitHub Copilot when
2147
- The correct order of metadata lines is to place the title (`title`) first and the rest of the metadata lines in alphabetical order. Example: `title`, `author`, `description`, `monikerRange`, `ms.author`, `ms.custom`, `ms.date`, `uid`, `zone_pivot_groups`
2248
- Metadata `ms.date: <today's date>` with a format of MM-DD-YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters are changed in the file.
2349

24-
## Version Targeting
25-
26-
### Common Range Patterns
50+
### Version Targeting Common Range Patterns
2751
- Fixed Range: `>= aspnetcore-7.0 <= aspnetcore-9.0`
2852
- Open Upper Bound: `>= aspnetcore-7.0`
2953
- Open Lower Bound: `<= aspnetcore-9.0`
3054
- Specific Version: `== aspnetcore-9.0`
3155

32-
## API References and Verification
33-
- Never guess API documentation IDs, always verify. If unable to verfy, say so.
34-
- Check if features were introduced after .NET Core 3.1
35-
- Default to most compatible syntax when uncertain
36-
37-
## Links and References
38-
- Use relative links for files within this repo
39-
- When adding external links into a document, strip out the language/culture segment of the URL if present (example: remove the `en-us` or `en` part of links to English versions of webpages)
40-
- For learn.microsoft.com links, remove `https://learn.microsoft.com/en-us` from URLs
41-
- Use cross-references for APIs: `<xref:api-doc-ID>`
42-
- Get doc ID from the relevant XML doc in dotnet-api-docs, and omit the first two characters of the doc ID
43-
44-
## Markdown File Naming and Organization
45-
- If you're adding a new Markdown file, it should be named in all lowercase with hyphens separating words. Also, omit any filler words such as "the" or "a" from the file name.
46-
47-
## Code Snippets
56+
### Code Snippets
4857
- For snippets **longer than 6 lines**:
4958
- Place in separate `.cs` file in a `snippets` folder next to the Markdown file
5059
- Create a subfolder named after the document
@@ -66,21 +75,20 @@ This document contains repository-specific instructions for GitHub Copilot when
6675
```
6776
- Use the latest, non-preview C# coding patterns in non-preview code examples
6877
- Use the latest preview C# coding patterns in preview code examples
78+
- Use the following code language and indentation standards for markdown code blocks or the `language` attribute of code snippets:
6979
70-
The following table indicates the code language to use for markdown code blocks or the `language` attribute of a code snippet and the amount of indentation to use.
80+
Content of the snippet | Code language | Indentation in spaces
81+
:---: | :---: | :---:
82+
C# | csharp | 4
83+
HTML | html | 4
84+
CSS | css | 4
85+
JavaScript | javascript | 2 (4 spaces for line continuation)
86+
XML | xml | 2
87+
JSON | json | 2
88+
Console | console | 2
89+
Text | - | 2
7190
72-
Content of the snippet | Code language | Indentation in spaces
73-
:---: | :---: | :---:
74-
C# | csharp | 4
75-
HTML | html | 4
76-
CSS | css | 4
77-
JavaScript | javascript | 2 (4 spaces for line continuation)
78-
XML | xml | 2
79-
JSON | json | 2
80-
Console | console | 2
81-
Text | - | 2
82-
83-
## ASP.NET Core Specific Guidelines
91+
### ASP.NET Core Specific Guidelines
8492
- Use the latest supported version for examples unless otherwise specified
8593
- Title and section header casing is sentence case (capitalize the first word and any proper nouns)
8694
- For parts of a title or section header that normally use code style in article text (backticks around the content), also use code style in the title or section header (example H1 header: "# Modify the `Program.cs` file")
@@ -90,13 +98,3 @@ Text | - | 2
9098
- Lead with Microsoft recommended approaches
9199
- Include differences between Minimal API and controller-based approaches when relevant
92100
- For middleware content and examples, use the middleware class approach
93-
94-
## Issue Handling
95-
When creating a PR for an issue:
96-
1. Read the full issue and all linked references
97-
2. Study code samples from linked PRs for pre-release features
98-
3. For labeled issues:
99-
- **new-feature:** State which version introduced the feature
100-
- **bug:** Focus on correcting technical inaccuracies
101-
4. When you're assigned an issue, after you've completed your work and the workflows (status checks) have run, check to make sure there are no build warnings under the OpenPublishing.Build status check. If there are, open the build report (under View Details) and resolve any build warnings you introduced.
102-

0 commit comments

Comments
 (0)