Skip to content

Commit 7ec1eb8

Browse files
committed
doc: auto-generate LaTeX includes
1 parent 7979ae5 commit 7ec1eb8

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

Diff for: mk/docs.mk

+8-8
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUSTDOC_HTML_OPTS = --markdown-css rust.css \
4646
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4747

4848
PANDOC_BASE_OPTS := --standalone --toc --number-sections
49-
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.md \
49+
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
5050
--from=markdown --include-before-body=doc/footer.tex --to=latex
5151
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
5252

@@ -100,7 +100,7 @@ endif
100100
# Rust version
101101
######################################################################
102102

103-
doc/version.md: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
103+
doc/version.tex: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
104104
@$(call E, version-stamp: $@)
105105
$(Q)echo "$(CFG_VERSION)" >$@
106106

@@ -112,7 +112,7 @@ doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
112112
$(CFG_VER_HASH) | head -c 8)/;\
113113
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
114114

115-
GENERATED += doc/version.md doc/version_info.html
115+
GENERATED += doc/version.tex doc/version_info.html
116116

117117
######################################################################
118118
# Docs, from rustdoc and sometimes pandoc
@@ -140,10 +140,6 @@ doc/footer.inc: $(D)/footer.inc | doc/
140140
@$(call E, cp: $@)
141141
$(Q)cp -a $< $@ 2> /dev/null
142142

143-
doc/footer.tex: $(D)/footer.tex | doc/
144-
@$(call E, cp: $@)
145-
$(Q)cp -a $< $@ 2> /dev/null
146-
147143
# The (english) documentation for each doc item.
148144

149145
define DEF_SHOULD_BUILD_PDF_DOC
@@ -167,9 +163,13 @@ doc/$(1).epub: $$(D)/$(1).md | doc/
167163
@$$(call E, pandoc: $$@)
168164
$$(CFG_PANDOC) $$(PANDOC_EPUB_OPTS) $$< --output=$$@
169165

166+
doc/footer.tex: $(D)/footer.inc | doc/
167+
@$$(call E, pandoc: $$@)
168+
$$(CFG_PANDOC) --from=html --to=latex $$< --output=$$@
169+
170170
# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
171171
DOC_TARGETS += doc/$(1).tex
172-
doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.md | doc/
172+
doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.tex | doc/
173173
@$$(call E, pandoc: $$@)
174174
$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) $$< --output=$$@
175175

Diff for: src/doc/footer.tex

-7
This file was deleted.

0 commit comments

Comments
 (0)