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 7, 2024
1 parent 5107f58 commit d833757
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 d833757

Please sign in to comment.