Python API

sphinx_book_theme.__version__ = '0.1.0'

sphinx-book-theme version

class sphinx_book_theme.Margin(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: docutils.parsers.rst.directives.body.Sidebar

Goes in the margin to the right of the page.

optional_arguments = 1

Number of optional arguments after the required arguments.

required_arguments = 0

Number of required directive arguments.


Run the directive.

sphinx_book_theme.launch.add_hub_urls(app: sphinx.application.Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: Optional[docutils.nodes.document])[source]

Builds a binder link and inserts it in HTML context for use in templating.

This is a html-page-context sphinx event (see Sphinx core events).

  • pagename – The sphinx docname related to the page

  • context – A dictionary of values that are given to the template engine, to render the page and can be modified to include custom values.

  • doctree – A doctree when the page is created from a reST documents; it will be None when the page is created from an HTML template alone.