Skip to content

Commit

Permalink
HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
kogo59 committed Sep 24, 2022
1 parent 95f94c7 commit 2bdeed1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ METADATA_ARG = --metadata-file=$(METADATA)
METADATA_PDF = chapters/preface/metadata_pdf_html.md
PREFACE_EPUB = chapters/preface/preface_epub.md
PREFACE_HTML_PDF = chapters/preface/preface_html_pdf.md
ARGS = $(TOC) $(MATH_FORMULAS) $(CSS_ARG) $(METADATA_ARG) --reference-location=block
ARGS = $(TOC) $(MATH_FORMULAS) $(CSS_ARG) $(METADATA_ARG) --reference-location=section
ARGS_HTML = $(TOC) $(MATH_FORMULAS) $(CSS_ARG) --reference-location=section --metadata=lang:de
#CALIBRE="../../calibre/Calibre Portable/Calibre/"
CALIBRE="C:/Program Files/Calibre2/"
#CALIBRE="C:/Program Files/Calibre2/"
CALIBRE=""
PANDOC = "pandoc"

all: book

Expand All @@ -37,18 +40,23 @@ html: $(BUILD)/html/$(OUTPUT_FILENAME).html

pdf: $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf

docx: $(BUILD)/docx/$(OUTPUT_FILENAME).docx

$(BUILD)/epub/$(OUTPUT_FILENAME).epub: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_FILE) $(CSS_FILE_KINDLE) $(IMAGES) \
$(COVER_IMAGE) $(METADATA) $(PREFACE_EPUB)
mkdir -p $(BUILD)/epub
"C:\Program Files\Pandoc/pandoc" $(ARGS) --from markdown+raw_html+fenced_divs+fenced_code_attributes+bracketed_spans --to epub+raw_html --resource-path=$(IMAGES_FOLDER) --epub-cover-image=$(COVER_IMAGE) -o $@ $(PREFACE_EPUB) $(CHAPTERS)
$(PANDOC) $(ARGS) --epub-chapter-level=2 --from markdown+raw_html+fenced_divs+fenced_code_attributes+bracketed_spans --to epub+raw_html --resource-path=$(IMAGES_FOLDER) --epub-cover-image=$(COVER_IMAGE) -o $@ $(PREFACE_EPUB) $(CHAPTERS)
$(CALIBRE)ebook-polish --add-soft-hyphens -i -p -U $@ $@
$(CALIBRE)ebook-convert $@ $(BUILD)/epub/$(OUTPUT_FILENAME).azw3 --share-not-sync --disable-font-rescaling
$(CALIBRE)ebook-convert $(BUILD)/epub/$(OUTPUT_FILENAME).azw3 $(BUILD)/epub/$(OUTPUT_FILENAME).mobi --share-not-sync --disable-font-rescaling --mobi-file-type both

docx: $(BUILD)/docx/$(OUTPUT_FILENAME).docx

$(BUILD)/docx/$(OUTPUT_FILENAME).docx: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_FILE) $(CSS_FILE_KINDLE) $(IMAGES) \
$(COVER_IMAGE) $(PREFACE_HTML_PDF)
$(COVER_IMAGE)
mkdir -p $(BUILD)/docx
pandoc $(ARGS) --from markdown+raw_html+fenced_divs+fenced_code_attributes+bracketed_spans --to docx --resource-path=$(IMAGES_FOLDER) -o $@ $(CHAPTERS)
pandoc $(ARGS_HTML) --from markdown+raw_html+fenced_divs+fenced_code_attributes+bracketed_spans --to docx --resource-path=$(IMAGES_FOLDER) -o $@ $(METADATA_PDF) $(PREFACE_EPUB) $(CHAPTERS)

$(BUILD)/html/$(OUTPUT_FILENAME).html: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_FILE) $(IMAGES) $(COVER_IMAGE) $(METADATA_PDF)
mkdir -p $(BUILD)/html
cp *.css $(IMAGES_FOLDER)
pandoc $(ARGS_HTML) --self-contained --standalone --resource-path=$(IMAGES_FOLDER) --from markdown+pandoc_title_block+raw_html+fenced_divs+fenced_code_attributes+bracketed_spans+yaml_metadata_block --to=html5 -o $@ $(METADATA_PDF) $(PREFACE_EPUB) $(CHAPTERS)
rm $(IMAGES_FOLDER)/*.css
12 changes: 12 additions & 0 deletions chapters/preface/metadata_pdf_html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
% Die Zugspitz-Expedition zur Errichtung eines vergoldeten Eisen-Cylinder-Kreuzes.
% Christoph Ott
Der Urheber dieses Werks ist vor 1940 gestorben, es ist daher gemeinfrei,
weil seine urheberrechtliche Schutzfrist abgelaufen ist. Dies gilt für das
Herkunftsland des Werks und alle weiteren Staaten mit einer gesetzlichen
Schutzfrist von 80 oder weniger Jahren nach dem Tod des Urhebers.
Dieses Werk ist gemeinfrei in den Vereinigten Staaten, weil es
vor dem 1. Januar 1924 veröffentlicht wurde.<br /><br />
E-Buch erstellt von [email protected].<br /><br />
Dieses Werk basiert auf dem Digitalisat des [DAV](http://www.dav-bibliothek.de/webOPAC/Buecher/Ott.Zugspitzexpedition.pdf) und ist Public Domain.<br /><br />
% 1851, Christian Kaiser<br /><br />

0 comments on commit 2bdeed1

Please sign in to comment.