Sphinx

Extensions and Themes

Know-how

Turn warnings into errors

It is possible to turn warnings into errors. This way a build fails when something is wrong. To do this edit the Makefile of Sphinx and change this line:

SPHINXOPTS    ?= -W

Also see: https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-W

MyST Syntax

  • add a link to a locale PDF or other file - source
{download}`text <_static/reference.pdf>`

May.la Installation

  • create repo on GitHub and clone it
  • chane into the repo directory
  • run sphinx-quickstart - say yes here:
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/n) [n]:
html_theme_options = {
    "prev_next_buttons_location": None,
}

Commands

  • convert reStructuredText to Markdown: pandoc -s -t commonmark -o <target>.md <source>.rst
Last modified July 13, 2023: Update sphinx.md (3eeea25)