mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-11-13 14:41:11 -06:00
Merge remote-tracking branch 'origin/main' into nicer_tables
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -50,4 +50,5 @@ book/book-mobi/
|
||||
book/book-azw3/
|
||||
*.bak
|
||||
book_sans_serif/
|
||||
release_sans_serif/
|
||||
*.opf
|
||||
|
||||
9
book/book-ebook.css
Normal file
9
book/book-ebook.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.figure {
|
||||
max-width: 100%;
|
||||
}
|
||||
.figure img {
|
||||
max-width: 100% !important;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
width: auto;
|
||||
}
|
||||
9
book/book.mk4
Normal file
9
book/book.mk4
Normal file
@@ -0,0 +1,9 @@
|
||||
local filter = require "make4ht-filter"
|
||||
local changePath = function(s) return s:gsub("%./images//","images/") end
|
||||
local removeHeight = function(s) return s:gsub('height="%d+"', '') end
|
||||
local removeWidth = function(s) return s:gsub('width="%d+"', '') end
|
||||
local removeMaxWidth = function(s) return s:gsub(' max-width: %d+px;', '') end
|
||||
local removeFixedSettings = function(s) return removeMaxWidth(removeWidth(removeHeight(changePath(s)))) end
|
||||
local process = filter{removeFixedSettings}
|
||||
Make:htlatex()
|
||||
Make:match("html$",process)
|
||||
@@ -107,8 +107,9 @@ release_sans_serif: make_release_dir
|
||||
|
||||
.PHONY: build_ebook
|
||||
build_ebook: make_release_dir
|
||||
find . -name "*.jpg" | xargs ebb -x
|
||||
find . -name "*.png" | xargs ebb -x
|
||||
tex4ebook -c tex4ebook.cfg -f epub book.tex
|
||||
tex4ebook -c tex4ebook.cfg -f mobi book.tex
|
||||
# not sure why, but I hvae to generate the mobi twice for the
|
||||
# release command to properly work.
|
||||
tex4ebook -c tex4ebook.cfg -f mobi book.tex
|
||||
tex4ebook -c tex4ebook.cfg -f azw3 book.tex
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
\Configure{DocumentLanguage}{en}
|
||||
\Configure{OpfScheme}{URI}
|
||||
\Configure{UniqueIdentifier}{https://the-bread-code.io}
|
||||
\Configure{AddCss}{book-ebook.css}
|
||||
\Configure{CoverMimeType}{image/jpeg}
|
||||
\CoverMetadata{images/cover-page.jpg}
|
||||
\EndPreamble
|
||||
|
||||
Reference in New Issue
Block a user