Skip to content

Commit 710eaff

Browse files
authored
add code tags (#18703)
1 parent 2c30f8d commit 710eaff

19 files changed

+58
-56
lines changed

docs/csharp/programming-guide/xmldoc/code-inline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ms.assetid: aad5b16e-a29e-445e-bd0d-eea0b138d7b2
2727

2828
## Remarks
2929

30-
The \<c> tag gives you a way to indicate that text within a description should be marked as code. Use [\<code>](./code.md) to indicate multiple lines as code.
30+
The `<c>` tag gives you a way to indicate that text within a description should be marked as code. Use [\<code>](./code.md) to indicate multiple lines as code.
3131

3232
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3333

docs/csharp/programming-guide/xmldoc/code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ ms.assetid: f235e3bc-a709-43cf-8a9f-bd57cabdf6da
2525

2626
## Remarks
2727

28-
The \<code> tag gives you a way to indicate multiple lines as code. Use [\<c>](./code-inline.md) to indicate that text within a description should be marked as code.
28+
The `<code>` tag is used to indicate multiple lines of code. Use [\<c>](./code-inline.md) to indicate that single-line text within a description should be marked as code.
2929

3030
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3131

3232
## Example
3333

34-
See the [\<example>](./example.md) topic for an example of how to use the \<code> tag.
34+
See the [\<example>](./example.md) article for an example of how to use the `<code>` tag.
3535

3636
## See also
3737

docs/csharp/programming-guide/xmldoc/delimiters-for-documentation-tags.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ The use of XML doc comments requires delimiters, which indicate to the compiler
1313

1414
- `///`
1515

16-
Single-line delimiter. This is the form that is shown in documentation examples and used by the Visual C# project templates. If there is a white space character following the delimiter, that character is not included in the XML output.
16+
Single-line delimiter. This is the form that is shown in documentation examples and used by the C# project templates. If there is a white space character following the delimiter, that character is not included in the XML output.
1717

1818
> [!NOTE]
19-
> The Visual Studio IDE has a feature called Smart Comment Editing that automatically inserts the \<summary> and \</summary> tags and moves your cursor within these tags after you type the `///` delimiter in the Code Editor. You can turn this feature on or off in the [Options dialog box](/visualstudio/ide/reference/options-text-editor-csharp-advanced).
19+
> The Visual Studio integrated development environment (IDE) automatically inserts the `<summary>` and `</summary>` tags and moves your cursor within these tags after you type the `///` delimiter in the code editor. You can turn this feature on or off in the [Options dialog box](/visualstudio/ide/reference/options-text-editor-csharp-advanced).
2020
2121
- `/** */`
2222

@@ -26,13 +26,13 @@ The use of XML doc comments requires delimiters, which indicate to the compiler
2626

2727
- On the line that contains the `/**` delimiter, if the remainder of the line is white space, the line is not processed for comments. If the first character after the `/**` delimiter is white space, that white space character is ignored and the rest of the line is processed. Otherwise, the entire text of the line after the `/**` delimiter is processed as part of the comment.
2828

29-
- On the line that contains the `*/` delimiter, if there is only white space up to the `*/` delimiter, that line is ignored. Otherwise, the text on the line up to the `*/` delimiter is processed as part of the comment, subject to the pattern-matching rules described in the following bullet.
29+
- On the line that contains the `*/` delimiter, if there is only white space up to the `*/` delimiter, that line is ignored. Otherwise, the text on the line up to the `*/` delimiter is processed as part of the comment.
3030

3131
- For the lines after the one that begins with the `/**` delimiter, the compiler looks for a common pattern at the beginning of each line. The pattern can consist of optional white space and an asterisk (`*`), followed by more optional white space. If the compiler finds a common pattern at the beginning of each line that does not begin with the `/**` delimiter or the `*/` delimiter, it ignores that pattern for each line.
3232

3333
The following examples illustrate these rules.
3434

35-
- The only part of the following comment that will be processed is the line that begins with `<summary>`. The three tag formats produce the same comments.
35+
- The only part of the following comment that's processed is the line that begins with `<summary>`. The three tag formats produce the same comments.
3636

3737
```csharp
3838
/** <summary>text</summary> */
@@ -71,7 +71,7 @@ The use of XML doc comments requires delimiters, which indicate to the compiler
7171
* <summary>
7272
* text
7373
* text2
74-
* </summary>
74+
* </summary>
7575
*/
7676
```
7777
<!-- markdownlint-enable MD010 -->

docs/csharp/programming-guide/xmldoc/example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ms.assetid: 32d6e73b-2554-4abb-83ee-a1e321334fd2
2525

2626
## Remarks
2727

28-
The \<example> tag lets you specify an example of how to use a method or other library member. This commonly involves using the [\<code>](./code.md) tag.
28+
The `<example>` tag lets you specify an example of how to use a method or other library member. This commonly involves using the [\<code>](./code.md) tag.
2929

3030
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3131

docs/csharp/programming-guide/xmldoc/exception.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ms.assetid: dd73aac5-3c74-4fcf-9498-f11bff3a2f3c
3131

3232
## Remarks
3333

34-
The \<exception> tag lets you specify which exceptions can be thrown. This tag can be applied to definitions for methods, properties, events, and indexers.
34+
The `<exception>` tag lets you specify which exceptions can be thrown. This tag can be applied to definitions for methods, properties, events, and indexers.
3535

3636
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3737

docs/csharp/programming-guide/xmldoc/how-to-use-the-xml-documentation-features.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,28 @@ The example generates an *.xml* file with the following contents.
102102

103103
## Compiling the code
104104

105-
To compile the example, type the following command line:
105+
To compile the example, enter the following command:
106106

107107
`csc XMLsample.cs /doc:XMLsample.xml`
108108

109-
This command creates the XML file *XMLsample.xml*, which you can view in your browser or by using the TYPE command.
109+
This command creates the XML file *XMLsample.xml*, which you can view in your browser or by using the `TYPE` command.
110110

111111
## Robust programming
112112

113-
XML documentation starts with ///. When you create a new project, the wizards put some starter /// lines in for you. The processing of these comments has some restrictions:
113+
XML documentation starts with `///`. When you create a new project, the wizards put some starter `///` lines in for you. The processing of these comments has some restrictions:
114114

115115
- The documentation must be well-formed XML. If the XML is not well-formed, a warning is generated and the documentation file will contain a comment that says that an error was encountered.
116116

117117
- Developers are free to create their own set of tags. There is a [recommended set of tags](recommended-tags-for-documentation-comments.md). Some of the recommended tags have special meanings:
118118

119-
- The \<param> tag is used to describe parameters. If used, the compiler verifies that the parameter exists and that all parameters are described in the documentation. If the verification failed, the compiler issues a warning.
119+
- The `<param>` tag is used to describe parameters. If used, the compiler verifies that the parameter exists and that all parameters are described in the documentation. If the verification fails, the compiler issues a warning.
120120

121-
- The `cref` attribute can be attached to any tag to provide a reference to a code element. The compiler verifies that this code element exists. If the verification failed, the compiler issues a warning. The compiler respects any `using` statements when it looks for a type described in the `cref` attribute.
121+
- The `cref` attribute can be attached to any tag to reference a code element. The compiler verifies that this code element exists. If the verification fails, the compiler issues a warning. The compiler respects any `using` statements when it looks for a type described in the `cref` attribute.
122122

123-
- The \<summary> tag is used by IntelliSense inside Visual Studio to display additional information about a type or member.
123+
- The `<summary>` tag is used by IntelliSense inside Visual Studio to display additional information about a type or member.
124124

125125
> [!NOTE]
126-
> The XML file does not provide full information about the type and members (for example, it does not contain any type information). To get full information about a type or member, the documentation file must be used together with reflection on the actual type or member.
126+
> The XML file does not provide full information about the type and members (for example, it does not contain any type information). To get full information about a type or member, use the documentation file together with reflection on the actual type or member.
127127
128128
## See also
129129

docs/csharp/programming-guide/xmldoc/include.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ The ID for the tag that precedes the comments. Enclose the ID in double quotatio
3737

3838
## Remarks
3939

40-
The \<include> tag lets you refer to comments in another file that describe the types and members in your source code. This is an alternative to placing documentation comments directly in your source code file. By putting the documentation in a separate file, you can apply source control to the documentation separately from the source code. One person can have the source code file checked out and someone else can have the documentation file checked out.
40+
The `<include>` tag lets you refer to comments in another file that describe the types and members in your source code. This is an alternative to placing documentation comments directly in your source code file. By putting the documentation in a separate file, you can apply source control to the documentation separately from the source code. One person can have the source code file checked out and someone else can have the documentation file checked out.
4141

42-
The \<include> tag uses the XML XPath syntax. Refer to XPath documentation for ways to customize your \<include> use.
42+
The `<include>` tag uses the XML XPath syntax. Refer to XPath documentation for ways to customize your `<include>` use.
4343

4444
## Example
4545

46-
This is a multifile example. The following is the first file, which uses \<include>.
46+
This is a multifile example. The following is the first file, which uses `<include>`.
4747

4848
[!code-csharp[csProgGuideDocComments#5](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideDocComments/CS/DocComments.cs#5)]
4949

@@ -69,7 +69,7 @@ The summary for this other type.
6969

7070
## Program output
7171

72-
The following output is generated when you compile the Test and Test2 classes with the following command line: `-doc:DocFileName.xml.` In Visual Studio, you specify the XML doc comments option in the Build pane of the Project Designer. When the C# compiler sees the \<include> tag, it will search for documentation comments in xml_include_tag.doc instead of the current source file. The compiler then generates DocFileName.xml, and this is the file that is consumed by documentation tools such as [DocFX](https://dotnet.github.io/docfx/) and [Sandcastle](https://github.com/EWSoftware/SHFB) to produce the final documentation.
72+
The following output is generated when you compile the Test and Test2 classes with the following command line: `-doc:DocFileName.xml.` In Visual Studio, you specify the XML doc comments option in the Build pane of the Project Designer. When the C# compiler sees the `<include>` tag, it searches for documentation comments in *xml_include_tag.doc* instead of the current source file. The compiler then generates *DocFileName.xml*, and this is the file that is consumed by documentation tools such as [DocFX](https://dotnet.github.io/docfx/) and [Sandcastle](https://github.com/EWSoftware/SHFB) to produce the final documentation.
7373

7474
```xml
7575
<?xml version="1.0"?>

docs/csharp/programming-guide/xmldoc/list.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ ms.assetid: c9620b1b-c2e6-43f1-ab88-8ab47308ffec
4242

4343
## Remarks
4444

45-
The \<listheader> block is used to define the heading row of either a table or definition list. When defining a table, you only need to supply an entry for term in the heading.
45+
The `<listheader>` block is used to define the heading row of either a table or definition list. When defining a table, you only need to supply an entry for term in the heading.
4646

47-
Each item in the list is specified with an \<item> block. When creating a definition list, you will need to specify both `term` and `description`. However, for a table, bulleted list, or numbered list, you only need to supply an entry for `description`.
47+
Each item in the list is specified with an `<item>` block. When creating a definition list, you will need to specify both `term` and `description`. However, for a table, bulleted list, or numbered list, you only need to supply an entry for `description`.
4848

49-
A list or table can have as many \<item> blocks as needed.
49+
A list or table can have as many `<item>` blocks as needed.
5050

5151
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
5252

docs/csharp/programming-guide/xmldoc/para.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ ms.assetid: c74b8705-29df-40b1-bff5-237492b0e978
2525

2626
## Remarks
2727

28-
The \<para> tag is for use inside a tag, such as [\<summary>](./summary.md), [\<remarks>](./remarks.md), or [\<returns>](./returns.md), and lets you add structure to the text.
28+
The `<para>` tag is for use inside a tag, such as [\<summary>](./summary.md), [\<remarks>](./remarks.md), or [\<returns>](./returns.md), and lets you add structure to the text.
2929

3030
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3131

3232
## Example
3333

34-
See [\<summary>](./summary.md) for an example of using \<para>.
34+
See [\<summary>](./summary.md) for an example of using `<para>`.
3535

3636
## See also
3737

docs/csharp/programming-guide/xmldoc/param.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ ms.assetid: 46d329b1-5b84-4537-9e17-73ca97313e4e
2929

3030
## Remarks
3131

32-
The \<param> tag should be used in the comment for a method declaration to describe one of the parameters for the method. To document multiple parameters, use multiple \<param> tags.
32+
The `<param>` tag should be used in the comment for a method declaration to describe one of the parameters for the method. To document multiple parameters, use multiple `<param>` tags.
3333

34-
The text for the \<param> tag will be displayed in IntelliSense, the Object Browser, and in the Code Comment Web Report.
34+
The text for the `<param>` tag is displayed in IntelliSense, the Object Browser, and the Code Comment Web Report.
3535

3636
Compile with [-doc](../../language-reference/compiler-options/doc-compiler-option.md) to process documentation comments to a file.
3737

0 commit comments

Comments
 (0)