diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 978b60b..9bc54fb 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -21,8 +21,9 @@ blocks: - checkout - sed -i -e "s/\$MONTHYEAR/$(date +'%b %Y')/g" chapters/01-introduction-ebook.md - sed -i -e "s/\$REVISION/$(git rev-parse --short HEAD)/g" chapters/01-introduction-ebook.md - - make epub + - make ebook - artifact push workflow build/epub/CICD_with_Docker_Kubernetes_Semaphore.epub + - artifact push workflow build/mobi/CICD_with_Docker_Kubernetes_Semaphore.mobi - name: test ebook task: jobs: diff --git a/Makefile b/Makefile index e8c9515..6101a36 100644 --- a/Makefile +++ b/Makefile @@ -15,36 +15,30 @@ CHAPTERS_EBOOK = chapters/01-introduction-ebook.md chapters/02-using-docker.md \ all: book -book: pdf epub azw3 mobi -ebook: epub azw3 mobi - -clean: - rm -fr $(BUILD) - +book: pdf ebook +ebook: epub mobi pdf: $(BUILD)/pdf/$(BOOKNAME).pdf epub: $(BUILD)/epub/$(BOOKNAME).epub mobi: $(BUILD)/mobi/$(BOOKNAME).mobi azw3: $(BUILD)/azw3/$(BOOKNAME).azw3 html: $(BUILD)/html/$(BOOKNAME).html +clean: + rm -r $(BUILD) + $(BUILD)/pdf/$(BOOKNAME).pdf: $(TITLE) $(CHAPTERS) mkdir -p $(BUILD)/pdf docker run --rm --volume `pwd`:/data pandoc/latex:2.6 -f markdown-implicit_figures -H make-code-small.tex -V geometry:margin=1.5in -o /data/$@ $^ -# intermediate format for epub, override small figures +# intermediate format for epub, uses small figures $(BUILD)/html/$(BOOKNAME).html: title.txt $(CHAPTERS_EBOOK) mkdir -p $(BUILD)/html $(BUILD)/html/figures cp figures/* $(BUILD)/html/figures cp figures-small/* $(BUILD)/html/figures docker run --rm --volume `pwd`:/data pandoc/crossref:2.10 -o /data/$@ $^ - -# issues: -# embed fonts -# footnotes show a 'V15' char on kindle device -# style: line-height, pre left-margin # kindle-optimized epub -# output-profile=tablet converts best to kindle +# note: output-profile=tablet converts best to kindle $(BUILD)/epub/$(BOOKNAME).epub: $(BUILD)/html/$(BOOKNAME).html mkdir -p $(BUILD)/epub docker run --rm --volume `pwd`:/data --entrypoint ebook-convert -w /data linuxserver/calibre $^ /data/$@ \ @@ -60,20 +54,14 @@ $(BUILD)/epub/$(BOOKNAME).epub: $(BUILD)/html/$(BOOKNAME).html --comments "$(shell egrep '^subtitle:' title.txt | cut -d: -f2 | sed -e 's/^[[:space:]]*//')" \ --authors "$(shell egrep '^author:' title.txt | cut -d: -f2 | sed -e 's/^[[:space:]]*//')" -# --embed-all-fonts \ -# --subset-embedded-fonts \ -# --authors "Marko Anastasov&Jérôme Petazzoni&Tomas Fernandez" -# --extra-css /data/styles/epub-kindle.css \ - -# amazon kindle format -$(BUILD)/azw3/$(BOOKNAME).azw3: $(BUILD)/epub/$(BOOKNAME).epub - mkdir -p $(BUILD)/azw3 - docker run --rm --volume `pwd`:/data --entrypoint ebook-convert -w /data linuxserver/calibre $^ /data/$@ - - -# mobipocket format, compatible with kindle +# mobipocket format $(BUILD)/mobi/$(BOOKNAME).mobi: $(BUILD)/epub/$(BOOKNAME).epub mkdir -p $(BUILD)/mobi docker run --rm --volume `pwd`:/data --entrypoint ebook-convert -w /data linuxserver/calibre $^ /data/$@ +# amazon kindle format (for testing) +$(BUILD)/azw3/$(BOOKNAME).azw3: $(BUILD)/epub/$(BOOKNAME).epub + mkdir -p $(BUILD)/azw3 + docker run --rm --volume `pwd`:/data --entrypoint ebook-convert -w /data linuxserver/calibre $^ /data/$@ + .PHONY: all book clean pdf html epub azw3 mobi diff --git a/RESCALEME.md b/RESCALEME.md deleted file mode 100644 index 2a11f64..0000000 --- a/RESCALEME.md +++ /dev/null @@ -1,40 +0,0 @@ -Rescaling image from 2462x968 to 501x197 05-choose-repo.png -Rescaling image from 825x523 to 501x317 05-sem-add-collaborators.png -Rescaling image from 825x519 to 501x315 05-sem-existing-pipeline.png -Rescaling image from 1416x1128 to 501x399 03-blue-green.png -Rescaling image from 960x357 to 501x186 05-sem-starter-run.png -Rescaling image from 954x572 to 501x300 05-sem-wb-overview.png -Rescaling image from 940x893 to 501x476 05-sem-starter-workflow.png -Rescaling image from 914x422 to 501x231 05-sem-build-block.png -Rescaling image from 1055x761 to 501x362 05-sem-test-block.png -Rescaling image from 1053x481 to 501x229 05-sem-push-block.png -Rescaling image from 947x374 to 501x198 05-sem-run-workflow.png -Rescaling image from 667x248 to 501x186 05-sem-ci-pipeline.png -Rescaling image from 1036x501 to 501x242 04-test-pyramid.png -Rescaling image from 873x295 to 501x169 05-sem-registry.png -Rescaling image from 1065x386 to 501x181 05-sem-rollback-promotion.png -Rescaling image from 930x480 to 501x258 05-sem-build-block-2.png -Rescaling image from 798x253 to 501x159 05-sem-canary-create-promotion.png -Rescaling image from 1093x809 to 501x371 05-sem-canary-test-block.png -Rescaling image from 1023x323 to 501x158 05-sem-canary-auto-promotion.png -Rescaling image from 596x843 to 435x616 cover.jpg -Rescaling image from 1073x657 to 501x307 05-sem-canary-push-block.png -Rescaling image from 1094x841 to 501x385 05-sem-canary-deploy-block.png -Rescaling image from 1091x296 to 501x136 05-sem-stable-promotion.png -Rescaling image from 1088x863 to 501x398 05-sem-stable-deploy-block.png -Rescaling image from 2108x774 to 501x184 04-pipeline-deps.png -Rescaling image from 910x278 to 501x153 05-sem-promote-canary.png -Rescaling image from 653x179 to 501x137 05-sem-canary-pipeline.png -Rescaling image from 1704x1152 to 501x339 04-build-docker-once.png -Rescaling image from 1848x480 to 501x130 04-multistage-testing.png -Rescaling image from 2338x1466 to 501x314 05-github-repo-auth.png -Rescaling image from 1073x871 to 501x407 05-sem-rollback-block.png -Rescaling image from 1080x426 to 501x197 03-deploy-button.png -Rescaling image from 614x256 to 501x209 05-sem-stable-pipeline.png -Rescaling image from 502x251 to 501x250 05-sem-rollback-canary.png -Rescaling image from 771x81 to 501x52 05-high-level-steps.png -Rescaling image from 756x408 to 501x270 05-flow-docker-build.png -Rescaling image from 947x496 to 501x262 05-flow-canary-deployment.png -Rescaling image from 897x505 to 501x282 05-transition-canary.png -Rescaling image from 912x468 to 501x257 05-transition-stable.png -Rescaling image from 1746x1200 to 501x344 03-canary.png diff --git a/epub-cmichel.css b/epub-cmichel.css deleted file mode 100644 index 97e9864..0000000 --- a/epub-cmichel.css +++ /dev/null @@ -1,398 +0,0 @@ -/* from http://bbebooksthailand.com/bb-CSS-boilerplate.html */ - -/* This adds margins around every page to stop ADE's line numbers from being superimposed over content */ -@page { - margin: 10px; -} - -/*===Reset code to prevent cross-reader strangeness===*/ -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -b, -u, -i, -center, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -article, -aside, -canvas, -details, -embed, -figure, -figcaption, -footer, -header, -hgroup, -menu, -nav, -output, -ruby, -section, -summary, -time, -mark, -audio, -video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -ol, -ul, -li, -dl, -dt, -dd { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; -} - -/*===GENERAL PRESENTATION===*/ - -/*===Body Presentation and Margins===*/ -/* Text alignment is still a matter of debate. Feel free to change to text-align: left; */ -body { - text-align: justify; - line-height: 120%; -} - -/*===Headings===*/ -/* After page breaks, eReaders sometimes do not render margins above the content. Adjusting padding-top can help */ - -h1 { - text-indent: 0; - text-align: center; - margin: 100px 0 0 0; - font-size: 2em; - font-weight: bold; - page-break-before: always; - line-height: 150%; /*gets squished otherwise on ADE */ -} - -h2 { - text-indent: 0; - text-align: center; - margin: 50px 0 0 0; - font-size: 1.5em; - font-weight: bold; - page-break-before: always; - line-height: 135%; /*get squished otherwise on ADE */ -} - -h3 { - text-indent: 0; - text-align: left; - font-size: 1.4em; - font-weight: bold; - margin-top: 1.4em; -} - -h4 { - text-indent: 0; - text-align: left; - font-size: 1.2em; - font-weight: bold; - margin-top: 1.2em; -} - -h5 { - text-indent: 0; - text-align: left; - font-size: 1.1em; - font-weight: bold; - margin-top: 1.1em; -} - -h6 { - text-indent: 0; - text-align: left; - font-size: 1em; - font-weight: bold; - margin-top: 1em; -} - -/* Hyphen and pagination Fixer */ -/* Note: Do not try on the Kindle, it does not recognize the hyphens property */ -h1, -h2, -h3, -h4, -h5, -h6 { - -webkit-hyphens: none !important; - hyphens: none; - page-break-after: avoid; - page-break-inside: avoid; -} - -/*===Paragraph Elements===*/ -/* Margins are usually added on the top, left, and right, but not on the bottom to prevent certain eReaders not collapsing white space properly */ - -/*first-line indent paragraph for fiction*/ -p { - /* text-indent: 1.25em; */ - margin: 0; - widows: 2; - orphans: 2; -} - -/* block type paragraph for non-fiction* / -/* -p -{ -text-indent: 0; -margin: 1.0em 0 0 0; -widows: 2; -orphans: 2; -} -*/ - -/* for centered text and wrappers on images */ -p.centered { - text-indent: 0; - margin: 1em 0 0 0; - text-align: center; -} - -/* section Breaks (can use centered-style for non-fiction) */ -p.centeredbreak { - text-indent: 0; - margin: 1em 0 1em 0; - text-align: center; -} - -/* First sentence in chapters following heading */ -p.texttop { - margin: 1.5em 0 0 0; - text-indent: 0; -} - -/* Use for second sentence to clear drop cap's float */ -p.clearit { - clear: both; -} - -/* 1st level TOC */ -p.toctext { - margin: 0 0 0 1.5em; - text-indent: 0; -} - -/* 2nd level TOC */ -p.toctext2 { - margin: 0 0 0 2.5em; - text-indent: 0; -} - -/*==LISTS==*/ -ul { - margin: 1em 0 0 2em; - text-align: left; -} - -ol { - margin: 1em 0 0 2em; - text-align: left; -} - -/*===IN-LINE STYLES===*/ -/* Recommend avoiding use of , , and . Use span tags instead */ -span.i { - font-style: italic; -} - -span.b { - font-weight: bold; -} - -span.u { - text-decoration: underline; -} - -span.st { - text-decoration: line-through; -} - -/*==in-line combinations==*/ -/* Using something like ... may seem okay, but it causes problems on some eReaders */ -span.ib { - font-style: italic; - font-weight: bold; -} - -span.iu { - font-style: italic; - text-decoration: underline; -} - -span.bu { - font-weight: bold; - text-decoration: underline; -} - -span.ibu { - font-style: italic; - font-weight: bold; - text-decoration: underline; -} - -/* This fixes the bug where the text-align property of block-level elements is not recognized on iBooks - example: html markup would look like

