From 530b428d5eaeca98864db26ce5c2a139a255b062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan-Cristian=20C=C3=8ERSTEA?= Date: Sun, 12 May 2024 14:20:56 +0300 Subject: Added support for EPUB3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pull requests adds support for building EPUB3 versions of the RISC-V ISA manuals. To achieve this, `asciidoctor-epub3` extension has been used. Known issues: some eBook readers are not capable of rendering embedded images. The solution to this problem is disabling embedded image altogether. The `README.md` file provides more details on how to achieve this. Signed-off-by: Ioan-Cristian CÎRSTEA --- build/.gitignore | 1 + build/Makefile | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'build') diff --git a/build/.gitignore b/build/.gitignore index 3c56997..cbc2485 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,6 +1,7 @@ *.aux *.bbl *.blg +*.epub *.html *.log *.out diff --git a/build/Makefile b/build/Makefile index 040ee69..c4d93a7 100644 --- a/build/Makefile +++ b/build/Makefile @@ -14,7 +14,7 @@ # for generating documentation in various formats (PDF, HTML). # Build Targets -TARGETS := priv unpriv priv-html unpriv-html +TARGETS := priv-pdf unpriv-pdf priv-html unpriv-html priv-epub unpriv-epub # Declare phony targets .PHONY: all $(TARGETS) clean @@ -43,7 +43,7 @@ SRCDIR := ../src JUNK := *.pdf *.aux *.log *.bbl *.blg *.toc *.out *.fdb_latexmk *.fls *.synctex.gz # Privileged ISA build -priv: priv-isa-asciidoc.pdf +priv-pdf: priv-isa-asciidoc.pdf priv-isa-asciidoc.pdf: $(SRCDIR)/riscv-privileged.adoc $(SRCDIR)/*.adoc @echo "Building Privileged ISA" @@ -52,7 +52,7 @@ priv-isa-asciidoc.pdf: $(SRCDIR)/riscv-privileged.adoc $(SRCDIR)/*.adoc mv $@.tmp $@ # Unprivileged ISA build -unpriv: unpriv-isa-asciidoc.pdf +unpriv-pdf: unpriv-isa-asciidoc.pdf unpriv-isa-asciidoc.pdf: $(SRCDIR)/riscv-unprivileged.adoc $(SRCDIR)/*.adoc @echo "Building Unprivileged ISA" @@ -74,6 +74,18 @@ unpriv-isa-asciidoc.html: $(SRCDIR)/riscv-unprivileged.adoc @echo "Building Unprivileged ISA HTML" asciidoctor $(ASCIIDOCTOR_OPTS) --out-file=$@ $< +priv-epub: priv-isa-asciidoc.epub + +priv-isa-asciidoc.epub: $(SRCDIR)/riscv-privileged.adoc + @echo "Building Privileged ISA EPUB" + asciidoctor-epub3 $(ASCIIDOCTOR_OPTS) --out-file=$@ $< + +unpriv-epub: unpriv-isa-asciidoc.epub + +unpriv-isa-asciidoc.epub: $(SRCDIR)/riscv-unprivileged.adoc + @echo "Building Unprivileged ISA EPUB" + asciidoctor-epub3 $(ASCIIDOCTOR_OPTS) --out-file=$@ $< + clean: @if [ -f priv-isa-asciidoc.pdf ]; then \ echo "Removing priv-isa-asciidoc.pdf"; \ @@ -91,4 +103,11 @@ clean: echo "Removing unpriv-isa-asciidoc.html"; \ rm -f unpriv-isa-asciidoc.html; \ fi - + @if [ -f priv-isa-asciidoc.epub ]; then \ + echo "Removing priv-isa-asciidoc.epub"; \ + rm -f priv-isa-asciidoc.epub; \ + fi + @if [ -f unpriv-isa-asciidoc.epub ]; then \ + echo "Removing unpriv-isa-asciidoc.epub"; \ + rm -f unpriv-isa-asciidoc.epub; \ + fi -- cgit v1.1