Commit 426b4ce8565e4f9143c122fd3afbcc22598fc6c4

Authored by Jay Berkenbilt
1 parent eb20b4d0

Update documentation build/installation

.github/workflows/main.yml
... ... @@ -19,21 +19,20 @@ on:
19 19 # have reliable testing.
20 20 - cron: '12 4 * * 5'
21 21 jobs:
22   - Distfiles:
23   - # Generate distfiles.zip, which is a prerequisite for the mac and
24   - # Windows builds. Only the mac and Windows builds actually "need"
25   - # it, but declaring all the jobs to need it forces it to run
26   - # first.
  22 + Prebuild:
  23 + # Run steps that are needed by the Windows build but are easier to
  24 + # build on Linux. Although only the Windows builds need this,
  25 + # other jobs depend on it to force it to run early.
27 26 runs-on: ubuntu-latest
28 27 steps:
29 28 - uses: actions/checkout@v2
30   - - name: 'Create distfiles.zip'
31   - run: build-scripts/make-distfiles
  29 + - name: 'Run pre-build steps'
  30 + run: build-scripts/prebuild
32 31 - name: 'Upload extra distribution files'
33 32 uses: actions/upload-artifact@v1
34 33 with:
35   - name: distfiles
36   - path: distfiles.zip
  34 + name: doc
  35 + path: doc.zip
37 36 - name: 'Upload external libs'
38 37 uses: actions/upload-artifact@v1
39 38 with:
... ... @@ -52,7 +51,7 @@ jobs:
52 51 path: distribution
53 52 Windows:
54 53 runs-on: windows-latest
55   - needs: Distfiles
  54 + needs: Prebuild
56 55 strategy:
57 56 fail-fast: false
58 57 max-parallel: 4
... ... @@ -64,10 +63,10 @@ jobs:
64 63 shell: bash
65 64 run: git config --global core.autocrlf input
66 65 - uses: actions/checkout@v2
67   - - name: 'Download distribution files'
  66 + - name: 'Download documentation'
68 67 uses: actions/download-artifact@v2
69 68 with:
70   - name: distfiles
  69 + name: doc
71 70 path: .
72 71 - name: 'Download external libs'
73 72 uses: actions/download-artifact@v2
... ... @@ -84,13 +83,9 @@ jobs:
84 83 path: distribution
85 84 macOS:
86 85 runs-on: macos-latest
87   - needs: Distfiles
  86 + needs: Prebuild
88 87 steps:
89 88 - uses: actions/checkout@v2
90   - - name: 'Download distribution files'
91   - uses: actions/download-artifact@v2
92   - with:
93   - name: distfiles
94 89 - name: 'Download external libs'
95 90 uses: actions/download-artifact@v2
96 91 with:
... ... @@ -100,7 +95,7 @@ jobs:
100 95 run: build-scripts/build-mac
101 96 AppImage:
102 97 runs-on: ubuntu-latest
103   - needs: Distfiles
  98 + needs: Prebuild
104 99 steps:
105 100 - uses: actions/checkout@v2
106 101 - name: 'Build AppImage'
... ... @@ -112,21 +107,21 @@ jobs:
112 107 path: distribution
113 108 Linux32:
114 109 runs-on: ubuntu-latest
115   - needs: Distfiles
  110 + needs: Prebuild
116 111 steps:
117 112 - uses: actions/checkout@v2
118 113 - name: 'Linux 32-bit'
119 114 run: build-scripts/build-linux32
120 115 Fuzzers:
121 116 runs-on: ubuntu-latest
122   - needs: Distfiles
  117 + needs: Prebuild
123 118 steps:
124 119 - uses: actions/checkout@v2
125 120 - name: 'Build Fuzzer'
126 121 run: build-scripts/build-fuzzer
127 122 Sanitizers:
128 123 runs-on: ubuntu-latest
129   - needs: Distfiles
  124 + needs: Prebuild
130 125 steps:
131 126 - uses: actions/checkout@v2
132 127 - name: 'Sanitizer Tests'
... ...
.gitignore
... ... @@ -5,8 +5,8 @@ autoconf.mk
5 5 autom4te.cache/
6 6 config.log
7 7 config.status
8   -distfiles.zip
9 8 doc
  9 +doc.zip