Centered Content

*/ - -span.ipadcenterfix { - text-align: center; -} - -/*==IMAGES==*/ -img { - max-width: 100%; -} - -/*==TABLES==*/ -table { - margin: 1em auto; -} - -tr, -th, -td { - margin: 0; - padding: 2px; - border: 1px solid black; - font-size: 100%; - vertical-align: baseline; -} - -/* Superscripted Footnote Text */ -.footnote { - vertical-align: super; - font-size: 0.75em; - text-decoration: none; -} - -/*==DROP CAPS==*/ -span.dropcap { - font-size: 300%; - font-weight: bold; - height: 1em; - float: left; - margin: 0.3em 0.125em -0.4em 0.1em; -} - -/*==PULL QUOTE==*/ -div.pullquote { - margin: 2em 2em 0 2em; - text-align: left; -} - -div.pullquote p { - font-weight: bold; - font-style: italic; -} - -div.pullquote hr { - width: 100%; - margin: 0; - height: 3px; - color: #2e8de0; - background-color: #2e8de0; - border: 0; -} - -/*==BLOCK QUOTE==*/ -div.blockquote { - margin: 1em 1.5em 0 1.5em; - text-align: left; - font-size: 0.9em; -} - -/*==eBook Specific Formatting Below Here==*/ -body { - padding: 1em; -} - -pre, -code { - font-size: 90%; - line-height: 50%; -} - -pre { - border-left: 1px #000 solid; - padding-left: 10px; -} - -blockquote { - color: #666666; - margin: 1em 0; - padding-left: 1.5em; - border-left: 0.5em #eee solid; -} - -p { - margin: 1em 0; -} - -/* used for strings in code when using HTML */ -span.st { - text-decoration: initial; -} diff --git a/styles/epub-kindle-reset.css b/styles/epub-kindle-reset.css deleted file mode 100644 index 97e9864..0000000 --- a/styles/epub-kindle-reset.css +++ /dev/null @@ -1,398 +0,0 @@ -/* from http://bbebooksthailand.com/bb-CSS-boilerplate.html */ - -/* This adds margins around every page to stop ADE's line numbers from being superimposed over content */ -@page { - margin: 10px; -} - -/*===Reset code to prevent cross-reader strangeness===*/ -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -b, -u, -i, -center, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -article, -aside, -canvas, -details, -embed, -figure, -figcaption, -footer, -header, -hgroup, -menu, -nav, -output, -ruby, -section, -summary, -time, -mark, -audio, -video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -ol, -ul, -li, -dl, -dt, -dd { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; -} - -/*===GENERAL PRESENTATION===*/ - -/*===Body Presentation and Margins===*/ -/* Text alignment is still a matter of debate. Feel free to change to text-align: left; */ -body { - text-align: justify; - line-height: 120%; -} - -/*===Headings===*/ -/* After page breaks, eReaders sometimes do not render margins above the content. Adjusting padding-top can help */ - -h1 { - text-indent: 0; - text-align: center; - margin: 100px 0 0 0; - font-size: 2em; - font-weight: bold; - page-break-before: always; - line-height: 150%; /*gets squished otherwise on ADE */ -} - -h2 { - text-indent: 0; - text-align: center; - margin: 50px 0 0 0; - font-size: 1.5em; - font-weight: bold; - page-break-before: always; - line-height: 135%; /*get squished otherwise on ADE */ -} - -h3 { - text-indent: 0; - text-align: left; - font-size: 1.4em; - font-weight: bold; - margin-top: 1.4em; -} - -h4 { - text-indent: 0; - text-align: left; - font-size: 1.2em; - font-weight: bold; - margin-top: 1.2em; -} - -h5 { - text-indent: 0; - text-align: left; - font-size: 1.1em; - font-weight: bold; - margin-top: 1.1em; -} - -h6 { - text-indent: 0; - text-align: left; - font-size: 1em; - font-weight: bold; - margin-top: 1em; -} - -/* Hyphen and pagination Fixer */ -/* Note: Do not try on the Kindle, it does not recognize the hyphens property */ -h1, -h2, -h3, -h4, -h5, -h6 { - -webkit-hyphens: none !important; - hyphens: none; - page-break-after: avoid; - page-break-inside: avoid; -} - -/*===Paragraph Elements===*/ -/* Margins are usually added on the top, left, and right, but not on the bottom to prevent certain eReaders not collapsing white space properly */ - -/*first-line indent paragraph for fiction*/ -p { - /* text-indent: 1.25em; */ - margin: 0; - widows: 2; - orphans: 2; -} - -/* block type paragraph for non-fiction* / -/* -p -{ -text-indent: 0; -margin: 1.0em 0 0 0; -widows: 2; -orphans: 2; -} -*/ - -/* for centered text and wrappers on images */ -p.centered { - text-indent: 0; - margin: 1em 0 0 0; - text-align: center; -} - -/* section Breaks (can use centered-style for non-fiction) */ -p.centeredbreak { - text-indent: 0; - margin: 1em 0 1em 0; - text-align: center; -} - -/* First sentence in chapters following heading */ -p.texttop { - margin: 1.5em 0 0 0; - text-indent: 0; -} - -/* Use for second sentence to clear drop cap's float */ -p.clearit { - clear: both; -} - -/* 1st level TOC */ -p.toctext { - margin: 0 0 0 1.5em; - text-indent: 0; -} - -/* 2nd level TOC */ -p.toctext2 { - margin: 0 0 0 2.5em; - text-indent: 0; -} - -/*==LISTS==*/ -ul { - margin: 1em 0 0 2em; - text-align: left; -} - -ol { - margin: 1em 0 0 2em; - text-align: left; -} - -/*===IN-LINE STYLES===*/ -/* Recommend avoiding use of , , and . Use span tags instead */ -span.i { - font-style: italic; -} - -span.b { - font-weight: bold; -} - -span.u { - text-decoration: underline; -} - -span.st { - text-decoration: line-through; -} - -/*==in-line combinations==*/ -/* Using something like ... may seem okay, but it causes problems on some eReaders */ -span.ib { - font-style: italic; - font-weight: bold; -} - -span.iu { - font-style: italic; - text-decoration: underline; -} - -span.bu { - font-weight: bold; - text-decoration: underline; -} - -span.ibu { - font-style: italic; - font-weight: bold; - text-decoration: underline; -} - -/* This fixes the bug where the text-align property of block-level elements is not recognized on iBooks - example: html markup would look like

Centered Content

*/ - -span.ipadcenterfix { - text-align: center; -} - -/*==IMAGES==*/ -img { - max-width: 100%; -} - -/*==TABLES==*/ -table { - margin: 1em auto; -} - -tr, -th, -td { - margin: 0; - padding: 2px; - border: 1px solid black; - font-size: 100%; - vertical-align: baseline; -} - -/* Superscripted Footnote Text */ -.footnote { - vertical-align: super; - font-size: 0.75em; - text-decoration: none; -} - -/*==DROP CAPS==*/ -span.dropcap { - font-size: 300%; - font-weight: bold; - height: 1em; - float: left; - margin: 0.3em 0.125em -0.4em 0.1em; -} - -/*==PULL QUOTE==*/ -div.pullquote { - margin: 2em 2em 0 2em; - text-align: left; -} - -div.pullquote p { - font-weight: bold; - font-style: italic; -} - -div.pullquote hr { - width: 100%; - margin: 0; - height: 3px; - color: #2e8de0; - background-color: #2e8de0; - border: 0; -} - -/*==BLOCK QUOTE==*/ -div.blockquote { - margin: 1em 1.5em 0 1.5em; - text-align: left; - font-size: 0.9em; -} - -/*==eBook Specific Formatting Below Here==*/ -body { - padding: 1em; -} - -pre, -code { - font-size: 90%; - line-height: 50%; -} - -pre { - border-left: 1px #000 solid; - padding-left: 10px; -} - -blockquote { - color: #666666; - margin: 1em 0; - padding-left: 1.5em; - border-left: 0.5em #eee solid; -} - -p { - margin: 1em 0; -} - -/* used for strings in code when using HTML */ -span.st { - text-decoration: initial; -} diff --git a/styles/epub-kindle.css b/styles/epub-kindle.css index 3946c88..4b2275c 100644 --- a/styles/epub-kindle.css +++ b/styles/epub-kindle.css @@ -395,7 +395,7 @@ pre clear: both; color: black; line-height: 100%; - font-size: 87%; + font-size: 10%; margin: 0; /* padding: 0 0 0 3px; */ padding-left: 5px; diff --git a/title-css.txt b/title-css.txt deleted file mode 100644 index c12457f..0000000 --- a/title-css.txt +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: BOOK TEST EPUB CMICHEL CSS -subtitle: CMICHEL CSS EPUB -author: Semaphore -language: en-US -toc: true -fontsize: 12pt -colorlinks: true -urlcolor: blue -include-before: -- '`\newpage{}`{=latex}' -... - diff --git a/title-html.txt b/title-html.txt deleted file mode 100644 index dd7d47d..0000000 --- a/title-html.txt +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: BOOK TEST HTML CALIBRE -subtitle: CALIBRE CMICHEL CSS MANUAL -author: Semaphore -language: en-US -toc: true -fontsize: 12pt -colorlinks: true -urlcolor: blue -include-before: -- '`\newpage{}`{=latex}' -... - - diff --git a/title-plain.txt b/title-plain.txt deleted file mode 100644 index 52518b9..0000000 --- a/title-plain.txt +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: BOOK TEST PLAIN EPUB -subtitle: PLAIN EPUB -author: Semaphore -language: en-US -toc: true -fontsize: 12pt -colorlinks: true -urlcolor: blue -include-before: -- '`\newpage{}`{=latex}' -...