feat: Inhaltsverzeichnis nach Cover, Titelseite und Impressum (pandoc/book.lua)
Pandocs --toc setzt Inhaltsverzeichnis und Titelkopf immer vor den Buchtext, also vor Cover, Titelseite und Impressum. - epub2md_merge.py: Kapiteltypen aus manifest.json; Platzhalter <div id="epub2md-toc"> hinter dem Vorspann und, ohne eigene Titelseite, <div id="epub2md-titlepage"> hinter dem Cover; --toc-Liste an derselben Stelle - pandoc/book.lua (HTML/weasyprint, statt --toc): baut dort das Inhaltsverzeichnis, lässt Pandocs Titelkopf bei eigener Titelseite weg, Cover ohne Bildunterschrift, Kapitelanker → div.chapter-start; andere Formate: nur Platzhalter entfernen - print.css: jedes Kapitel (auch Cover/Titelseite/Impressum) und das Verzeichnis auf neuer Seite, Verzeichnis mit Punktlinie und Seitenzahl - Buch-README, Bedienungsanleitung, README: Befehle mit book.lua Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
65c90c67ca
commit
99c3c609ca
1 changed files with 299 additions and 65 deletions
|
|
@ -1,5 +1,7 @@
|
|||
/* Print layout for PDFs from epub2md output via Pandoc + weasyprint:
|
||||
pandoc buch.md -s --toc --lua-filter pandoc/callouts.lua --css pandoc/print.css --pdf-engine=weasyprint -o buch.pdf */
|
||||
pandoc buch.md -s --lua-filter pandoc/book.lua --lua-filter pandoc/callouts.lua --css pandoc/print.css \
|
||||
--pdf-engine=weasyprint -o buch.pdf
|
||||
book.lua places the table of contents after cover, title page and imprint and marks chapter starts. */
|
||||
@page { size: A4; margin: 2cm 1.8cm; @bottom-center { content: counter(page); font-size: 9pt; } }
|
||||
body { max-width: none; font-size: 10.5pt; line-height: 1.4; hyphens: auto; text-align: justify;
|
||||
font-family: "DejaVu Serif", "Liberation Serif", Georgia, serif; }
|
||||
|
|
@ -7,13 +9,23 @@ body { max-width: none; font-size: 10.5pt; line-height: 1.4; hyphens: auto; text
|
|||
h1, h2, h3, h4 { text-align: left; hyphens: manual; page-break-after: avoid; }
|
||||
pre, code { font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; hyphens: none; }
|
||||
pre { background: #f6f8fa; padding: 0.5em 0.8em; border-radius: 0.3em; page-break-inside: auto; }
|
||||
blockquote { margin: 1em 0 1em 1.5em; padding-left: 0.8em; border-left: 2px solid #ccc; color: #444; }
|
||||
nav#TOC ul { list-style: none; padding-left: 1.2em; }
|
||||
a { color: inherit; text-decoration: none; }
|
||||
pre, pre code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 8.5pt; } /* long code lines wrap */
|
||||
pre { overflow: visible; }
|
||||
img { max-width: 100%; height: auto; }
|
||||
h1 { page-break-before: always; } /* every chapter on a new page */
|
||||
#title-block-header h1, #TOC h1 { page-break-before: auto; }
|
||||
nav#TOC { page-break-after: always; }
|
||||
blockquote { margin: 1em 0 1em 1.5em; padding-left: 0.8em; border-left: 2px solid #ccc; color: #444; }
|
||||
a { color: inherit; text-decoration: none; }
|
||||
img { max-width: 100%; max-height: 24cm; height: auto; }
|
||||
table { font-size: 9pt; }
|
||||
.cover { text-align: center; }
|
||||
.cover img { max-height: 25cm; }
|
||||
|
||||
/* New pages: every chapter (book.lua: div.chapter-start, also cover, title page, imprint), the title
|
||||
block, the table of contents; without book.lua every <h1>. No second break for the chapter's own <h1>. */
|
||||
h1, .chapter-start, #title-block-header, #TOC { page-break-before: always; }
|
||||
.chapter-start + h1, #title-block-header h1, #TOC h1 { page-break-before: auto; }
|
||||
#TOC { page-break-after: always; }
|
||||
|
||||
/* Table of contents with dotted leaders and page numbers. */
|
||||
#TOC ul { list-style: none; padding-left: 1.2em; margin: 0; }
|
||||
#TOC > ul { padding-left: 0; }
|
||||
#TOC li { text-align: left; }
|
||||
#TOC a::after { content: leader(".") target-counter(attr(href), page); }
|
||||
|
|
|
|||
Loading…
Reference in a new issue