aboutsummaryrefslogtreecommitdiffstats
path: root/config.sub
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-12-12 00:49:31 +0100
committerJay Berkenbilt <ejb@ql.org>2021-12-13 17:20:14 +0100
commitcf3b9a778396cc336fd5772dd18762f04dc08134 (patch)
tree5dab14115876d3012c54411366a901c4e8d800c3 /config.sub
parent3d5d42efaf5abc176d8d8fd5a708368654ccdf8e (diff)
downloadqpdf-cf3b9a778396cc336fd5772dd18762f04dc08134.tar.zst
doc: fix whitespace and indentation in pandoc output
Pandoc indented lists with two spaces after the dash, which is ugly and messes up emacs fill-paragraph. I transformed the spacing using a combination of this perl script and manual edits. I verified that the HTML generated by sphinx was identical before and after the edits and that this commit contains only whitespace changes. The perl script as it stands does not do indentation quite right for variable lists, but there were only about 8 cases that it missed, so I just fixed them manually. ```perl #!/usr/bin/env perl require 5.008; use warnings; use strict; use File::Basename; my $whoami = basename($0); my @liststack = (); while (<>) { if (m/^( *- )\S/) { my $pre = $1; while ((scalar(@liststack) > 0) && ($liststack[-1] >= length($pre))) { pop(@liststack); } if ((scalar(@liststack) == 0) && ($pre =~ m/^ /)) { push(@liststack, 1); } push(@liststack, length($pre)); my $n = scalar(@liststack); #print "** $n\n"; my $newpre = (' ' x ($n - 1)) . '- '; s/^$pre/$newpre/; } elsif (scalar(@liststack) > 0) { if ($_ ne "\n") { while (scalar(@liststack) > 0) { my $pre = m/^( *)/; if (length($1) < $liststack[-1]) { #print "XXX pop\n"; pop(@liststack); } else { last; } } my $n = scalar(@liststack); #print "** $n\n"; my $indent = ' ' x $n; s/^ +/$indent/; } } print; } ```
Diffstat (limited to 'config.sub')
0 files changed, 0 insertions, 0 deletions