comparison doc/Makefile @ 8036:8b5f8b950f58

docs: add section anchors to config.ini in references.txt; change format Added section anchors for each section of config.ini in the reference.html file. This makes it easier to link to the right section of the config file when discussing config.ini settings. Getting this to work using the initial sed implementation was going to be a nightmare, so rewrote it in awk. The pre-section comments are now separated by a blank line from the section marker. Also rst directives no longer have blank lines between them.
author John Rouillard <rouilj@ieee.org>
date Mon, 17 Jun 2024 22:58:18 -0400
parents 6aa0525187cd
children 08fcbdfe670b
comparison
equal deleted inserted replaced
8035:b516483f68a3 8036:8b5f8b950f58
4 tracker_config.txt: ../roundup/configuration.py 4 tracker_config.txt: ../roundup/configuration.py
5 # generate a current config file 5 # generate a current config file
6 python3 ../roundup/scripts/roundup_admin.py \ 6 python3 ../roundup/scripts/roundup_admin.py \
7 genconfig _temp_config.txt 7 genconfig _temp_config.txt
8 8
9 ## format and add directives to config file 9 awk -f format_config.awk _temp_config.txt | \
10 # 1. delete first 8 lines of comments (1,8d) 10 cat -s > tracker_config.txt
11 # Some sections have a comment block before the section
12 # [main] Put the comment block with the section marker
13 # after the index/code directives. To do this:
14 # 2. Store all comment and blank lines in the hold space
15 # (H). Delete the current line and continue with the
16 # next line (d).
17 # 3. When we see a section marker, append the section
18 # marker to the hold space (H). substitute for the
19 # section marker index and code directives
20 # (s/.../.../) using the section name (\1) for the
21 # index. Print the directives (p). Empty (zero) the
22 # pattern space (z). Pull the hold space to the
23 # pattern space (x) (which also empties the hold space
24 # because of (z). Print the new pattern space
25 # [comments and section marker] (p). Delete the patern
26 # space and process next input line (d).
27 # 4. For any other line, append the line to the hold
28 # space (H). Zero out the pattern buffer (z). Swap the
29 # hold space and pattern space [comments and setting
30 # line] (x).
31 #
32 # Automatically print the pattern space after the last
33 # command because we are not using 'sed -n'.
34 #
35 # The last sed command indents every line that is not
36 # empty or does not start with '..' (a directive) with
37 # two spaces.
38 # The cat -s squeezes adjacent blank lines to 1 blank
39 # line.
40 @sed -e '1,8d' \
41 -e '/^\#\|^$$/{H;d}' \
42 -e '/^\[\([a-z]*\)\]/{H; s/^\[\([a-z]*\)\]/\n.. index:: config.ini; sections \1\n\n.. code:: ini/; p; z; x; p; d}' \
43 -e '/./{H;z;x}' \
44 _temp_config.txt | \
45 sed -e '/^\.\.\|^$$/!s/^/ /' | \
46 cat -s > tracker_config.txt
47 rm -f _temp_config.txt 11 rm -f _temp_config.txt
48 12
49 ## generate html versions of man pages for inclusion in documentation 13 ## generate html versions of man pages for inclusion in documentation
50 # find all man pages and generate output file paths. 14 # find all man pages and generate output file paths.
51 MAN_ROFF=$(wildcard ../share/man/man1/*.1) 15 MAN_ROFF=$(wildcard ../share/man/man1/*.1)

Roundup Issue Tracker: http://roundup-tracker.org/