git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Patch v3 7/8] Create pdf from all html files

From
Thomas Ackermann <th.acker66@arcor.de>
Date
Oct 16, 2012, 17:27 UTC
Message-ID
<814705718.154269.1350408445020.JavaMail.ngmail@webmail15.arcor-online.net>
In-Reply-To
<1213313884.154031.1350407865830.JavaMail.ngmail@webmail15.arcor-online.net>
- use wkhtmltopdf ("patched QT" version) to combine all html files into a single pdf file "git-doc.pdf"
- insert page breaks to separate major sections
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
 Documentation/.gitignore      |  1 +
 Documentation/footerend.txt   |  4 ++++
 Documentation/footerstart.txt |  7 ++++++
 Documentation/makedocpdf.sh   | 53 +++++++++++++++++++++++++++++++++++++++++++
 Documentation/pagebreak.txt   |  1 +
 5 files changed, 66 insertions(+)
 create mode 100644 Documentation/footerend.txt
 create mode 100644 Documentation/footerstart.txt
 create mode 100755 Documentation/makedocpdf.sh
 create mode 100644 Documentation/pagebreak.txt
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index d62aebd..fba4730 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -10,3 +10,4 @@ howto-index.txt
 doc.dep
 cmds-*.txt
 manpage-base-url.xsl
+docfiles.txt
diff --git a/Documentation/footerend.txt b/Documentation/footerend.txt
new file mode 100644
index 0000000..ed16923
--- /dev/null
+++ b/Documentation/footerend.txt
@@ -0,0 +1,4 @@
+    </td>
+  </tr>
+</table>
+</body></html>
diff --git a/Documentation/footerstart.txt b/Documentation/footerstart.txt
new file mode 100644
index 0000000..a2746ef
--- /dev/null
+++ b/Documentation/footerstart.txt
@@ -0,0 +1,7 @@
+<html>
+<head></head>
+<body style="border:0; margin: 0;" onload="subst()">
+<table style="border-top: 1px solid black; width: 100%">
+  <tr>
+    <td class="section"></td>
+    <td style="text-align:center">
diff --git a/Documentation/makedocpdf.sh b/Documentation/makedocpdf.sh
new file mode 100755
index 0000000..5f1a2c1
--- /dev/null
+++ b/Documentation/makedocpdf.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+rm -f git-doc.pdf
+
+cat pagebreak.txt                  >pagebreak.html
+
+cat /dev/null                      >docfiles.txt
+
+ls gittutorial.html                >>docfiles.txt
+ls gittutorial-2.html              >>docfiles.txt
+ls everyday.html                   >>docfiles.txt
+ls gitworkflows.html               >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls git.html                        >>docfiles.txt
+ls git-a*.html                     >>docfiles.txt
+ls git-bisect.html                 >>docfiles.txt
+ls git-b[j-z]*.html                >>docfiles.txt
+ls git-[c-s]*.html                 >>docfiles.txt
+ls git-ta*.html                    >>docfiles.txt
+ls gitk.html                       >>docfiles.txt
+ls git-[u-z]*.html                 >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls gita*.html                      >>docfiles.txt
+ls git-bisect-lk2009.html          >>docfiles.txt
+ls git[cdghimnr]*.html             >>docfiles.txt
+ls git-tools.html                  >>docfiles.txt
+ls gitweb*.html                    >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls howto-index.html                >>docfiles.txt
+ls howto/*.html                    >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls technical/[b-z]*.html           >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls technical/api-index.html        >>docfiles.txt
+ls technical/api-[a-h]*.html       >>docfiles.txt
+ls technical/api-in-*.html         >>docfiles.txt
+ls technical/api-[j-z]*.html       >>docfiles.txt
+
+ls pagebreak.html                  >>docfiles.txt
+ls RelNotes/*.html                 >>docfiles.txt
+
+cat /dev/null                      >footer.html
+
+cat footerstart.txt                >>footer.html
+cat ../GIT-VERSION-FILE            >>footer.html
+cat footerend.txt                  >>footer.html
+
+cat docfiles.txt | xargs cat | wkhtmltopdf --book --footer-html footer.html --disable-external-links - git-doc.pdf
diff --git a/Documentation/pagebreak.txt b/Documentation/pagebreak.txt
new file mode 100644
index 0000000..fdaffd1
--- /dev/null
+++ b/Documentation/pagebreak.txt
@@ -0,0 +1 @@
+</p style="page-break-after: always">
-- 
1.7.11.msysgit.1


---
Thomas
Previous: Thomas AckermannNext: Thomas Ackermann
Message 8 of 17 in “Create single PDF for all HTML files”
  1. 0/8 Create single PDF for all HTML filesThomas Ackermann, Oct 16, 2012
  2. 1/8 Split over-long synopsis in git-fetch-pack.txt into several linesThomas Ackermann, Oct 16, 2012
  3. 2/8 Shorten two over-long lines in git-bisect-lk2009.txt by abbreviating some sha1Thomas Ackermann, Oct 16, 2012
  4. 3/8 Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txtThomas Ackermann, Oct 16, 2012
  5. 4/8 Prerequisites for creating nice html for all files in Documentation/technicalThomas Ackermann, Oct 16, 2012
  6. 5/8 Prerequisites for creating nice html for all files in Documentation/howtoThomas Ackermann, Oct 16, 2012
  7. 6/8 Prerequisites for creating nice html for all files in Documentation/RelNotesThomas Ackermann, Oct 16, 2012
  8. 7/8 Create pdf from all html filesThomas Ackermann, Oct 16, 2012
  9. 8/8 Wire everything into Makefile and Documentation/MakefileThomas Ackermann, Oct 16, 2012
  10. Junio C HamanoOct 16, 2012
  11. Renumber list in api-command.txtThomas Ackermann, Dec 15, 2012
  12. Remove misleading date form api-index-skel.txtThomas Ackermann, Dec 16, 2012
  13. Andreas SchwabDec 16, 2012
  14. Junio C HamanoDec 16, 2012
  15. Move api-command.txt to the end of API list in api-index.txtThomas Ackermann, Dec 16, 2012
  16. Junio C HamanoDec 16, 2012
  17. Aw: Re: [PATCH] Move api-command.txt to the end of API list in api-index.txtThomas Ackermann, Dec 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.