Commit Graph

6730 Commits

Author SHA1 Message Date
Petr Špaček
9bbcff225b Manual fixups for new hyperlinks
It turns out that many manual edits were required:
- Heading underlines were too short because :any:`` is longer than ````
- Some statement names clashed with manually defined _link_anchors
  (notify, trust-anchors etc.)
- Zone types are defined like "type primary" in the internal grammar and
  that caused mayhem in the replacement script as it took "type" and
  individual types ("primary", "secondary") as separate statements.
  For that reason :any:`primary` had to be manually replaced with
  :any:`primary <type primary>` where appropriate.
- Sometimes option name is also the same as a value name (e.g. "notify")
  and then it did not make sense to do the replacement.
2022-07-04 15:50:50 +02:00
Petr Špaček
d101490250 Add hyperlinks to all unique statement names
This shell script added hyperlinks to all unique statement names:

    UNIQSTATEMENTS=$(\
        sort \
            <(git grep '.. namedconf:statement::' '*.rst' | sed -e 's/^.*:: //') \
            <(git grep '.. rndcconf:statement::' '*.rst' | sed -e 's/^.*:: //') \
        | uniq --unique)
    ARMFILES=$(git ls-files 'doc/*.rst' | grep -v 'doc/man')
    for STATEMENT in $UNIQSTATEMENTS; \
        do sed -i -e "s/\`\`$STATEMENT\`\`/:any:\`$STATEMENT\`/g" $ARMFILES; \
    done

This needs manual cleanup (see next commit) to fix syntax errors.
2022-07-04 15:50:50 +02:00
Petr Špaček
9804cdc4de Use the new term Block in ARM headings "Statement Definition and Usage"
The underline is not shortened on purpose, see subsequent commits.

Generated by:
    sed -i -e 's/ Statement Definition and Usage$/ Block Definition and Usage/g' doc/arm/reference.rst
2022-07-04 15:50:49 +02:00
Petr Špaček
452593fc94 Use the new term Block in ARM headings "Statement Grammar"
Long live new terminology.
The underline is now shortened on purpose, see subsequent commits.

Generated by:
    sed -i -e 's/ Statement Grammar$/ Block Grammar/g' doc/arm/reference.rst
2022-07-04 15:50:46 +02:00
Petr Špaček
62f3cf98d3 Parse and render rst syntax in :short: statement descriptions in tables
Without this change tables generated by .. namedconf:statementlist::
contained raw text and displayed rst syntax to users.

The raw docutil node returned by rst parser can contain unresolved
references (pending_xref nodes). We just store those nodes and let
Sphinx to resolve them later on.

Beware: This would not work if we injected nodes in later stages of
processing. All unresolved references must be in place before
'doctree-resolved' event is emitted (i.e. before resolve_references() is
called inside Sphinx).
2022-07-04 12:39:43 +02:00
Petr Špaček
b109c86805 Generate tables of statements in doctree-read phase
This change allows us to generate "unresolved" references and let Sphinx
deal with dereferencing them in later stages. It is not useful by itself
but it serves as preparation for the next commit.
2022-07-04 12:39:43 +02:00
Petr Špaček
8a5f20121e Optimize resolve_xref to avoid O(n^2) iteration
Formerly resolve_xref() in Sphinx extension called get_objects() from
Sphinx API which subsequently iterated the whole list of objects,
causing single iteration per single reference, which is essentially.
O(n^2). Avoid using get_objects() and access internal dictionary
directly intead.

The docs build time was still dominated by other factors but speedup is
about 10 % on my machine.
2022-07-04 12:39:43 +02:00
Petr Špaček
908acd5d70 Add note that named.conf man page is not a complete manual
We cannot simply do URL because it would make our lives more complicated
with -S edition.
2022-07-01 08:59:24 +02:00
Petr Špaček
f5faddd08a Cleanup tag filtering code for statementlist:: RST directive
Technically this is fixup for
33931c97fa
but that commit is already merged.
2022-07-01 08:59:24 +02:00
Petr Špaček
d88fefbb4a Add link anchor and hyperlinks to keys statement
This is super confusing because statement "keys" exists in context
controls and server blocks where it refers to symmetric TSIG key, and it
_also_ exists in dnssec-policy block where it specifies public-private
key pair parameters.

