Skip to content

Commit

Permalink
Add epub generation (#2286)
Browse files Browse the repository at this point in the history
* Add epub generation

* add latex math handling for epub generation
  • Loading branch information
raSTARgfx authored Jan 24, 2024
1 parent 9b94c27 commit 7abf6f0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ OUTDIR = $(GENERATED)/out
HTMLDIR = $(OUTDIR)/html
VUDIR = $(OUTDIR)/validation
PDFDIR = $(OUTDIR)/pdf
EPUBDIR = $(OUTDIR)/epub
PROPOSALDIR = $(OUTDIR)/proposals
JSAPIMAP = $(GENERATED)/apimap.cjs
PYAPIMAP = $(GENERATED)/apimap.py
Expand Down Expand Up @@ -242,6 +243,13 @@ ADOCPDFOPTS = $(ADOCPDFEXTS) -a mathematical-format=svg \
-a pdf-fontsdir=$(CONFIGS)/fonts,GEM_FONTS_DIR \
-a pdf-stylesdir=$(CONFIGS)/themes -a pdf-style=pdf

# EPUB target-specific Asciidoctor options
ADOCEPUBOPTS = -r asciidoctor-epub3 \
-r asciidoctor-mathematical \
-r $(CONFIGS)/asciidoctor-mathematical-ext.rb \
-a mathematical-format=svg \
-a imagesoutdir=$(PDFMATHDIR)

# Valid usage-specific Asciidoctor extensions and options
ADOCVUEXTS = -r $(CONFIGS)/vu-to-json.rb -r $(CONFIGS)/quiet-include-failure.rb
# {vuprefix} precedes some anchors which are otherwise encountered twice
Expand Down Expand Up @@ -363,6 +371,11 @@ $(PDFDIR)/vkspec.pdf: $(SPECSRC) $(COMMONDOCS)
$(QUIET)$(OPTIMIZEPDF) $@ $@.out.pdf && mv $@.out.pdf $@
$(QUIET)$(RMRF) $(PDFMATHDIR)

epub: $(EPUBDIR)/vkspec.epub $(SPECSRC) $(COMMONDOCS)

$(EPUBDIR)/vkspec.epub: $(SPECSRC) $(COMMONDOCS)
$(QUIET)$(ASCIIDOC) -b epub3 $(ADOCOPTS) $(ADOCEPUBOPTS) -o $@ $(SPECSRC)

validusage: $(VUDIR)/validusage.json $(SPECSRC) $(COMMONDOCS)

$(VUDIR)/validusage.json: $(SPECSRC) $(COMMONDOCS)
Expand Down

0 comments on commit 7abf6f0

Please sign in to comment.