Skip to content

Commit 68e5219

Browse files
authored
Merge branch 'dotnet:main' into main
2 parents a9d399e + fc63e67 commit 68e5219

File tree

530 files changed

+6412
-1778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+6412
-1778
lines changed

.github/copilot-instructions.md

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,76 @@
1-
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.
1+
# .NET Documentation Guidelines
22

3-
When writing documentation, follow the following guidelines:
3+
## Disclosure
44

5-
Unless otherwise specified, all .NET content refers to modern .NET (not .NET Framework).
5+
For any Markdown files generated by AI, always disclose that they were created with the assistance of AI. Add the following frontmatter key/value pair:
66

7-
Follow the style of the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/).
7+
```markdown
8+
ai-usage: ai-generated
9+
```
810

9-
Headings should be in sentence case, not title case. Don't use gerunds in titles.
11+
## Terminology
1012

11-
Use the active voice whenever possible, and second person to address the reader directly.
13+
- Unless otherwise specified, all .NET content refers to modern .NET (not .NET Framework).
1214

13-
Use a conversational tone with contractions.
15+
## Writing Style
1416

15-
Be concise.
17+
Follow [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/) with these specifics:
1618

17-
Break up long sentences.
19+
### Voice and Tone
1820

19-
Use the present tense for instructions and descriptions. For example, "The method returns a value" instead of "The method will return a value."
21+
- Active voice, second person addressing reader directly.
22+
- Conversational tone with contractions.
23+
- Present tense for instructions/descriptions.
24+
- Imperative mood for instructions ("Call the method" not "You should call the method").
25+
- Use "might" instead of "may" for possibility.
26+
- Use "can" instead of "may" for permissible actions.
27+
- Avoid "we"/"our" referring to documentation authors or product teams.
2028

21-
Do not use "we" or "our" to refer to the authors of the documentation.
29+
### Structure and Format
2230

23-
Use the imperative mood for instructions. For example, "Call the method" instead of "You should call the method."
31+
- Sentence case headings (no gerunds in titles).
32+
- Be concise, break up long sentences.
33+
- Oxford comma in lists.
34+
- Number all ordered list items as "1." (not sequential numbering like "1.", "2.", "3.", etc.)
35+
- Use bullets for unordered lists.
36+
- Ordered and unordered lists should use complete sentences with proper punctuation, ending with a period if it's more than three words.
37+
- Avoid "etc." or "and so on" - provide complete lists or use "for example".
38+
- No consecutive headings without content between them.
2439

25-
Use "might" instead of "may" to indicate possibility. For example, "This method might throw an exception" instead of "This method may throw an exception."
40+
### Formatting Conventions
2641

27-
Use the Oxford comma in lists of three or more items.
42+
- **Bold** for UI elements.
43+
- `Code style` for file names, folders, custom types, non-localizable text.
44+
- Raw URLs in angle brackets.
45+
- Use relative links for files in this repo.
46+
- Remove `https://learn.microsoft.com/en-us` from learn.microsoft.com links.
2847

29-
Number ordered list items all as "1." instead of "1.", "2.", etc.
48+
## API References
3049

31-
Use bullets for unordered lists. Unless *all* the bullet list items are three words or less, each bullet item should end with a period.
50+
Use cross-references: `<xref:api-doc-ID>`.
3251

33-
Use **bold** when referring to UI elements. Use `code style` for file names and folders, custom types, and other text that should never be localized.
52+
To find API doc IDs:
53+
1. Check XML files in https://github.com/dotnet/dotnet-api-docs.
54+
2. For types: `Value` attribute of `<TypeSignature>` where `Language="DocId"` (omit first 2 characters).
55+
3. For members: `Value` attribute of `<MemberSignature>` where `Language="DocId"` (omit first 2 characters).
3456

35-
Put raw URLs within angle brackets.
57+
If unsure, use API browser: `https://learn.microsoft.com/api/apibrowser/dotnet/search?api-version=0.2&locale=en-us&search={API_NAME}&$skip=0&$top=5` and then use the `url` value from the results as a manual link.
3658

37-
Include links to related topics and resources where appropriate. Use relative links if the target file lives in this repo. If you add a link to another page on learn.microsoft.com that's not in this repo, remove https://learn.microsoft.com/en-us from the link.
59+
## Code Snippets
3860

