Commit graph

6743 commits

Author SHA1 Message Date
Petr Špaček
0edd5bf77b
Remove incorrect hyperlinks to file and unix definitions
Terms file and unix have overloaded meaning and were incorrectly linked
during the mass-linking campain.

(cherry picked from commit 1233c86ff7)
2022-07-04 16:09:24 +02:00
Petr Špaček
eeb05d5665
Rename port_list to portrange
The old name was not referenced anywhere but the new name is used in
grammar of {avoid,use}-v{4,6}-udp-ports statement.

(cherry picked from commit 8d9c2368a9)
2022-07-04 16:09:24 +02:00
Petr Špaček
2f0c9d4570
Remove path_name grammar definition
It was literally not used anywhere.

(cherry picked from commit 443fb5f34b)
2022-07-04 16:09:24 +02:00
Petr Špaček
4d62710be5
Hyperlink integer to its definition
(cherry picked from commit 55bc6d02a0)
2022-07-04 16:09:24 +02:00
Petr Špaček
69cda54461
Rename number to integer
The term number was used only in other definitions, and at the same time
doc/misc grammar uses term integer.

(cherry picked from commit 9885bf658d)
2022-07-04 16:09:24 +02:00
Petr Špaček
051d72a7ee
Clarify and hyperlink tls_id definition
(cherry picked from commit 6f754dae20)
2022-07-04 16:09:24 +02:00
Petr Špaček
2fd8ce0c46
Hyperlink server_id to its definition
(cherry picked from commit 116573a4a7)
2022-07-04 16:09:24 +02:00
Petr Špaček
830e118d6b
Rename key_id to server_key
The old name was used in the ARM and rndc manual page but was
inconsistent with doc/misc grammar.

(cherry picked from commit c972fad7b0)
2022-07-04 16:09:23 +02:00
Petr Špaček
3f93e5d9f9
Remove key_list grammar definition
It was used in a single place (inet statement) and it defined it in the
text anyway. Let's not clutter the glossary.

(cherry picked from commit 818219b36a)
2022-07-04 16:09:23 +02:00
Petr Špaček
38436b58d3
Hyperlink port references to appropriate definitions
``port`` used to refer to grammar elements and also to named.conf
option. Both cases are now linked to respective definitions.

(cherry picked from commit 686a15d30f)
2022-07-04 16:09:23 +02:00
Petr Špaček
388e36a4c4
Rename ip_port to port
The old name was used only in couple places, and was inconsistent with
doc/misc grammar.

(cherry picked from commit 7b51a027e7)
2022-07-04 16:09:23 +02:00
Petr Špaček
441e94fe48
Rename ip_dscp to dscp
The old name was literally not used anywhere, not even in the source
code. The new name is used by doc/misc grammar.

(cherry picked from commit d1644f420c)
2022-07-04 16:09:23 +02:00
Petr Špaček
aec7ae2d96
Hyperlink netprefix grammar references to the definition
(cherry picked from commit 5ce45d1c04)
2022-07-04 16:09:23 +02:00
Petr Špaček
f005a870d9
Hyperlink ip??_address grammar references to their definition
(cherry picked from commit a35c1ae0c2)
2022-07-04 16:09:23 +02:00
Petr Špaček
5268de4007
Rename ip_prefix to netprefix
Let's standardize on netprefix which matches grammar used in doc/misc.

(cherry picked from commit b22bdb3a1b)
2022-07-04 16:09:23 +02:00
Petr Špaček
e1757784de
Rename ip_addr, ipv4_addr, and ipv6_addr to *_address
The longer variant matches grammar used in doc/misc.

(cherry picked from commit 57f218e65e)
2022-07-04 16:09:23 +02:00
Petr Špaček
70ba197538
Remove dotted_decimal from grammar glossary
This definition was dererenced only once, from ip4_addr definition on
the next line. These two are now collapsed into new ip4_addr definition.

(cherry picked from commit 44c24f3c94)
2022-07-04 16:09:23 +02:00
Petr Špaček
a6e4dbe741
Remove namelist from grammar glossary
This definition was used only for deny-answer-aliases statement
description, and moreover the term did not match grammar listed in
doc/misc/options.

I've replaced it with textual expansion of "list of `domain_name`s"
which is used more often.

(cherry picked from commit fe427a8460)
2022-07-04 16:09:23 +02:00
Petr Špaček
77345f7180
Rename remoteserver_list to remote-servers
Name remoteserver_list was not referenced anywhere but the grammar uses
name remote-servers. Rename and add a reference to primaries for more
information.

(cherry picked from commit e59cedea1f)
2022-07-04 16:09:23 +02:00
Petr Špaček
da9a247057
Hyperlink domain_name grammar elements
Hyperlinked manually to avoid needless repetition in the Rset ordering
chapter.

(cherry picked from commit 309dbeac7b)
2022-07-04 16:09:22 +02:00
Petr Špaček
b6948bf7ce
Hyperlink ACL grammar elements
Manual edit required to restore the first occurence of "definition"
inside .. glossary directive.

Generated using:
    N=acl_name; sed -i -e "s/\`\`$N\`\`/:term:\`$N\`/g" $ARMFILES
    N=address_match_list; sed -i -e "s/\`\`$N\`\`/:term:\`$N\`/g" $ARMFILES

