From: Alan T. DeKok Date: Sun, 10 Jun 2018 16:51:54 +0000 (-0400) Subject: let lists be formatted correctly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49c6fcff7bdedd1e0755d77909d51533d8bacb44;p=thirdparty%2Ffreeradius-server.git let lists be formatted correctly --- diff --git a/scripts/conf2adoc b/scripts/conf2adoc index e8e771ed8d9..0a65c4cb8b8 100755 --- a/scripts/conf2adoc +++ b/scripts/conf2adoc @@ -8,6 +8,8 @@ $raw = 0; +$firstcol = 1; + while (<>) { # # Skip editor commands @@ -16,6 +18,10 @@ while (<>) { next; } + if (/\$Id: /) { + next; + } + # Skip ###### banners if (/^##+$/) { next; @@ -25,12 +31,23 @@ while (<>) { next; } + $oldcol = $firstcol; + if (/^#/) { + $firstcol = 1; + } else { + $firstcol = 0; + } + + if (($firstcol == 1) && ($oldcol == 0)) { + s/^#//; + } + # # Comments in the configuration files get converted to plain # text. # if (/^\s*#/) { - s/^\s*#[\t ]*//; + s/^\s*#[\t ]{0,2}//; # # If we WERE printing blocks of raw output, end that, and @@ -41,6 +58,13 @@ while (<>) { $raw = 0; } + # + # Ensure that lists get formatted correctly + # + if (/^\s*\*/) { + print " "; + } + print; next; }