39-
When mentioning APIs, use cross-references to the API documentation. These links are formatted as <xref:api-doc-ID>. You can find the API doc ID in the XML files in the https://github.com/dotnet/dotnet-api-docs repository. For types, the doc ID is the value of the `Value` attribute of the `<TypeSignature>` element where the `Language` attribute value is `DocId`. For other (member) APIs, the doc ID is the value of the `Value` attribute of the `<MemberSignature>` element where the `Language` attribute value is `DocId`. Omit the first two characters of the DocId. For example, the xref link for System.String is <xref:System.String>.
61+
For snippets >6 lines:
62+
1. Create `./snippets/my-doc/language` folder in same directory as document (for a document named `my-doc.md`) where language is either vb (for visual basic) or csharp (for c#). Omit the `language` component when the document is in the `docs/visual-basic`, `docs/csharp`, or `docs/fsharp` folders.
63+
1. Add snippet as separate code file.
64+
1. Include simple project file targeting latest .NET.
65+
1. All code should use the latest stable versions/features.
66+
1. Create examples in both C# and Visual Basic unless the article referencing the snippet resides in the in the `csharp`, `fsharp`, and `visual-basic` language folders.
67+
1. When you add code, use code comments sparingly because they don't get localized. You can use them to briefly clarify code-specific details (such as logic, parameters, or edge cases). Put any critical information and context in the markdown text of the referencing article.
4068

41-
If you're assigned a GitHub issue that's labeled "breaking-change", include the prompt directions in the .github/prompts/breaking-change.md file in this repo.
69+
## File Naming
4270

43-
If you include a code snippet that's more than 6 lines long, put it in a separate .cs file in a folder named "snippets" in the same folder as the document. Within the "snippets" folder, add a new directory with the name of the document. For example, if the document is named "my-doc.md", create a folder named "snippets/my-doc" folder. Also add a simple .csproj file to the same directory that targets the latest version of .NET. It can be a library or executable project.
71+
New Markdown files: lowercase with hyphens, omit filler words (the, a, etc.).
4472

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.
73+
## Special Cases
74+
75+
- Breaking changes: Include directions from `.github/prompts/breaking-change.md`.
76+
- When you (Copilot) are assigned an issue in GitHub, 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.

.github/prompts/whats-new-net.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,35 @@ For preview releases, the path is `<major-release>/preview/preview<n>` where:
2727

2828
The primary release notes are in the `README.MD` file in that folder. That file contains links to other release notes for components of .NET: libraries, runtime, SDK, languages, and so on. Use all that information for source.
2929

30+
The source files you use are release notes from the product team. These take the form of announcements, so you should edit any incorporated content per the following guidelines:
31+
32+
- Remove any 1st person references (we, us, our), and rewrite that information in the 2nd person: Tell the reader what the reader can do, using "you" to refer to the reader.
33+
- Remove any marketing and promotional language. These articles provide technical information, not marketing copy.
34+
3035
## Updates for each file
3136

37+
Each file should be organized to provide a cohesive story about "What's new" in the release. When you edit:
38+
39+
- The introductory paragraph states when the last update was made (Preview N, general release, any service release). That is the only mention of the latest minor, patch, or preview version.
40+
- If one of the areas (SDK, libraries, or runtime) doesn't have any updates for the current release (preview, RC, or GA), update the introductory paragraph and ms.date value, without making any other changes.
41+
- Each file should organize updates by feature area, not by when an update was made. In other words, starting with the 2nd preview, incorporate updates to the existing text to provide a single view of all updates made in the major release. For example, the "RC1" updates should add in updates in RC1 where it fits in the document, not make a new "RC1" section.
42+
- If a preview introduces a new feature that's unrelated to existing new features, add a new H2 for that feature area.
43+
44+
In addition, follow these recommendations:
45+
46+
- Follow the Microsoft Writing Style Guide, as noted in the `.github/copilot-instructions.md` file in this repository.
3247
- Each file should have its `ms.date` metadata field updated to match the date you're assigned the issue.
3348
- Ensure each file has the `ai-usage: ai-assisted` metadata field added.
3449
- Update phrasing on the latest update to reference the current release (preview, GA, or service release). Individual features shouldn't reference a given preview release, but the article should make it clear which was the last preview.
3550
- Search this repository for articles that have been recently updated pertaining to new features. Add links to those as you write about that feature. Or, add applicable information from the release notes into existing feature articles where it makes sense.
3651
- For the runtime and libraries articles, include extensive examples as well as links to recently updated articles related to the new feature. The examples should be at least as thorough as the examples from the source release notes.
3752
- Where applicable, the SDK article should include the samples.
3853
- The overview article generally doesn't include examples. Its purpose is to direct readers to more detailed information in other articles.
39-
- All APIs should be referenced using an `xref` style link, at least on first mention.
54+
- All APIs should be referenced using an `xref` style link, at least on first mention. Later mentions should be code-fenced in single back-ticks.
4055
- All links to article in the `dotnet/docs` repository should be file relative.
4156
- Spell out acronyms on first use in each file.
57+
- Avoid gerund form in headings.
4258
- In general, don't mention specific contributors or pull requests to the product repos.
59+
- Code snippets longer than 6 lines should be moved to a code file and included using the `:::` extension. All code files should be included in a buildable project to ensure the snippets build correctly.
4360

4461
Next, create a pull request. In the description, include the text "Fixes #\<issue-number>", where "issue-number" is the GitHub issue number.

.github/workflows/cleanrepo-orphaned-articles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-orphaned-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-orphaned-includes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-orphaned-snippets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-redirect-hops.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-relative-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/cleanrepo-replace-redirects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/dependabot-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
egress-policy: audit
3232

33-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3434
# - name: Setup .NET
3535
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
3636
# with:

0 commit comments

Comments
 (0)