Commit 2fd847d2 authored by Ingo Heimbach's avatar Ingo Heimbach

Updated the example Makefile for `docutils-extended` usage

parent 5785602d
PANDOC = pandoc
RST2HTML = rst2html.py
RST2LATEX = rst2latex.py
RST2HTML = rst2html-extended
RST2LATEX = rst2latex-extended
SHELL := /bin/bash
MDFILES := $(wildcard *.md)
......@@ -14,23 +14,29 @@ html: $(HTMLFILES)
pdf: $(PDFFILES)
%.html: %.rst .rst2html_github.css
$(RST2HTML) --stylesheet=.rst2html_github.css --syntax-highlight=short $< > $@
rm .rst2html_github.css
%.html: %.rst .rst2html.css
TEMP_HTML_DIR="$$(mktemp -d)" && \
cp $< .rst2html.css "$${TEMP_HTML_DIR}/" && \
pushd "$${TEMP_HTML_DIR}" && \
$(RST2HTML) --stylesheet=.rst2html.css --syntax-highlight=short $< $@ && \
popd && \
cp "$${TEMP_HTML_DIR}/$@" ./ && \
rm -rf "$${TEMP_HTML_DIR}"
%.pdf: %.rst .fz_logo_schutzzone.pdf
%.pdf: %.rst .rst2latex.sty .fz_logo_schutzzone.pdf
TEX_FILENAME="$$(basename $< .rst).tex" && \
TEMP_TEX_DIR="$$(mktemp -d)" && \
cp $< .rst2latex.sty "$${TEMP_TEX_DIR}/" && \
cp .fz_logo_schutzzone.pdf "$${TEMP_TEX_DIR}/fz_logo_schutzzone.pdf" && \
pushd "$${TEMP_TEX_DIR}" && \
$(RST2LATEX) --documentclass=scrartcl \
--hyperref-options=hidelinks \
--stylesheet=rst2latex_fzj.sty \
--stylesheet=.rst2latex.sty \
--stylesheet-dirs="$$(pwd)" \
--no-section-numbering \
--use-latex-docinfo \
--latex-preamble="\usepackage[ngerman]{babel}" \
$< > "$${TEMP_TEX_DIR}/$${TEX_FILENAME}" && \
cp .fz_logo_schutzzone.pdf "$${TEMP_TEX_DIR}/fz_logo_schutzzone.pdf" && \
pushd "$${TEMP_TEX_DIR}" && \
$< "$${TEX_FILENAME}" && \
latexmk -pdf -halt-on-error "$${TEX_FILENAME}" && \
popd && \
mv "$${TEMP_TEX_DIR}/$@" ./ && \
......@@ -39,13 +45,16 @@ pdf: $(PDFFILES)
%.rst: %.md
$(PANDOC) --from=markdown --to=rst -o $@ $<
.rst2html_github.css:
curl -o $@ -L https://iffgit.fz-juelich.de/doc-utils/doc-utils/raw/master/rst2html_githublike_fzj.css
.rst2latex.sty:
curl -o $@ -L https://iffgit.fz-juelich.de/doc-utils/doc-utils/raw/master/styles/rst2latex_fzj.sty
.rst2html.css:
curl -o $@ -L https://iffgit.fz-juelich.de/doc-utils/doc-utils/raw/master/styles/rst2html_githublike_fzj.css
.fz_logo_schutzzone.pdf:
curl -o $@ -L https://iffwww.iff.kfa-juelich.de/pub/downloads/fz_logo/fz_logo_schutzzone.pdf
clean:
rm -f *.html *.pdf .rst2html_github.css $(patsubst %.md,%.rst,$(MDFILES))
rm -f *.html *.pdf .rst2latex.sty .rst2html.css $(patsubst %.md,%.rst,$(MDFILES))
.PHONY: all clean html pdf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment