Documentation cheat sheet

Use this cheat sheet to write correct Sphinx syntax and to reuse the custom helpers available in this documentation.

Sphinx heading conventions

Please follow the heading adornment conventions used across this repository. Each document has exactly one title, then sections nest in this order:

Level

Overline & Underline

Underline only

Character

Document title

yes

N/A

-

Section

N/A

yes

=

Sub-section

N/A

yes

^

Sub-sub-section

N/A

yes

"

Adding an in-page contents tree

To add a table of contents built from the headings of your page, put the following at the top of the page, just under the title:

.. contents::
   :local:
   :depth: 2

The top of this page uses exactly that directive.

Making a checklist

You can add simple task checklists to any page using the checklist directive.

Note

Checklists are clickable in HTML builds. In PDF or LaTeX they render as static boxes. If the project includes the optional checklist.js, the checkbox state is remembered per browser.

Prerequisites

The custom extension must be enabled in conf.py:

extensions = [
    # ... other extensions ...
    "_checklist",
]

Basic usage

Write one task per line inside the directive. Use [ ] for unchecked and [x] for checked (lowercase x).

.. checklist::

   - [ ] Write the introduction
   - [x] Add figures
   - [ ] Final proofreading

Result

  • checkbox empty: Write the introduction

  • checkbox ticked: Add figures

  • checkbox empty: Final proofreading

Tips

  • Start each task with - [ ] or - [x] exactly.

  • Each task is plain text (no nested markup).

  • For sub-tasks, add another checklist block under a bullet or subsection.

Example with sections

**Docs**

.. checklist::

   - [ ] API reference pass
   - [x] Tutorial outline

**Release**

.. checklist::

   - [ ] Changelog
   - [ ] Tag and publish