In an (unsuccessful) attempt to disambiguate these two I added bunch of
hyperlinks and a warning.
2022-07-01 08:59:24 +02:00
Petr Špaček
82e2f0b37e Describe rndc server block using .. rndcconf syntax
We need to split the description to silence warnings about undescribed
statements.
2022-07-01 08:59:24 +02:00
Petr Špaček
10f88bffe5 Define default-source-address, default-source-address-v6 for rndc 2022-07-01 08:59:24 +02:00
Petr Špaček
1687b40849 Document ipv4only-* options in the ARM
Statements ipv4only-contact, ipv4only-enable, ipv4only-server did not
have their own section in the ARM. Now they have.
2022-07-01 08:59:23 +02:00
Petr Špaček
40b3ce727c Add missing link anchor for dlz search statement 2022-07-01 08:59:23 +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
5c04e3c524 Sort grammar map keys while pretty printing them
It would be too easy if we could just call sorted(). Thanks to zone
grammar the most important key "type" gets sorted near end, so we pull
it up to the top using a hack.
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
0bbbdc6244 Remove auto-generated rst files in repo in favour of grammar pretty printer 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
a691ebd0c9 Add helper to unify options and zone block grammars
A helper is needed to combine cfg_test output for generic options and
all the type-dependent zone block variants.
2022-07-01 08:59:22 +02:00
Petr Špaček
190004e46c Add pretty printer for JSON grammar
It produces the same format as cfg_test --grammar. The advantage is that
it allows to print any node in configuration the tree, not just whole
blocks.
2022-07-01 08:59:22 +02:00
Petr Špaček
8960d51aa3 Add utility to search for context-dependent configuration statements
The utility detects statements which use the same name (e.g.
max-zone-ttl) but use different grammar in different contexts. These
typically need special case in docs.
2022-07-01 08:59:22 +02:00
Petr Špaček
df08982930 Add a new library to parse grammar format produced by cfg_test
It transforms named.conf/rndc.conf grammar from text format into Python
dictionary. This allows granular access to grammar elements.

Beware: It heavity depens on cfg_test output format!
2022-07-01 08:59:04 +02:00
Petr Špaček
fb474de3ab Add rndc.conf grammar into doc/misc
It uses the same mechanism as all other grammars, but the file is named
differently to distinguish it from named.conf grammars.
2022-07-01 08:56:35 +02:00
Petr Špaček
699570cdec Un-format grammar files in doc/misc
The next commit is going to add parser for ISC configuration format.
To simplify the parser the grammar files in doc/misc are no longer
line-wrapped as handling it would make the grammar parser unnecessairly
complicated.

This affects visible output in the ARM, but in the end we are going to
replace the auto-generated .rst files with grammar pretty printed, so
formatting of these files does not matter in practical terms.
2022-07-01 08:56:33 +02:00
Petr Špaček
af3683f436 Add missing comment markers to doc/misc/ grammar files
These files can be consumed by scripts, so obviously missing comment
markers wreak havoc.
2022-06-30 19:00:17 +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
0e7ca5b5e0 Disambiguate address_match_list link anchor
Let's keep just the :term: produced by grammar glossary.
2022-06-30 18:04:41 +02:00
Suzanne Goldlust
3cf976bd78 Add the :tags: and :short: descriptions for the category "transfer" 2022-06-30 18:04:40 +02:00
Suzanne Goldlust
7187a5cf77 Add the :tags: and :short: descriptions for the category "query" 2022-06-30 18:04:40 +02:00
Petr Špaček
2630cf8e76 Resurrect DNS NOTIFY chapter in the ARM
It was accidentally removed in the heat of
25eb91d23c.
2022-06-30 18:04:40 +02:00
Michał Kępień
f0d2d3c03f Add CHANGES entry and release note for GL #2147 2022-06-30 15:24:08 +02:00
Michał Kępień
887c666caf Obsolete the "glue-cache" option
The "glue-cache" option was marked as deprecated by commit
5ae33351f2 (first released in BIND 9.17.6,
back in October 2020), so now obsolete that option, removing all code
and documentation related to it.

Note: this causes the glue cache feature to be permanently enabled, not
disabled.
2022-06-30 15:24:08 +02:00
Petr Špaček
4ce1f25210 Declare Debian 9 (Stretch) community-maintained 2022-06-28 17:54:48 +02:00
Matthijs Mekking
fb517eb52a Add some clarifications wrt dynamic zones
These were suggested by GitLab user @elmaimbo.
2022-06-27 11:01:33 +02:00
Ron Aitchison
d44cb9f194 Added explanations or Argument, Value, and Directive to the ARM 2022-06-24 16:20:46 +02:00
Petr Špaček
bb2a19d655 Add link to glob definition for include directive 2022-06-24 09:40:51 +02:00
Suzanne Goldlust
f4503061ba Minor text nitpicking around dnssec-policy grammar reference 2022-06-24 09:40:51 +02:00
Petr Špaček
fbcaa44851 Remove ambiguous link anchors for logging { file } statement
Unfortunatelly logging and zone blocks use file statements with
different semantics but the same name.

There is no sane way to disambiguate them in text, so let's remove the
link anchor from logging so we can link to the file statement in zone.

My assumption is that linking to logging { file } is very unlikely
because logging is self-contained in one block but zone config is all
over the place.
2022-06-24 09:40:51 +02:00
Petr Špaček
d6b2423c99 Remove ambiguous link anchors for keys statement
Unfortunatelly dnssec-policy and servers blocks use keys statements with
a totally different grammar and semantics but the same name.
There is no sane way to disambiguate them in text, so let's remove the
link anchors to prevent errorneous linking.
2022-06-24 09:40:51 +02:00