Skip to content

Commit 38fee24

Browse files
authored
Merge pull request #8133 from microsoft/contributing-guide
Update contributing guidelines (ToC updates)
2 parents c345c1c + 3792f6e commit 38fee24

File tree

1 file changed

+58
-5
lines changed

1 file changed

+58
-5
lines changed

CONTRIBUTING.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,71 @@ The topics in this repository use Markdown. Here is a good overview of [Markdow
7878

7979
## Topic Metadata
8080

81-
Topic metadata enables certain functionalities for the topics such as table of contents order, topic descriptions, and online search optimization as well as aiding Microsoft in evaluating the effectiveness of the content.
81+
Topic metadata enables certain functionalities for the topics such as topic description and online search optimization.
82+
83+
The page title is taken from the first H1 heading in the topic.
8284

83-
* **Order** - This is the order that is used in the left rail TOC, the page is left out of the TOC if this is blank.
84-
* **Area** - General area within VS Code. Corresponds to the high-level Table of Contents (TOC) node.
85-
* **TOCTitle** - The title used in the left rail Table of Contents for this page.
86-
* **PageTitle** - The title used in the HTML title for the page and in search results.
8785
* **ContentId** - A GUID that uniquely identifies the topic to DevDiv doc reporting.
8886
* **DateApproved** - The date of the most recent update or review. It is displayed at the bottom of an article to indicate freshness. The date should be updated in a significant PR.
8987
* **MetaDescription** - The meta description for this page, which helps for search. Use sentence structure limited to 300 characters.
9088
* **MetaSocialImage** - Optional. Used for og:image in page header for sharing on social media. Should be 1024 x 512 .png.
9189
* **MetaTags** - Optional. Further tags for this page again for search.
9290

91+
## Table of contents
92+
93+
The table of contents (TOC) is defined in the `/docs/toc.yml` file. The TOC is used to generate the left rail navigation for the documentation. If a topic is not listed in the `/docs/toc.yml` file, it will not be included in the left rail navigation.
94+
95+
To add a new topic to the TOC, add a new entry in the `topics` attribute of the appropriate section in the `/docs/toc.yml` file. The TOC is organized into sections, each with a name and an area. The area is used to group related topics together.
96+
97+
The order in which the topics are listed in the `/docs/toc.yml` file determines the order in which they are displayed in the left rail navigation.
98+
99+
Each topic in the TOC has two attributes:
100+
101+
* TOC title: the title that is displayed in the left rail navigation.
102+
* File name: the relative path to the topic file in the format `/docs/<subfolder>/<filename-without-md>`.
103+
104+
The following example shows a `Getting Started` section that has two topics.
105+
106+
```yaml
107+
{
108+
"name": "Getting Started",
109+
"area": "getstarted",
110+
"topics": [
111+
["VS Code Tutorial", "/docs/getstarted/getting-started"],
112+
["Copilot Quickstart", "/docs/getstarted/copilot-quickstart"]
113+
]
114+
},
115+
```
116+
117+
To create a subsection within a section, add a subsection entry to the `topics` attribute. A subsection entry has the following attributes:
118+
119+
* TOC Title: empty string
120+
* File name: empty string
121+
* Subsection: a subsection entry with the same format as a section entry. It has a `name` attribute, an `area` attribute, and a `topics` attribute.
122+
123+
The following example shows a `Guides` subsection with two topics, within the `GitHub Copilot` section.
124+
125+
```yaml
126+
{
127+
"name": "GitHub Copilot",
128+
"area": "copilot",
129+
"topics": [
130+
["Overview", "/docs/copilot/overview"],
131+
["Setup", "/docs/copilot/setup"],
132+
["", "", {
133+
"name": "Guides",
134+
"area": "copilot/guides",
135+
"topics": [
136+
["Test with Copilot", "/docs/copilot/guides/test-with-copilot"],
137+
["Debug with Copilot", "/docs/copilot/guides/debug-with-copilot"]
138+
]
139+
}
140+
],
141+
["FAQ", "/docs/copilot/faq"]
142+
]
143+
},
144+
```
145+
93146
## Product name
94147

95148
Use the full product name "Visual Studio Code" in the topic MetaDescription and the first use in a topic. You can use the shortened "VS Code" after that throughout the rest of the content. Do not use "VSCode" (no space) or "Code".

0 commit comments

Comments
 (0)