mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2026-03-07 20:47:14 -06:00
Compare commits
6 Commits
remove_old
...
f01f33953b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f01f33953b | ||
|
|
92ff917d4d | ||
|
|
3792dcc20a | ||
|
|
8ea8256e2d | ||
|
|
7aec1160e1 | ||
|
|
558f86b1cc |
@@ -1,2 +1,4 @@
|
|||||||
\def\isaccessible{1}
|
\def\isaccessible{1}
|
||||||
\input{book.tex}
|
% We have to use a symlink to book.tex to prevent tex4ebook to load book.ht4
|
||||||
|
% before loading any other package and create conflicts
|
||||||
|
\input{sourdough_book.tex}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ REDUCE_PIC := -resize '800x800>' \
|
|||||||
-strip -interlace Plane -gaussian-blur 0.05 -quality 85\% \
|
-strip -interlace Plane -gaussian-blur 0.05 -quality 85\% \
|
||||||
-set colorspace Gray -separate -evaluate-sequence Mean
|
-set colorspace Gray -separate -evaluate-sequence Mean
|
||||||
REDUCE_PIC_COLOR := -quality 80\%
|
REDUCE_PIC_COLOR := -quality 80\%
|
||||||
RSYNC := rsync -au --exclude 'book.epub' --exclude '*.jpg'
|
RSYNC := rsync -au --exclude 'book_sans_serif.epub' --exclude '*.jpg'
|
||||||
GIT := git --no-pager
|
GIT := git --no-pager
|
||||||
SPELL_CHECK := hunspell -t -l -d en_US
|
SPELL_CHECK := hunspell -t -l -d en_US
|
||||||
EPUBSIZE := `du -sb epub/low_res_book.epub | cut -f1`
|
EPUBSIZE := `du -sb epub/low_res_book.epub | cut -f1`
|
||||||
@@ -118,10 +118,10 @@ epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb
|
|||||||
$(EBOOK) $<
|
$(EBOOK) $<
|
||||||
|
|
||||||
copy_ebook_files: build_ebook
|
copy_ebook_files: build_ebook
|
||||||
$(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/
|
$(RSYNC) --exclude '*.png' epub_build/book_sans_serif-epub/ bw-book-epub/
|
||||||
|
|
||||||
copy_ebook_files_low_res: build_ebook
|
copy_ebook_files_low_res: build_ebook
|
||||||
$(RSYNC) epub_build/book-epub/ low-res-book-epub/
|
$(RSYNC) epub_build/book_sans_serif-epub/ low-res-book-epub/
|
||||||
|
|
||||||
# We do not convert SVG to B&W or lower res for now as they are super small
|
# We do not convert SVG to B&W or lower res for now as they are super small
|
||||||
# anyway
|
# anyway
|
||||||
@@ -218,7 +218,7 @@ build_serif_pdf: book_serif/book.pdf
|
|||||||
|
|
||||||
build_sans_serif_pdf: book_sans_serif/book_sans_serif.pdf
|
build_sans_serif_pdf: book_sans_serif/book_sans_serif.pdf
|
||||||
|
|
||||||
build_ebook: epub/book.epub
|
build_ebook: epub/book_sans_serif.epub
|
||||||
|
|
||||||
build_bw_ebook: epub/bw_book.epub
|
build_bw_ebook: epub/bw_book.epub
|
||||||
|
|
||||||
@@ -317,10 +317,10 @@ release_booklet: build_booklet | release
|
|||||||
|
|
||||||
# Website stuff
|
# Website stuff
|
||||||
.PHONY: html website
|
.PHONY: html website
|
||||||
$(website_dir)/book.html: $(website_src) cover/cover-page.xbb
|
$(website_dir)/book_sans_serif.html: $(website_src) cover/cover-page.xbb
|
||||||
$(WEBSITE) -d $(website_dir) book.tex
|
$(WEBSITE) -d $(website_dir) book_sans_serif.tex
|
||||||
|
|
||||||
html: $(website_dir)/book.html
|
html: $(website_dir)/book_sans_serif.html
|
||||||
cp $< $(website_dir)/index.html
|
cp $< $(website_dir)/index.html
|
||||||
|
|
||||||
# Because packages will be installed in hard to predict places use a file as
|
# Because packages will be installed in hard to predict places use a file as
|
||||||
@@ -346,7 +346,7 @@ quick_booklet:
|
|||||||
$(LATEX) -e '$$max_repeat=1' -halt-on-error -output-directory=booklet booklet.tex
|
$(LATEX) -e '$$max_repeat=1' -halt-on-error -output-directory=booklet booklet.tex
|
||||||
|
|
||||||
quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc...
|
quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc...
|
||||||
$(EBOOK) --mode draft book.tex
|
$(EBOOK) --mode draft book_sans_serif.tex
|
||||||
|
|
||||||
show_tools_version: # Show version of tools used on the build machine
|
show_tools_version: # Show version of tools used on the build machine
|
||||||
- $(GIT) log -1 --pretty=%B
|
- $(GIT) log -1 --pretty=%B
|
||||||
|
|||||||
@@ -52,8 +52,9 @@
|
|||||||
\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont}
|
\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont}
|
||||||
% Fonts for accessibility
|
% Fonts for accessibility
|
||||||
\ifdefined\isaccessible
|
\ifdefined\isaccessible
|
||||||
\setmainfont{Open Sans}[
|
\usepackage[mathrm=sym]{unicode-math}
|
||||||
Scale=MatchLowercase]
|
\setmathfont{Fira Math}[Scale=MatchLowercase]
|
||||||
|
\setmainfont{Open Sans}[Scale=MatchLowercase]
|
||||||
\else
|
\else
|
||||||
\setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc.
|
\setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc.
|
||||||
% TODO not available on github CI
|
% TODO not available on github CI
|
||||||
|
|||||||
1
book/sourdough_book.tex
Symbolic link
1
book/sourdough_book.tex
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
book.tex
|
||||||
@@ -79,7 +79,7 @@ class ModifyBuild
|
|||||||
end
|
end
|
||||||
|
|
||||||
def is_cover_page?(filename)
|
def is_cover_page?(filename)
|
||||||
["book.html", "index.html"].any? do |name|
|
["book_sans_serif.html", "index.html"].any? do |name|
|
||||||
filename.include?(name)
|
filename.include?(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -126,8 +126,8 @@ class ModifyBuild
|
|||||||
def validate_file(text)
|
def validate_file(text)
|
||||||
doc = build_doc(text)
|
doc = build_doc(text)
|
||||||
stylesheets = doc.css("link[rel='stylesheet']").map{|attr| attr["href"] }
|
stylesheets = doc.css("link[rel='stylesheet']").map{|attr| attr["href"] }
|
||||||
has_all_styles = %w(book.css style.css).all? { |required_stylesheet| stylesheets.include?(required_stylesheet) }
|
has_all_styles = %w(book_sans_serif.css style.css).all? { |required_stylesheet| stylesheets.include?(required_stylesheet) }
|
||||||
raise InvalidWebsiteFormat.new("No style tag style.css found in the website") unless has_all_styles
|
raise InvalidWebsiteFormat.new("No style tag style.css or book_sans_serif.css found in the website") unless has_all_styles
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -456,7 +456,7 @@ class ModifyBuild
|
|||||||
doc.to_html
|
doc.to_html
|
||||||
end
|
end
|
||||||
|
|
||||||
# Takes a name like "static_website_html/book.html" and returns "book.html"
|
# Takes a name like "static_website_html/book_sans_serif.html" and returns "book_sans_serif.html"
|
||||||
def extract_file_from_path(filename)
|
def extract_file_from_path(filename)
|
||||||
result = filename.split("/")
|
result = filename.split("/")
|
||||||
return filename if result.length == 1
|
return filename if result.length == 1
|
||||||
@@ -483,6 +483,7 @@ class ModifyBuild
|
|||||||
index_text = "The Sourdough Framework goes beyond just recipes and provides a solid knowledge foundation, covering the science of sourdough, the basics of bread making, and advanced techniques for achieving the perfect sourdough bread at home."
|
index_text = "The Sourdough Framework goes beyond just recipes and provides a solid knowledge foundation, covering the science of sourdough, the basics of bread making, and advanced techniques for achieving the perfect sourdough bread at home."
|
||||||
data = {
|
data = {
|
||||||
"book.html" => index_text,
|
"book.html" => index_text,
|
||||||
|
"book_sans_serif.html" => index_text,
|
||||||
"index.html" => index_text
|
"index.html" => index_text
|
||||||
}
|
}
|
||||||
data[filename]
|
data[filename]
|
||||||
@@ -526,12 +527,6 @@ class ModifyBuild
|
|||||||
el["href"] == ""
|
el["href"] == ""
|
||||||
end
|
end
|
||||||
|
|
||||||
# Special case for index page
|
|
||||||
#if ["index.html", "book.html"].include?(filename)
|
|
||||||
# doc.css(".menu-items .chapterToc.home-link")[0].add_class("selected")
|
|
||||||
# return doc.to_html
|
|
||||||
#end
|
|
||||||
|
|
||||||
# Special case for the flowcharts page which is added by us to the menu.
|
# Special case for the flowcharts page which is added by us to the menu.
|
||||||
# This needs to be done for future manually added pages too
|
# This needs to be done for future manually added pages too
|
||||||
if "listoflocname.html" == filename
|
if "listoflocname.html" == filename
|
||||||
@@ -561,7 +556,7 @@ class ModifyBuild
|
|||||||
def add_canonical_for_duplicates(text, filename)
|
def add_canonical_for_duplicates(text, filename)
|
||||||
# Only applies to book.html which is a duplicate for index.html. The file
|
# Only applies to book.html which is a duplicate for index.html. The file
|
||||||
# is still needed though for proper display.
|
# is still needed though for proper display.
|
||||||
canonical_pages = ["book.html", "index.html"]
|
canonical_pages = ["book_sans_serif.html", "index.html"]
|
||||||
return text unless canonical_pages.include?(filename)
|
return text unless canonical_pages.include?(filename)
|
||||||
doc = build_doc(text)
|
doc = build_doc(text)
|
||||||
head = doc.css("head")[0]
|
head = doc.css("head")[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user