(cherry picked from commit 69d0632dc0)
2022-07-04 16:09:22 +02:00
Petr Špaček
557d674583
Remove unreferences dialup_option grammar
I dunno why it was a separate entity in the grammar glossary. It is not
referenced anywhere else except for the the dialup statement, and the
statement describes all its possible values verbosely.

(cherry picked from commit 14c7fb36e7)
2022-07-04 16:09:22 +02:00
Petr Špaček
d28f6972ce
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.

(cherry picked from commit 9bbcff225b)
2022-07-04 16:09:22 +02:00
Petr Špaček
dba86ce710
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 16:08:59 +02:00
Petr Špaček
f238a5d820
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

(cherry picked from commit 9804cdc4de)
2022-07-04 16:07:37 +02:00
Petr Špaček
bbedf1bc95
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

(cherry picked from commit 452593fc94)
2022-07-04 16:07:33 +02:00
Petr Špaček
96691c5873
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).

(cherry picked from commit 62f3cf98d3)
2022-07-04 15:36:44 +02:00
Petr Špaček
6ac047cfaa
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.

(cherry picked from commit b109c86805)
2022-07-04 15:36:44 +02:00
Petr Špaček
824ff41f32
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.

(cherry picked from commit 8a5f20121e)
2022-07-04 15:36:40 +02:00
Petr Špaček
85626adeb8
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.

(cherry picked from commit 908acd5d70)
2022-07-01 10:21:06 +02:00
Petr Špaček
e8cb9cceb7
Cleanup tag filtering code for statementlist:: RST directive
Technically this is fixup for
33931c97fa
but that commit is already merged.

(cherry picked from commit f5faddd08a)
2022-07-01 10:21:06 +02:00
Petr Špaček
666f0f1d40
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.

(cherry picked from commit d88fefbb4a)
2022-07-01 10:21:06 +02:00
Petr Špaček
af15c21bc3
Describe rndc server block using .. rndcconf syntax
We need to split the description to silence warnings about undescribed
statements.

(cherry picked from commit 82e2f0b37e)
2022-07-01 10:21:06 +02:00
Petr Špaček
990ec8f15b
Define default-source-address, default-source-address-v6 for rndc
(cherry picked from commit 10f88bffe5)
2022-07-01 10:21:06 +02:00
Petr Špaček
763e40de22
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.

(cherry picked from commit 1687b40849)
2022-07-01 10:21:06 +02:00
Petr Špaček
d6005488b8
Add missing link anchor for dlz search statement
(cherry picked from commit 40b3ce727c)
2022-07-01 10:21:06 +02:00
Petr Špaček
07cfcf8691
Special-case zone in-view
It is not really a zone type, so let's not generate "type in-view"
anchor for it.

(cherry picked from commit 261bdc7358)
2022-07-01 10:21:06 +02:00
Petr Špaček
e55682f6f7
Remove extra whitespace in grammar for null statement
(cherry picked from commit 1af157eb20)
2022-07-01 10:21:06 +02:00
Petr Špaček
fa871ffa67
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.

(cherry picked from commit 08a8acffdc)
2022-07-01 10:21:06 +02:00
Petr Špaček
ca866c7e92
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.

(cherry picked from commit 5c04e3c524)
2022-07-01 10:21:05 +02:00
Petr Špaček
9b2bf0f8be
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.

(cherry picked from commit 0392144e99)
2022-07-01 10:21:05 +02:00
Petr Špaček
c4133e8779
Add zone definitions into the view grammar
I cannot see a reasonable way to achieve this without the hack in this
commit.

(cherry picked from commit 435cbb61ba)
2022-07-01 10:21:05 +02:00
Petr Špaček
bc729e39da
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.

(cherry picked from commit 1f5bc4fe3b)
2022-07-01 10:21:05 +02:00
Petr Špaček
243ae3b6a7
Remove auto-generated rst files in repo in favour of grammar pretty printer
(cherry picked from commit 0bbbdc6244)
2022-07-01 10:20:56 +02:00
Petr Špaček
f34c1034f2
Warn about experimental and deprecated options
(cherry picked from commit 7b4ad8a3ff)
2022-07-01 10:00:28 +02:00
Petr Špaček
3a692b068c
Render statement's grammar
This is replacement for auto-generated *.rst files stored in the repo.

(cherry picked from commit c6fe8970f6)
2022-07-01 10:00:28 +02:00
Petr Špaček
2df4072d43
Render list of blocks accepting a given statement
(cherry picked from commit eba3b1ad16)
2022-07-01 10:00:28 +02:00
Petr Špaček
a486e6e294
Detect unsupported statement:: directives with multiple names
(cherry picked from commit d61d998e3b)
2022-07-01 10:00:28 +02:00
Petr Špaček
4c53d6f906
Warn about statements not found in the grammar
(cherry picked from commit ebe6ede2ec)
2022-07-01 10:00:28 +02:00
Petr Špaček
b11b1c6414
Warn about statements in grammar not described in docs
Skip over obsolete options.

(cherry picked from commit cbad1803a5)
2022-07-01 10:00:27 +02:00