10 10 examples/build/
11 11 external-libs
12 12 fuzz/build/
... ...
Makefile
... ... @@ -97,23 +97,16 @@ $(foreach B,$(BUILD_ITEMS),$(eval \
97 97 clean_$(B): ; \
98 98 $(RM) -r $(B)/$(OUTPUT_DIR)))
99 99  
100   -DISTFILES = doc/qpdf-manual.html doc/qpdf-manual.pdf
101   -distfiles.zip: $(DISTFILES)
102   - $(RM) distfiles.zip
103   - zip -r distfiles.zip $(DISTFILES) doc/_static
104   -
105 100 distclean: clean
106 101 $(RM) -r autoconf.mk autom4te.cache config.log config.status libtool
107 102 $(RM) libqpdf/qpdf/qpdf-config.h
108 103 $(RM) manual/html.xsl
109 104 $(RM) manual/print.xsl
110   - $(RM) doc/*.1
111 105 $(RM) libqpdf.pc libqpdf.map
112 106  
113 107 maintainer-clean: distclean
114   - $(RM) doc/qpdf-manual.*
115 108 $(RM) -r install-mingw* install-msvc* external-libs
116   - $(RM) distfiles.zip
  109 + $(RM) -rf doc
117 110  
118 111 .PHONY: $(TEST_TARGETS)
119 112  
... ...
README-maintainer
... ... @@ -119,7 +119,7 @@ RELEASE PREPARATION
119 119 git --no-pager grep -i -n -P "copyright.*$(expr $(date +%Y) - 1).*berkenbilt"
120 120  
121 121 Also update the copyright in these places:
122   - * manual
  122 + * manual/conf.py
123 123 * debian package -- search for copyright.*berkenbilt in debian/copyright
124 124 * qtest-driver, TestDriver.pm in qtest source
125 125  
... ... @@ -210,14 +210,12 @@ RELEASE PREPARATION
210 210 * Make sure version numbers are consistent in the following locations:
211 211 * configure.ac
212 212 * libqpdf/QPDF.cc
213   - * manual/qpdf-manual.xml
  213 + * manual/conf.py
214 214 * qpdf/qpdf.cc
215 215 `make_dist` verifies this consistency.
216 216  
217 217 * Update release notes in manual. Look at diffs and ChangeLog.
218   - Update release date in `manual/qpdf-manual.xml`. Remember to
219   - ensure that the entities at the top of the document are consistent
220   - with the release notes for both version and release date.
  218 + Update release date in `manual/release-notes.rst`.
221 219  
222 220 * Add a release entry to ChangeLog: "x.y.z: release"
223 221  
... ... @@ -327,7 +325,7 @@ Template for release notes:
327 325 ```
328 326 This is qpdf version x.y.z. (Brief description)
329 327  
330   -For a full list of changes from previous releases, please see the [release notes](http://qpdf.sourceforge.net/files/qpdf-manual.html#release-notes). See also [README-what-to-download](./README-what-to-download.md) for details about the available source and binary distributions.
  328 +For a full list of changes from previous releases, please see the [release notes](https://qpdf.sourceforge.io/doc/html/release-notes.html). See also [README-what-to-download](./README-what-to-download.md) for details about the available source and binary distributions.
331 329 ```
332 330  
333 331 # Publish release
... ... @@ -348,7 +346,7 @@ rsync -vrlcO ./ jay_berkenbilt,qpdf@frs.sourceforge.net:/home/frs/project/q/qp/q
348 346  
349 347 (cd /tmp; mkdir -p z; cd z; \
350 348 tar xf ~/Q/storage/releases/qpdf/qpdf/$version/qpdf-$version.tar.gz qpdf-$version/doc; \
351   - scp -p qpdf-$version/doc/qpdf-* jay_berkenbilt,qpdf@frs.sourceforge.net:htdocs/files/)
  349 + rsync -avx --delete --force --exclude '*.1' qpdf-$version/doc/ jay_berkenbilt,qpdf@frs.sourceforge.net:htdocs/doc/)
352 350  
353 351 * Upload the debian package and Ubuntu ppa backports.
354 352  
... ...
README.md
... ... @@ -68,7 +68,7 @@ The PDF file format used to rely on RC4 for encryption. Using 256-bit keys alway
68 68  
69 69 # Building from a pristine checkout
70 70  
71   -When building qpdf from a pristine checkout from version control, generated documentation files are not present. You may either generate them (by passing `--enable-doc-maintenance` to `./configure` and satisfying the extra build-time dependencies) or obtain them from a released source package, which includes them. If you want to grab just the files that are in the source distribution but not in the repository, extract a source distribution in a temporary directory, and run `make CLEAN=1 distfiles.zip`. This will create a file called `distfiles.zip`, which can you can extract in a checkout of the source repository. This step is optional unless you are running make install and want the html and PDF versions of the documentation to be installed.
  71 +When building qpdf from a pristine checkout from version control, generated HTML and PDF documentation files are not present. You don't need them unless you are going to run `make install` and want the documentation to be installed. If you want them, you can either extract the `doc` directory from a source distribution, or you can satisfy the additional requirements for building documentation and pass `--enable-doc-maintenance` to `./configure`.
72 72  
73 73 # Building from source distribution on UNIX/Linux
74 74  
... ...
1 1 Next
2 2 ====
3 3  
4   -* Add spell check to CI
5   -
6 4 * High-level API/doc overhaul: #593
7 5  
8 6 * Refactor test_driver.cc so that runtest is not one huge function.
... ... @@ -19,24 +17,6 @@ Next
19 17 thrown when an uninitialized trailer is accessed provides useful
20 18 information. Test from the C API as well as the C++ API.
21 19  
22   -Doc conversion
23   -==============
24   -
25   -Before release:
26   -
27   -* Figure out what to do about the fact that the release notes are now
28   - at #release-notes instead of #ref.release-notes. This invalidates
29   - the link in all previous release announcements, but there's not much
30   - I can do about, and it doesn't seem worth fixing. Maybe mention it
31   - somewhere?
32   -* README-maintainer: Fix installation of documentation to website
33   -
34   -Soon:
35   -
36   -* :ref: -- would be nice if it were suitable for printed documentation
37   -* Decide about readthedocs; if using, with multiple versions/latest
38   -* Generate stuff (options, code samples, etc.) as needed
39   -
40 20 Documentation
41 21 =============
42 22  
... ... @@ -52,6 +32,8 @@ Documentation
52 32 * See #530 -- add an appendix explaining PDF encryption in general
53 33 plus how it's handled by qpdf. Or maybe this should go on the wiki.
54 34  
  35 +* Decide about readthedocs including supporting multiple released
  36 + versions of the docs and docs from main.
55 37  
56 38 Document-level work
57 39 ===================
... ...
build-scripts/build-mac
... ... @@ -8,9 +8,6 @@ cd jpeg-*
8 8 make -k
9 9 sudo make install
10 10 cd ..
11   -if [ -f distfiles/distfiles.zip ]; then
12   - unzip distfiles/distfiles.zip
13   -fi
14 11 ./configure --enable-werror --enable-show-failed-test-output
15 12 make -j$(nproc) -k
16 13 make -k check
... ...
build-scripts/build-windows
... ... @@ -20,7 +20,7 @@ if [[ $tool == mingw ]]; then
20 20 elif [[ $tool == msvc ]]; then
21 21 cl
22 22 fi
23   -unzip distfiles.zip
  23 +unzip doc.zip
24 24 unzip qpdf-external-libs-bin.zip
25 25 cwd=`pwd`
26 26 PATH=$cwd/libqpdf/build:$PATH
... ...
build-scripts/make-distfiles renamed to build-scripts/prebuild
... ... @@ -7,5 +7,6 @@ sudo apt-get -y install \
7 7 python3-pip texlive-latex-extra latexmk inkscape imagemagick
8 8 pip3 install sphinx
9 9 ./configure --enable-doc-maintenance
10   -make -j$(nproc) distfiles.zip
  10 +make -j$(nproc) build_manual
  11 +zip -r doc.zip doc/*html doc/*.pdf
11 12 build-scripts/download-external-libs
... ...
cSpell.json
... ... @@ -11,6 +11,7 @@
11 11 "afdh",
12 12 "afdhph",
13 13 "ageneration",
  14 + "agogo",
14 15 "aitems",
15 16 "annots",
16 17 "aobjid",
... ... @@ -73,6 +74,7 @@
73 74 "dctdecode",
74 75 "decrypter",
75 76 "deduplicating",
  77 + "deps",
76 78 "destdir",
77 79 "dests",
78 80 "devel",
... ... @@ -80,7 +82,6 @@
80 82 "diffutils",
81 83 "directpagerefcount",
82 84 "distclean",
83   - "distfiles",
84 85 "ditems",
85 86 "docbook",
86 87 "docdir",
... ... @@ -299,6 +300,7 @@
299 300 "pluggable",
300 301 "pngify",
301 302 "poppler",
  303 + "prebuild",
302 304 "precheck",
303 305 "prepended",
304 306 "prepending",
... ...
make/installwin.mk
... ... @@ -17,11 +17,12 @@ installwin: all
17 17 cp qpdf/$(OUTPUT_DIR)/fix-qdf.exe $(DEST)/bin
18 18 cp include/qpdf/*.h $(DEST)/include/qpdf
19 19 cp include/qpdf/*.hh $(DEST)/include/qpdf
20   - if [ -f doc/qpdf-manual.html ]; then \
21   - mkdir $(DEST)/doc/_static; \
22   - cp doc/qpdf-manual.html $(DEST)/doc; \
23   - cp doc/_static/* $(DEST)/doc/_static; \
24   - fi
25 20 if [ -f doc/qpdf-manual.pdf ]; then \
26 21 cp doc/qpdf-manual.pdf $(DEST)/doc; \
27 22 fi
  23 + if [ -d doc/html ]; then \
  24 + cp -r doc/html $(DEST)/doc; \
  25 + fi
  26 + if [ -d doc/singlehtml ]; then \
  27 + cp -r doc/singlehtml $(DEST)/doc; \
  28 + fi
... ...
make/libtool.mk
... ... @@ -121,8 +121,6 @@ install-libs: build_libqpdf
121 121 # NOTE: If installing any new executables, remember to update the
122 122 # lambda layer code in build-scripts/build-appimage.
123 123  
124   -# NOTE: See comments in manual/build.mk about html documentation.
125   -
126 124 # Ensure that installwin in make/installwin.mk is consistent with
127 125 # this.
128 126  
... ... @@ -139,12 +137,13 @@ install: all install-libs
139 137 $(LIBTOOL) --mode=install ./install-sh \
140 138 qpdf/$(OUTPUT_DIR)/fix-qdf \
141 139 $(DESTDIR)$(bindir)/fix-qdf
142   - if [ -f doc/qpdf-manual.html ]; then \
143   - ./mkinstalldirs -m 0755 $(DESTDIR)$(docdir)/_static; \
144   - ./install-sh -m 0644 doc/qpdf-manual.html $(DESTDIR)$(docdir); \
145   - ./install-sh -m 0644 doc/_static/* $(DESTDIR)$(docdir)/_static; \
146   - fi
147 140 if [ -f doc/qpdf-manual.pdf ]; then \
148 141 ./install-sh -m 0644 doc/qpdf-manual.pdf $(DESTDIR)$(docdir); \
149 142 fi
  143 + if [ -d doc/html ]; then \
  144 + cp -r doc/html $(DESTDIR)/$(docdir); \
  145 + fi
  146 + if [ -d doc/singlehtml ]; then \
  147 + cp -r doc/singlehtml $(DESTDIR)/$(docdir); \
  148 + fi
150 149 ./install-sh -m 0644 doc/*.1 $(DESTDIR)$(mandir)/man1
... ...
manual/build.mk
... ... @@ -8,10 +8,10 @@ PDF_TARGET := $(PDF_OUT)/qpdf.pdf
8 8  
9 9 TARGETS_manual := doc/qpdf.1 doc/fix-qdf.1 doc/zlib-flate.1
10 10 ifeq ($(BUILD_HTML),1)
11   -TARGETS_manual += doc/qpdf-manual.html $(HTML_TARGET)
  11 +TARGETS_manual += $(HTML_TARGET) $(S_HTML_TARGET)
12 12 endif
13 13 ifeq ($(BUILD_PDF),1)
14   -TARGETS_manual += doc/qpdf-manual.pdf
  14 +TARGETS_manual += $(PDF_TARGET)
15 15 endif
16 16  
17 17 MANUAL_DEPS = $(wildcard manual/*.rst) manual/conf.py
... ... @@ -22,33 +22,20 @@ MANUAL_DEPS = $(wildcard manual/*.rst) manual/conf.py
22 22 # the error "_pickle.UnpicklingError: pickle data was truncated"
23 23 $(HTML_TARGET): $(MANUAL_DEPS)
24 24 $(SPHINX) -M html manual $(DOC_OUT) -W
  25 + mkdir -p doc
  26 + rm -rf doc/html
  27 + cp -r $(DOC_OUT)/html doc
25 28  
26 29 $(S_HTML_TARGET): $(MANUAL_DEPS) | $(HTML_TARGET)
27 30 $(SPHINX) -M singlehtml manual $(DOC_OUT) -W
  31 + mkdir -p doc
  32 + rm -rf doc/singlehtml
  33 + cp -r $(DOC_OUT)/singlehtml doc
28 34  
29 35 $(PDF_TARGET): $(MANUAL_DEPS) | $(S_HTML_TARGET) $(HTML_TARGET)
30 36 $(SPHINX) -M latexpdf manual $(DOC_OUT) -W
31   -
32   -# This depends on sphinx-build's singlehtml target creating index.html
33   -# and a _static directory. If that changes, this code has to be
34   -# adjusted. It will also be necessary to adjust the install target in
35   -# make/libtool.mk.
36   -doc/qpdf-manual.html: $(S_HTML_TARGET)
37   - mkdir -p doc
38   - @if [ "$(shell find $(S_HTML_OUT)/ -mindepth 1 -type d -print)" != \
39   - "$(S_HTML_OUT)/_static" ]; then \
40   - echo "***"; \
41   - echo Expected only directory in $(S_HTML_OUT) to be _static; \
42   - echo "***"; \
43   - false; \
44   - fi
45   - cp $< $@
46   - mkdir -p doc/_static
47   - cp -p $(S_HTML_OUT)/_static/* doc/_static
48   -
49   -doc/qpdf-manual.pdf: $(PDF_TARGET)
50 37 mkdir -p doc
51   - cp $< $@
  38 + cp $(PDF_TARGET) doc/qpdf-manual.pdf
52 39  
53 40 doc/%.1: manual/%.1.in
54 41 mkdir -p doc
... ...
manual/fix-qdf.1.in
... ... @@ -14,5 +14,5 @@ the same file with stream lengths, cross-reference table entries, and
14 14 object stream offset tables regenerated.
15 15 .PP
16 16 For details about fix-qdf and about PDF files in QDF mode, please see
17   -the qpdf manual, which can be found in @docdir@/qpdf-manual.html or
  17 +the qpdf manual, which can be found in @docdir@/html/index.html or
18 18 @docdir@/qpdf-manual.pdf.
... ...
manual/installation.rst
... ... @@ -64,7 +64,7 @@ Pre-built documentation is distributed with qpdf, so you should
64 64 generally not need to rebuild the documentation. In order to build the
65 65 documentation from source, you need to install `Sphinx
66 66 <https://sphinx-doc.org>`__. To build the PDF version of the
67   -documentation, you need `pdflatex`, `latexmk`, and a fairly complete
  67 +documentation, you need ``pdflatex``, ``latexmk``, and a fairly complete
68 68 LaTeX installation. Detailed requirements can be found in the Sphinx
69 69 documentation.
70 70  
... ...
manual/qpdf.1.in
... ... @@ -16,4 +16,4 @@ useful primarily to PDF developers.
16 16 .PP
17 17 For a summary of qpdf's options, please run
18 18 \fBqpdf \-\-help\fR. A complete manual can be found in
19   -@docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
  19 +@docdir@/html/index.html or @docdir@/qpdf-manual.pdf.
... ...
manual/release-notes.rst
... ... @@ -7,6 +7,25 @@ For a detailed list of changes, please see the file
7 7 :file:`ChangeLog` in the source distribution.
8 8  
9 9 10.5.0: XXX Month dd, YYYY
  10 + - Packaging changes
  11 +
  12 + - The structure of the ``doc`` directory is different. The PDF
  13 + documentation is in the same place, but the files for the
  14 + previous HTML documentation are no longer there. Instead, there
  15 + are ``html`` and ``singlehtml`` directories, each of which
  16 + contain ``index.html`` and other files and directories. The
  17 + distribution files and ``make install`` target handle this, but
  18 + if you are building your own packages and including
  19 + documentation, please double check to make sure that you are
  20 + including the right documentation files.
  21 +
  22 + - The documentation sources have been switched from docbook to
  23 + reStructuredText processed with `Sphinx
  24 + <https://sphinx-doc.org>`__. This will break previous
  25 + documentation links. A redirect is in place on the main website.
  26 + A top-to-bottom review of the documentation is planned for an
  27 + upcoming release.
  28 +
10 29 - Library Enhancements
11 30  
12 31 - Since qpdf version 8, using object accessor methods on an
... ... @@ -58,16 +77,6 @@ For a detailed list of changes, please see the file
58 77  
59 78 - Add ``qpdf_oh_get_type_code`` and ``qpdf_oh_get_type_name``.
60 79  
61   - - Documentation change
62   -
63   - - The documentation sources have been switched from docbook to
64   - reStructuredText processed with `Sphinx
65   - <https://sphinx-doc.org>`__. This is mostly transparent (other
66   - than format change) with the exception that all section links
67   - have changed. What used to be `#ref.something` is now
68   - `#something`. A top-to-bottom review of the documentation is
69   - planned for an upcoming release.
70   -
71 80 10.4.0: November 16, 2021
72 81 - Handling of Weak Cryptography Algorithms
73 82  
... ...
manual/zlib-flate.1.in
... ... @@ -21,6 +21,6 @@ This program should not be used as a general purpose compression
21 21 tool. Use something like gzip(1) instead.
22 22 .PP
23 23 For details about qpdf, please see the qpdf manual, which can be found
24   -in @docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
  24 +in @docdir@/html/index.html or @docdir@/qpdf-manual.pdf.
25 25 .SH "SEE ALSO"
26 26 qpdf(1), gzip(1)
... ...