ipypublish.sphinx.notebook.transforms module¶
adapted from nbsphinx
-
class
ipypublish.sphinx.notebook.transforms.CreateDomainObjectLabels(document, startnode=None)[source]¶ Bases:
docutils.transforms.TransformCreate labels for domain-specific object signatures.
-
default_priority= 250¶
-
-
class
ipypublish.sphinx.notebook.transforms.CreateNotebookSectionAnchors(document, startnode=None)[source]¶ Bases:
docutils.transforms.TransformCreate section anchors for Jupyter notebooks.
Note: Sphinx lower-cases the HTML section IDs, Jupyter doesn’t. This transform creates anchors in the Jupyter style.
# TODO do this in pandoc filter?
-
default_priority= 200¶
-
-
class
ipypublish.sphinx.notebook.transforms.CreateSectionLabels(document, startnode=None)[source]¶ Bases:
docutils.transforms.TransformMake labels for each document and each section thereof.
These labels are referenced in RewriteLocalLinks but can also be used manually with
:ref:.-
default_priority= 250¶
-
-
class
ipypublish.sphinx.notebook.transforms.RewriteLocalLinks(document, startnode=None)[source]¶ Bases:
docutils.transforms.TransformTurn links to source files into
:doc:/:ref:links.Links to subsections are possible with
...#Subsection-Title. These links use the labels created by CreateSectionLabels.Links to subsections use
:ref:, links to whole source files use:doc:. Latter can be useful if you have anindex.rstbut also want a distinctindex.ipynbfor use with Jupyter. In this case you can use such a link in a notebook:[Back to main page](index.ipynb)
In Jupyter, this will create a “normal” link to
index.ipynb, but in the files generated by Sphinx, this will become a link to the main page created fromindex.rst.-
default_priority= 500¶
-