6.49. kink/doc/render/sphinx/SPHINX_RENDER_TOOL

Launcheable module to render a kinkdoc document into a set of reStructuredText files for Sphinx document generator.

Usage

kink [Kink_options]... mod:kink/doc/render/sphinx/SPHINX_RENDER_TOOL [Mod_options] Dir <Json

The command reads the kinkdoc JSON data from the standard input, converts it to a set of reStructuredText files for Sphinx, and writes them under the directory `Dir`.

Mod_options

• --anchor-prefix {Prefix} : Uses `Prefix` as the prefix of anchors in generated reST files. By default `kinkdoc-` is used.

• --help : Prints out the help and exits.

Generated files

The command outputs following files in the destination directory.

• index.rst: Blocks of the document level section, and a `toctree` directive.

• Other .rst files: Contents of second level sections and their descendants. Usually, a single .rst file corresponds to a single module.

Example:

• index.rst

• kink-STR.rst : for kink/STR module

• kink-NUM.rst : for kink/NUM module

• kink-container-FLAT_SET.rst : for kink/container/FLAT_SET module

• ...

Anchors

The tiles of sections of the third and deeper levels will have anchors for cross reference. Example:

.. _kinkdoc-0123456789abcdef0123456789abcdef:

type finger\_tree
=================

A finger tree is an immutable data structure for O\(log N\)
concatenation and splitting\.

.. _kinkdoc-fedcba9876543210fedcba9876543210:

Ft\.size
--------

\`size\` returns the size of the finger tree\.

reST files in the Sphinx document can refer to a section using :ref: role like:

.. someotherpage.rst

You can call :ref:`Ft.size <kinkdoc-fedcba9876543210fedcba9876543210>`
to get the size of the finger tree.

Anchors are generated from the text of the title of the section, and the titles of the anscestors.

Usage example

$ kink mod:kink/doc/DOC_PARSE_TOOL --title 'API reference' src >doc.json
...
$ kink mod:kink/doc/render/sphinx/SPHINX_RENDER_TOOL src/sphinx/api  <doc.json

6.49.1. SPHINX_RENDER_TOOL.main(Argv)

`main` is the launcher of the module.