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

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

From
Thomas Ackermann <th.acker66@arcor.de>
Date
Oct 11, 2012, 17:24 UTC
Message-ID
<114836962.47023.1349976280019.JavaMail.ngmail@webmail22.arcor-online.net>
In-Reply-To
<1412437370.46782.1349975589890.JavaMail.ngmail@webmail22.arcor-online.net>
>From 31f86526e0a0bd00be57db3275c860913f668fb8 Mon Sep 17 00:00:00 2001
From: Thomas Ackermann <th.acker@arcor.de>
Date: Mon, 1 Oct 2012 20:06:48 +0200
Subject: [PATCH] Create pdf from all html files
- 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 10 of 12 in “Create single PDF for all HTML files”
  1. 0/8 Create single PDF for all HTML filesThomas Ackermann, Oct 11, 2012
  2. 1/8 Split over-long synopsis in git-fetch-pack.txt into several linesThomas Ackermann, Oct 11, 2012
  3. 2/8 Shorten two over-long lines in git-bisect-lk2009.txt by removing some white-spaceThomas Ackermann, Oct 11, 2012
  4. Junio C HamanoOct 11, 2012
  5. 3/8 Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txtThomas Ackermann, Oct 11, 2012
  6. 4/8 Prerequisites for creating nice html for all files in Documentation/technicalThomas Ackermann, Oct 11, 2012
  7. 5/8 Prerequisites for creating nice html for all files in Documentation/howtoThomas Ackermann, Oct 11, 2012
  8. Junio C HamanoOct 11, 2012
  9. 6/8 Prerequisites for creating nice html for all files in Documentation/RelNotesThomas Ackermann, Oct 11, 2012
  10. 7/8 Create pdf from all html filesThomas Ackermann, Oct 11, 2012
  11. 8/8 Wire everything into Makefile and Documentation/MakefileThomas Ackermann, Oct 11, 2012
  12. Junio C HamanoOct 11, 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.