2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00
qpdf/manual
Jay Berkenbilt cf3b9a7783 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;
}
```
2021-12-13 11:20:14 -05:00
..
build.mk Switch build from docbook manual to sphinx 2021-12-13 11:16:21 -05:00
common.xsl update release date to actual date 2008-04-29 12:55:25 +00:00
conf.py Sphinx docs: tweak output of sphinx-quickstart 2021-12-12 16:29:13 -05:00
fix-qdf.1.in Fix typo in manual page (fixes #181) 2018-02-18 20:09:18 -05:00
html.xsl.in update release date to actual date 2008-04-29 12:55:25 +00:00
index.rst doc: fix whitespace and indentation in pandoc output 2021-12-13 11:20:14 -05:00
Makefile update release date to actual date 2008-04-29 12:55:25 +00:00
print.xsl.in update release date to actual date 2008-04-29 12:55:25 +00:00
qpdf-manual.xml Prepare for docbook -> rst: replace SGML entitles 2021-12-12 16:29:13 -05:00
qpdf.1.in Fix manual page formatting issues 2018-08-12 14:18:18 -04:00
README update release date to actual date 2008-04-29 12:55:25 +00:00
zlib-flate.1.in fix typo in manual page 2012-04-06 21:48:20 -04:00

This directory contains sources to the documentation.  If you are
looking for pre-built documentation, please look in the "doc"
directory.