module sphinxext.sphinx_faqref_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_faqref_extension

Short summary

module pyquickhelper.sphinxext.sphinx_faqref_extension

Defines a sphinx extension to keep track of FAQ.

source on GitHub

Classes

class

truncated documentation

FaqRef

A faqref entry, displayed in the form of an admonition. It takes the following options:

faqref_node

defines faqref ndoe

FaqRefList

A list of all faqref entries, for a specific tag.

faqreflist

defines faqreflist node

Functions

function

truncated documentation

depart_faqref_node

depart_faqref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

depart_faqreflist_node

depart_faqref_node

merge_faqref

merge_faqref

process_faqref_nodes

process_faqref_nodes

process_faqrefs

collect all faqref in the environment this is not done in the directive itself because it some transformations …

purge_faqrefs

purge_faqrefs

setup

setup for faqref (sphinx)

visit_faqref_node

visit_faqref_node

visit_faqreflist_node

visit_faqreflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

Properties

property

truncated documentation

document

Return the document root node of the tree containing this Node.

document

Return the document root node of the tree containing this Node.

Methods

method

truncated documentation

run

calls run from BlocRef and add defaut tag

run

calls run from BlocRefList and add default tag if not present

Documentation

Defines a sphinx extension to keep track of FAQ.

source on GitHub

class pyquickhelper.sphinxext.sphinx_faqref_extension.FaqRef(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: BlocRef

A faqref entry, displayed in the form of an admonition. It takes the following options:

  • title: a title for the bloc

  • tag: a tag to have several categories of blocs (optional)

  • lid or label: a label to refer to

  • index: to add an entry to the index (comma separated)

Example:

.. faqref::
    :title: example of a blocref
    :lid: id-you-can-choose

    An example of code:

    ::

        print("mignon")

Which renders as:

example of a faqref

An example of code:

print("mignon")

All blocs can be displayed in another page by using faqreflist:

.. faqreflist::
    :tag: dummy_example2
    :sort: title

Only blocs tagged as dummy_example will be inserted here. The option sort sorts items by title, number, file. You also link to it by typing :ref:'anchor <id-you-can-choose2>' which gives something like link_to_blocref. The link must receive a name.

example of a faqref

An example of code:

print("mignon")

(original entry : sphinx_faqref_extension.py:docstring of pyquickhelper.sphinxext.sphinx_faqref_extension.FaqRef, line 23)

source on GitHub

node_class[source]

alias of faqref_node

run()[source]

calls run from BlocRef and add defaut tag

source on GitHub

class pyquickhelper.sphinxext.sphinx_faqref_extension.FaqRefList(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: BlocRefList

A list of all faqref entries, for a specific tag.

  • tag: a tag to filter bloc having this tag

  • sort: a way to sort the blocs based on the title, file, number, default: title

  • contents: add a bullet list with links to added blocs

Example:

.. faqreflist::
    :tag: issue
    :contents:

source on GitHub

node_class[source]

alias of faqreflist

run()[source]

calls run from BlocRefList and add default tag if not present

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.depart_faqref_node(self, node)[source]

depart_faqref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.depart_faqreflist_node(self, node)[source]

depart_faqref_node

source on GitHub

class pyquickhelper.sphinxext.sphinx_faqref_extension.faqref_node(rawsource='', *children, **attributes)[source]

Bases: admonition

defines faqref ndoe

source on GitHub

__slotnames__ = [][source]
class pyquickhelper.sphinxext.sphinx_faqref_extension.faqreflist(rawsource='', *children, **attributes)[source]

Bases: General, Element

defines faqreflist node

source on GitHub

__slotnames__ = [][source]
pyquickhelper.sphinxext.sphinx_faqref_extension.merge_faqref(app, env, docnames, other)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.process_faqref_nodes(app, doctree, fromdocname)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.process_faqrefs(app, doctree)[source]

collect all faqref in the environment this is not done in the directive itself because it some transformations must have already been run, e.g. substitutions

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.purge_faqrefs(app, env, docname)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.setup(app)[source]

setup for faqref (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.visit_faqref_node(self, node)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_faqref_extension.visit_faqreflist_node(self, node)[source]

see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub