2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-04 12:34:20 +00:00
Commit Graph

2338 Commits

Author SHA1 Message Date
Jay Berkenbilt
948c4546c8 Doc: update requirements for building the documentation 2021-12-13 11:20:14 -05:00
Jay Berkenbilt
aaea245a8d Remove "Indices and tables"
This was inserted by sphinx-quickstart, but it doesn't do anything for us.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
e10e787413 Explicitly mark perl codeblock as such 2021-12-13 11:20:14 -05:00
Jay Berkenbilt
cac844e07a Replace xref links to :ref:
Pandoc doesn't convert <xref> correctly, but it does so consistently,
so this commit just changes all xref links to :ref:.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
1b55906a04 Replace <firstterm> with emphasis
At one time, it seems that I was starting to use the <firstterm>
feature of docbook, but I forgot about it long ago, and there is
nothing consistent. In the absence of an actual glossary, just use
emphasis for terminology and don't tag it in any special way. This
could be fixed later if we wanted to.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
e5a7d9323f Convert the original xml comment to an rst comment 2021-12-13 11:20:14 -05:00
Jay Berkenbilt
d13a6032e6 Replace <replaceable> with {...}
All occurrences are in :file: or :samp: now.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
0fdbb957a0 Wrap remaining replaceables in :samp: 2021-12-13 11:20:14 -05:00
Jay Berkenbilt
f4531e8a47 Relabel replaceable in samp or file
Replace @1@replaceable@1@...@2@replaceable@2@ with
@3@replaceable@3@...@3@replaceable@3@ inside of :samp: and :file: so
that all remaining @1@replaceable@1@...@2@replaceable@2@ are outside.
Since the {...} syntax for replaceable only works in :samp: and
:file:, we will have to enclose the remaining ones in :samp: for them
to work.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
bf4d107853 Convert <option> to :samp: and clean up literal blocks
:option: is stronger and assumes a reference to a list of options.
Since we don't have that yet, just use :samp: for options. Inside
literal code blocks, there is no expansion, so just remove markup.
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
b764ba95ed Replace things previously marked with <filename> with :file:... 2021-12-13 11:20:14 -05:00
Jay Berkenbilt
15b87d769e Replace command|application with :command:...
Replace @1@...@2@ stuff from prior to the conversion with new
representation.
2021-12-13 11:20:14 -05:00
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
Jay Berkenbilt
3d5d42efaf Fix errors introduced by pandoc
These showed up as warnings from sphinx-build
2021-12-13 11:20:14 -05:00
Jay Berkenbilt
a372a988fd Switch build from docbook manual to sphinx
Also remove linearization from qpdf-manual.pdf. It's a small file, and
removing the dependency on the qpdf executable significantly shortens
build times.
2021-12-13 11:16:21 -05:00
Jay Berkenbilt
abb6a16ed1 Insert output of pandoc as is
pandoc -f docbook -t rst qpdf-manual.xml >| /tmp/a.rst
Insert /tmp/a.rst into existing index.rst
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
22d53f928f Sphinx docs: tweak output of sphinx-quickstart 2021-12-12 16:29:13 -05:00
Jay Berkenbilt
f8787d9fd8 Create initial sphinx document sources
Run sphinx-quickstart. Throw everything away except conf.py and
index.rst. We will incorporate this into our own build system.
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
9a5d16a403 Prepare for docbook -> rst: replace SGML entitles
We were using SGML entities for various non-ASCII characters so they
could convert properly for both HTML and print, but this is no longer
necessary as we move from docbook to RST, so just replace them. Note
that the conversions done by sphinx automatically handle "smart
quotes", so it works to just use regular quotes in place of &LDQUO;
and &RDQUO;.
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
f80a0da3e3 Prepare for docbook -> rst: protect a comment so it survives pandoc 2021-12-12 16:29:13 -05:00
Jay Berkenbilt
78206a4651 Prepare for docbook -> rst: protect some XML elements
Pandoc docbook -> rst fails to convert the following elements, so
change them to @1@tag@1@ ... @2@tag@2@ for later processing. This way,
they will survive the conversion, and we can deal with them later.

<application>
<command>
<filename>
<firstterm>
<option>
<replaceable>
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
f721fed9d6 doc: Replace Gajic with Gajić (finally)
With docbook, this was not converted properly in the PDF version, but
since we are moving out of docbook, we can just put the Unicode
character in the source.
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
8aa9a66e63 doc: remove unneeded footnote
Footnotes are yucky in online documentation, and the one footnote in
the doc is no longer needed, so remove it.
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
e5c2bd8b14 TODO: doc conversion notes
Make a list of things that need to be done while converting docbook to
sphinx/rst.
2021-12-12 16:29:13 -05:00
Jay Berkenbilt
29384ecace TODO 2021-12-12 14:58:22 -05:00
Jay Berkenbilt
08bcf6449c Clarify docs around @filename and leading/trailing space 2021-12-10 15:52:28 -05:00
Jay Berkenbilt
af2a71aa2c Handle bitstream overflow errors more gracefully (fixes #581)
* Make it a runtime error, not a logic error
* Include additional information
* Capture it properly in checkLinearization
2021-12-10 15:37:35 -05:00
Jay Berkenbilt
1c62c2a342 C API: expose functions for indirect objects (fixes #588) 2021-12-10 14:57:35 -05:00
Jay Berkenbilt
8e0b153332 Expose QPDFObjectHandle::addTokenFilter (fixes #580) 2021-12-10 13:37:07 -05:00
Jay Berkenbilt
72c10d8617 C API: overhaul error handling
* Handle error conditions that occur when using the object handle
  interfaces. In the past, some exceptions were not correctly
  converted to errors or warnings.
* Add more detailed information to qpdf-c.h
* Make it possible to work more explicitly with uninitialized objects
2021-12-10 12:16:02 -05:00
Jay Berkenbilt
3340dbe976 Use a specific error code for type warnings and clarify docs 2021-12-10 11:15:49 -05:00
Jay Berkenbilt
b2b2a175c4 Add missing unit test for register progress reporter in C API
It was exercised in the pdf-linearize example but not in qpdf-ctest.
2021-12-10 09:11:56 -05:00
Jay Berkenbilt
09f3737202 Split qpdf-ctest test 24 into multiple tests
Thanks for the nudge from m-holger!
2021-12-09 15:21:19 -05:00
Jay Berkenbilt
c5708e9180 Update ABI note about fluent interfaces 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
8acb79fc5e Remove notes on safe QPDFObjectHandle -- not worth doing
The impact on the code would be extremely high, and using it would
clutter the code greatly because it would break chaining like
a.getKey("/B").getKey("/C"). There are better ways to deal with the
issue.
2021-12-09 10:33:31 -05:00
Jay Berkenbilt
1faa21502f Refactor trap_errors to use std::function 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
a144363653 Add changelog and release note for #587 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
e3cc171d02 C API: qpdf_oh_is_initialized 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
bef2c2222a C API: qpdf_get_last_string_length 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
73d70902e0 Typos in comments 2021-12-09 10:33:31 -05:00
Jay Berkenbilt
c75577f9d6 Apply spell check to qpdf .h files 2021-12-09 10:25:46 -05:00
m-holger
0c705a882b Minor documentation updates 2021-12-09 10:24:14 -05:00
m-holger
b4fc9eb700 C-API expose new_object as qpdf_oh_new_object 2021-12-02 13:59:58 -05:00
Jay Berkenbilt
720ce9e8f3 Improve testing and error handling around operating before processing 2021-11-29 07:42:36 -05:00
Jay Berkenbilt
ac17308cf6 Initialize QPDF::Members::file (fixes #584) 2021-11-29 07:16:34 -05:00
Jay Berkenbilt
67b0dbe65f Note about C API enhancement for string length 2021-11-23 16:01:03 -05:00
Jay Berkenbilt
52d6fcf1de Notes on possible safe QPDFObjectHandle 2021-11-22 17:56:20 -05:00
Jay Berkenbilt
52f1721ebb Add reminder about trap_errors when updating the C API 2021-11-22 17:56:11 -05:00
Jay Berkenbilt
a63623adce Update notes on API changes for weak crypto 2021-11-19 15:20:12 -05:00
Jay Berkenbilt
f9fc57d24c Cosmetic fixes to maintainer notes 2021-11-19 15:20:12 -05:00