Commit graph

7 commits

Author SHA1 Message Date
Petr Špaček
e949ac7bbc
Add tag filter to .. statementlist:: RST directive
Introduce a new syntax:
.. namedconf:statementlist::
   :filter_tags: acl, resolver

The resulting table contains only items tagged as acl OR resolver.

(cherry picked from commit 33931c97fa)
2022-06-09 14:56:21 +02:00
Petr Špaček
ed4634c5a4
Warn about duplicate .. statement:: definitions
(cherry picked from commit ff577462f9)
2022-06-09 14:56:21 +02:00
Petr Špaček
0078fa1058
Refactor and unite internal data structures for iscconf Sphinx extension
It turns out it is easier to regenerate Sphinx-mandated structure in
get_objects than to maintain two separate data structures. I should have
realized that before.

(cherry picked from commit 2f2aa1d21c)
2022-06-09 14:56:21 +02:00
Petr Špaček
851b513e45
Render optional statement metadata in the ARM
Optional values :short: and :tags: are now rendered right after the
statement heading.

(cherry picked from commit 475f7a9603)
2022-06-09 14:56:21 +02:00
Petr Špaček
90ced1c6a8
Add table generator into Sphinx config extension
New directive .. statementlist:: generates table of statements in a
the given domain (named.conf or rndc.conf). The table contains link to
definition, short description, and also list of tags.
Short description and tags have to be provided by user using optional
parameters. E.g.:

.. statement:: max-cache-size
   :tags: resolver, cache
   :short: Short description

.. statementlist:: is currently not parametrized.

This modification is based on Sphinx "tutorial" extension "TODO".
The main trick is to use placeholder node for .. statementlist:: and
replace it with table at later stage, when all source files were
processed and all cross-references can be resolved.

Beware, some details in Sphinx docs are not up-to-date, it's better
to read Sphinx and docutil sources.

(cherry picked from commit 976aef030a)
2022-06-09 14:56:21 +02:00
Petr Špaček
5919415e4a
Extend .. statement:: directive with optional values
New and currently unused values can be provided using this syntax:

.. statement:: max-cache-size
   :tags: resolver, cache
   :short: Short description

The domain stores them in its internal structures for further use.

(cherry picked from commit b12606cebe)
2022-06-09 14:56:20 +02:00
Petr Špaček
29d78932ea
Add Sphinx extension to help with ARM maintenance and cross-linking
The extension provides a "Sphinx domain factory". Each new Sphinx domain
defines a namespace for configuration statements so named.conf and
rndc.conf do not clash. Currently the Sphinx domains are instantiated
twice and resuling domains are named "namedconf" and "rndcconf".

This commit adds a single new directive:

.. statement:: max-cache-size

It is namespaced like this:

.. namedconf:statement:: max-cache-size

This directive generates a new anchor for configuration statement and it
can be referenced like :any:`max-cache-size` (if the identifier is
unique), or more specific :namedconf:ref:`max-cache-size`.

It is based on Sphinx "tutorial" extension "recipe".
Beware, some details in Sphinx docs are not up-to-date, it's better
to read Sphinx and docutil sources.

(cherry picked from commit a23fa7edc9)
2022-06-09 14:56:15 +02:00