Writting docs#

Most documentation files are written in MyST format, which is an extension of the Markdown (hence, the .md extension). This guide will show you the basics of writting MyST files.

Admonitions#

Admonitions allow you to grab reader’s attention:

```{warning}
Some warning
```

Example:

Warning

Some warning

```{note}
Some note
```

Example:

Note

Some note

For more information, see jupyter-book documentation.

SEO metadata#

Each documentation file must contain metadata for search engines. Here’s the format depending on the extension type.

.md files#

Add the following myst section:

---
jupytext:
  notebook_metadata_filter: myst # ADD THIS IF MISSING!

  # some existing metadata
  ...

myst:
  html_meta:
    description lang=en: "Some description"
    keywords: "Key1, Key2"
    property=og:locale: "en_US"
---

.ipynb files#

Add the following myst section:

{
    "myst": {
        "html_meta": {
            "description lang=en": "Description",
            "keywords": "Key1, Key2",
            "property=og:locale": "en_US"
        }
    }
}

To open the metadata editor:

jupyter-metadata

.rst files#

.. meta::
    :description lang=en:
        Some description
    :keywords: Tag1, Tag2

Tutorials#

By default, .md are static. However, in many cases, we want them to be runnable, meaning the code will be executed (and results displayed) when building the documentation.

Here’s an example of runnable content. To make your .md file runnable, see here.