Writing Quickstart
Learn how to write content
Learn how to write documentation content using Markdown, MDX, and xyd's built-in components.
Headers
You can define headers using markdown syntax like:
with header subtitle:
alternatively:
with header label:
Header Anchors
Headers get automatically anchor links applied.
If you'd like to set a custom anchor, add an id sugar syntax prop to the heading:
This sets the heading anchor to #custom-anchors instead of the default #my-custom-anchors.
ToC Anchors
The table of contents (TOC) will be generated based on headings, you can also customize that:
Learn more about Page Meta options for TOC here.
Content
To write a content for your page, you can use the MDX or Markdown syntax. You can also leverage built in components or special symbols to enhance your content:
While MDX is powerful, xyd makes writing docs much easier using markdown special symbols.
But you can still use pure MDX or both if you want.
Markdown GFM
You can use GFM (GitHub Flavored Markdown) to write your content like this:
Component Directives
Use markdown directives (:::) to render components in markdown syntax. The full list of components you can find here.
For example you would render components like this:
You can also use MDX version of the same component.
Steps
For creating steps you can use such us syntax:
Tabs
For creating tabs, you can use the following syntax:
TablesExperimental
You can also use CSV-like version of declaring tables with some sugar-syntax:
You can still use GFM version of tables too.
Including Content
You can use @include function to include another content files in current content:
Emojis š
For declaring just copy and paste the emoji you want to use in your markdown, for example:
MDXExperimental
MDX combines Markdown with JSX, letting you use React components in your docs.
Reusable componentsComing Soon
- Creating a reusable component:
- Now, you can use it in your MDX files:
Reusable variablesComing Soon
-
You can also use MDX for reusable variables, by exporting data from your MDX files:
-
Now, you can use it in your MDX files:
Exporting component variablesComing Soon
- You can also add variables that can be filled in via props when you import the file:
- And then pass variables as props:
This creates a navigation component with two tabs: "CLI" and "Code", each with its own content. The content for each tab follows the tab definition.
Show your support! Star us on GitHub āļø