Mercurial > p > roundup > code
diff 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 |
line wrap: on
line diff
--- a/doc/Makefile Wed Jun 12 17:37:16 2024 -0400 +++ b/doc/Makefile Mon Jun 17 22:58:18 2024 -0400 @@ -6,44 +6,8 @@ python3 ../roundup/scripts/roundup_admin.py \ genconfig _temp_config.txt - ## format and add directives to config file - # 1. delete first 8 lines of comments (1,8d) - # Some sections have a comment block before the section - # [main] Put the comment block with the section marker - # after the index/code directives. To do this: - # 2. Store all comment and blank lines in the hold space - # (H). Delete the current line and continue with the - # next line (d). - # 3. When we see a section marker, append the section - # marker to the hold space (H). substitute for the - # section marker index and code directives - # (s/.../.../) using the section name (\1) for the - # index. Print the directives (p). Empty (zero) the - # pattern space (z). Pull the hold space to the - # pattern space (x) (which also empties the hold space - # because of (z). Print the new pattern space - # [comments and section marker] (p). Delete the patern - # space and process next input line (d). - # 4. For any other line, append the line to the hold - # space (H). Zero out the pattern buffer (z). Swap the - # hold space and pattern space [comments and setting - # line] (x). - # - # Automatically print the pattern space after the last - # command because we are not using 'sed -n'. - # - # The last sed command indents every line that is not - # empty or does not start with '..' (a directive) with - # two spaces. - # The cat -s squeezes adjacent blank lines to 1 blank - # line. - @sed -e '1,8d' \ - -e '/^\#\|^$$/{H;d}' \ - -e '/^\[\([a-z]*\)\]/{H; s/^\[\([a-z]*\)\]/\n.. index:: config.ini; sections \1\n\n.. code:: ini/; p; z; x; p; d}' \ - -e '/./{H;z;x}' \ - _temp_config.txt | \ - sed -e '/^\.\.\|^$$/!s/^/ /' | \ - cat -s > tracker_config.txt + awk -f format_config.awk _temp_config.txt | \ + cat -s > tracker_config.txt rm -f _temp_config.txt ## generate html versions of man pages for inclusion in documentation
