xyd 0.1.0-beta - Coming Soon

Writing Content
/
Developer Content

Developer Content

Learn how to write content for developers

In this guide, you'll learn how to write content for developers, like code snippets, examples, and more.

Code Blocks

You can use standard markdown code blocks (```) to write code blocks. Syntax highlighting is automatically applied based on the language of the code.

Input:

Output:

You can also customize syntax highlighting. Please see theme settings for more details.

Syntax Highlighting

Default syntax highlighting depends on used theme but you can override it via docs.json:

You can use the Theme Editor to customize any of the built-in themes or any theme from the VS Code marketplace.

 

Line Highlighting

Input:

Output:

You can also specify multiple single lines or ranges:

  • Multiple single lines: {1,3,5}
  • Line ranges: {2-4}, {6-8}, {11-13}
  • Line ranges + single lines: {1,6-8,11}
  • All together: {1,3-5}

Input:

Output:

 

Code Diff

Input:

Output:

 

Code Groups

You can use the code-group component to group multiple code blocks together.

Input:

Output:

 

Code Attributes

Code attributes allow you to customize the behavior and appearance of code blocks. Attributes are specified within square brackets [] after the language identifier and before the code content.

Syntax:

Line Numbers

You can add line numbers to code blocks by adding the lines attribute after the language identifier.

Input:

Output:

you can also manage line numbers globally:

Disable Scroll

To make a code snippet display in full height without scrolling, you can use the !scroll attribute:

Input:

Output:

you can also manage scroll globally:

Code Description

Input:

Output:

Currently desc supports a basic markdown syntax like **, * or ~~ but DOES NOT support more advanced writing features.

you can also use custom icon:

Output:

Import Code

You can import code from a file using the @importCode function:

Include

You can use @include function to include another content files in current content:

Diagrams

MermaidBeta

Visualize complex concepts and workflows using Mermaid diagrams directly in your Markdown. Mermaid supports multiple diagram types including flowcharts, sequence diagrams, class diagrams, state diagrams, and Gantt charts.

Before you start writing a diagrams make sure you enabled diagrams integration:

Simply wrap your diagram syntax in a mermaid code block:

Yes

No

Start

Decision?

Process A

Process B

End

Latex

Supports LaTeX for math equations. To use LaTeX, wrap your inline math equations in $. For example, $(a^2 + b^2 = c^2)$ will render a2+b2=c2a^2 + b^2 = c^2.

For display math equations, wrap the equation in $$:

ddx(0xf(t)dt)=f(x)\frac{d}{dx}\left(\int_0^x f(t) \, dt\right) = f(x)

Changelog

You can also render changelog page using the @changelog function:

currently supported changelog format:

Built with

Show your support! Star us on GitHub ⭐️