Skip to content

Commit

Permalink
epub: Remove extra page breaks before headings
Browse files Browse the repository at this point in the history
The sections are pretty short, leading to unnecessary pagination being required.
  • Loading branch information
jtojnar committed Apr 8, 2024
1 parent 3dd9e04 commit 05407a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
sed -Ei 's~(<h[1-6])(>.+) \{#([^\}]+)\}(</h[1-6]>)~\1 id="\3"\2\4~g' OEBPS/*.html
# Fix broken links in body.
sed -Ei 's/("[0-9a-z-]+\.)md(["#])/\1html\2/g' OEBPS/*.html
# Remove unnecessary page breaks, the sections are short.
substituteInPlace OEBPS/stylesheet.css --replace-fail "page-break-before: always;" ""
zip -q "../book/epub/Nix Pills.epub" **/*
)
Expand Down

0 comments on commit 05407a5

Please sign in to comment.