Adding the Doc
Contributing a doc
Contributing a new document can be achieved with the following, high-level flow:
- Create a new Markdown file (e.g.
your-doc-id.mdoryour-doc-id.mdx) in the appropriate directory underproducts/<product>/docs/…(or create a new directory). - Add the frontmatter (including the unique ID).
- Add the document ID to an existing or new sidebar/sidebar category in that product's
sidebars.ts. - Add the content.
tip
Use .md for plain Markdown and .mdx if your doc needs JSX (e.g. React components, import statements, custom className attributes).
Frontmatter
Each doc requires a frontmatter header at the top of the doc.
Example:
---
id: your-doc-id
title: My Awesome Tutorial
sidebar_label: My Awesome Tutorial
description: A really cool tutorial about something awesome!
keywords:
- awesome
- tutorial
---
note
If you're not sure where to begin, feel free to use an existing doc as boilerplate. Just remember that each document requires a unique ID.
Sidebar
Each product has its own sidebars.ts located at products/<product>/sidebars.ts. Add your doc's id (with the path relative to the product's docs folder) to the appropriate sidebar item.
module.exports = {
contributing: [
// Add your new doc inside an existing sidebar
{
type: "category",
label: "Tutorials", // Category label
items: ["contributing/tutorials/new-doc-id", "contributing/tutorials/your-doc-id"], // Document ID (including relative path after docs)
},
],
};
Now you should see your doc in the sidebar in your browser (run yarn start if you aren't already). Next we'll see what you can do with Markdown.