docs.rst - jgrey4296/jgrey4296.github.io GitHub Wiki
indentation: relative, consistent. roles: inline directives: block level
.. _reference:
Some *italic* and **bold** text
`interpreted text`
``inline literal as monospace``
reference_ and `phrase reference`_ and anonRef__ (two underscores) and _`internal reference`.
|substitution reference|
footnote [1]_.
citation [CIT2002]_.
https:://docutils.sourceforge.io
-------
.. [1] The footnote text.
.. |substitution reference| will be replaced with this text.
inline delimters: * ` | _
escape: \* etc
A horizontal bar:
--------
literal block ::
Nulla facilisis, risus a rhoncus fermentum, tellus tellus lacinia purus,
et dictum nunc justo sit amet elit.
and also::
> Fusce commodo.
> Nullam rutrum. Donec pretium posuere tellus.
Bullet Lists: (requires blank line below)
- blah
- bloo
- blee
continued text must be aligned
Enumerated Lists:
1. blah
2. bloo
3. blee
#. auto-enumerated.
Definition Lists:
what
some definiton text.
how
another definition.
Field Lists:
:Authors:
bob
bill
:Version:
1.0
|---+-------+------+-----+------|
| A | table | like | org | mode |
|---+-------+------+-----+------|
| 1 | 2 | 3 | 4 | 5 |
|---+-------+------+-----+------|
.. WORD :: General form
.. image :: images/ball1.gif
”.. blockname :: ”
- Admonitions: attention, caution, danger, error, hint, important, note, time, warning
- image
- figure
- date
- target-notes
- include
- raw
- meta
- title
- topic
- sidebar
- line-block
- parsed-literal
- code
- math
- rubric
- epigraph
- highlights
- pull-quote
- compound
- container
- table
- csv-table
- list-table
- contents
- sectnum
- header
- footer
- toctree
- sectionauthor
- codeauthor
- index
- only
- admonitions: attention, caution, danger, error, hint, important, note, tip, warning, admonition, seealso
- version changes: versionadded, versionchanged, deprecated, versionremoved
- rubric
- hlist
- code-block
- sourcecode
- code
- literal
- literalinclude
- highlight
- glossary (:sorted:)
- math
- productionlist
- :class:
- :name:
- :caption:
- :numbered:
- :titlesonly:
- :glob:
- :reversed:
- :hidden:
- :includehidden:
- :linenos:
- :lineno-start:
- :emphasize-lines:
- :force:
- :captionpostion:
- :name:
- :class:
- :dedent:
.. index::
single: entryname; subname
pair: first; second
triple: first; second; third
see: from; to
seealso: from; to
.. index:: ! main
Also a paragraph level :index:`refence`.
.. productionlist::
try_stmt: try1_stmt | try2_stmt
try1_stmt: "try" ":" `suite`
: ("except" [`expression` ["," `target`]] ":" `suite`)+
: ["else" ":" `suite`]
: ["finally" ":" `suite`]
try2_stmt: "try" ":" `suite`
: "finally" ":" `suite`
Copyright |copy| 2020
.. |copy| unicode:: 0xA9 .. copyright sign
- https://www.sphinx-doc.org/en/master/contents.html
- https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html
- Sphinx Cheatsheet
- Sphinx Rst Basics
- Sphinx Config Reference
sphinx-build --help
#!/usr/bin/env python3
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use pl.Path.resolve to make it absolute, like shown here.
#
import os
import sys
import pathlib as pl
sys.path.insert(0, pl.Path('../$1').resolve())
import $1
# -- Project information -----------------------------------------------------
project = '$1'
copyright = '2022, `user-full-name`'
author = '`user-full-name`'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['**/flycheck_*.py']
autosummary_generate = True
autodoc_default_options = {
'members' : True,
'undoc-members' : True,
# 'private-members': True,
# 'special-members': True,
'inherited-members': True,
'show-inheritance' : True,
}
add_module_names = False
autodoc_inherit_docstrings = True
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme_options = {
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
use ‘autofunction’ directives to insert docstrings from code.
use ‘autosummary’ directives to generate autofunctions members of modules
- https://sphinx-autoapi.readthedocs.io/en/latest/
- https://bylr.info/articles/2022/05/10/api-doc-with-sphinx-autoapi/
pip install sphinx-autoapi
- https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html
- sphinx Graphviz
- Py Graphviz
- Graphviz docs
- graphviz
- graph
- digraph
- https://github.com/sphinx-contrib/datatemplates
- https://sphinxcontribdatatemplates.readthedocs.io/en/latest/
- https://github.com/sphinx-contrib/sphinxcontrib-programoutput
- https://sphinxcontrib-programoutput2.readthedocs.io/en/latest/
- https://github.com/sphinx-contrib/sphinxcontrib-versioning
- https://sphinxcontrib-versioning.readthedocs.io/en/latest/