2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-24 02:58:38 +00:00

22 Commits

Author SHA1 Message Date
Petr Špaček
f5faddd08a
Cleanup tag filtering code for statementlist:: RST directive
Technically this is fixup for
33931c97faaa0f728b4194b8077825e75c351e12
but that commit is already merged.
2022-07-01 08:59:24 +02:00
Petr Špaček
261bdc7358
Special-case zone in-view
It is not really a zone type, so let's not generate "type in-view"
anchor for it.
2022-07-01 08:59:23 +02:00
Petr Špaček
1af157eb20
Remove extra whitespace in grammar for null statement 2022-07-01 08:59:23 +02:00
Petr Špaček
08a8acffdc
Add ability to filter tables using blocks
A new syntax
.. namedconf:statementlist::
   :filter_blocks: type secondary
allows to generate tables with statements allowed within specified
blocks.
2022-07-01 08:59:23 +02:00
Petr Špaček
0392144e99
Pretty-print grammar for zones
It turns out the tree of dictionaries is not the best structure to
represent our grammar, unfortunatelly. The problem is that "zone" has
several context-dependent variants which change meaning of "zone" based
on inner field "type".

Redesigning the whole structure does not seem to be worth, so I settled
on this terrible hack.
2022-07-01 08:59:23 +02:00
Petr Špaček
435cbb61ba
Add zone definitions into the view grammar
I cannot see a reasonable way to achieve this without the hack in this
commit.
2022-07-01 08:59:23 +02:00
Petr Špaček
1f5bc4fe3b
Add option to suppress grammar rendering
A new flag
.. namedconf:statement::
   :suppress_grammar:
suppresses pretty-printing grammar.

It is useful mostly for zones because each zone has it's own grammar, so
printing all of them at once usually does not make sense.
2022-07-01 08:59:23 +02:00
Petr Špaček
7b4ad8a3ff
Warn about experimental and deprecated options 2022-07-01 08:59:23 +02:00
Petr Špaček
c6fe8970f6
Render statement's grammar
This is replacement for auto-generated *.rst files stored in the repo.
2022-07-01 08:59:23 +02:00
Petr Špaček
eba3b1ad16
Render list of blocks accepting a given statement 2022-07-01 08:59:23 +02:00
Petr Špaček
d61d998e3b
Detect unsupported statement:: directives with multiple names 2022-07-01 08:59:23 +02:00
Petr Špaček
ebe6ede2ec
Warn about statements not found in the grammar 2022-07-01 08:59:23 +02:00
Petr Špaček
cbad1803a5
Warn about statements in grammar not described in docs
Skip over obsolete options.
2022-07-01 08:59:22 +02:00
Petr Špaček
1c6f2c5ad1
Give Sphinx configuration domains access to grammar 2022-07-01 08:59:22 +02:00
Petr Špaček
563eb8e1b9
Accept rst syntax in .. statement:: short: text
Nested rst syntax is now parsed and rendered. E.g.:

.. namedconf:statement:: example
   :short: Use ``this`` **cool** syntax!
2022-06-30 18:04:44 +02:00
Petr Špaček
33931c97fa 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
ff577462f9 Warn about duplicate .. statement:: definitions 2022-06-09 14:44:33 +02:00
Petr Špaček
2f2aa1d21c 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
475f7a9603 Render optional statement metadata in the ARM
Optional values :short: and :tags: are now rendered right after the
statement heading.
2022-06-09 14:44:33 +02:00
Petr Špaček
976aef030a 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
b12606cebe 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
a23fa7edc9 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.
2022-06-09 14:44:29 +02:00