mirror of https://github.com/rust-lang/rust.git
doc: tidy up makefile rules
This commit is contained in:
parent
58aa18c8ba
commit
3d57b240ab
112
mk/docs.mk
112
mk/docs.mk
|
@ -15,6 +15,10 @@
|
|||
DOCS :=
|
||||
DOCS_L10N :=
|
||||
|
||||
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections --include-before-body=doc/version_info.html
|
||||
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css --include-in-header=doc/favicon.inc
|
||||
TEX_OPTS = $(BASE_DOC_OPTS) --to=latex
|
||||
EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub
|
||||
|
||||
######################################################################
|
||||
# Docs, from pandoc, rustdoc (which runs pandoc), and node
|
||||
|
@ -49,86 +53,45 @@ doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.inc \
|
|||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
--standalone --toc \
|
||||
--section-divs \
|
||||
--number-sections \
|
||||
--from=markdown --to=html5 \
|
||||
--css=rust.css --include-in-header=doc/manual.inc \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --include-in-header=doc/manual.inc --output=$@
|
||||
|
||||
DOCS += doc/rust.tex
|
||||
doc/rust.tex: rust.md doc/version.md
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
--standalone --toc \
|
||||
--number-sections \
|
||||
--include-before-body=doc/version.md \
|
||||
--from=markdown --to=latex \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/rust.epub
|
||||
doc/rust.epub: rust.md doc/version_info.html doc/rust.css doc/manual.inc
|
||||
doc/rust.epub: rust.md doc/version_info.html doc/rust.css
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
--standalone --toc \
|
||||
--section-divs \
|
||||
--number-sections \
|
||||
--from=markdown --to=epub \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/rustpkg.html
|
||||
doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.inc \
|
||||
doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
--standalone --toc \
|
||||
--section-divs \
|
||||
--number-sections \
|
||||
--from=markdown --to=html5 \
|
||||
--css=rust.css --include-in-header=doc/manual.inc \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial.html
|
||||
doc/tutorial.html: tutorial.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial.tex
|
||||
doc/tutorial.tex: tutorial.md doc/version.md
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
--standalone --toc \
|
||||
--number-sections \
|
||||
--include-before-body=doc/version.md \
|
||||
--from=markdown --to=latex \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial.epub
|
||||
doc/tutorial.epub: tutorial.md doc/version_info.html doc/rust.css
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=epub \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
|
||||
|
||||
|
||||
DOCS_L10N += doc/l10n/ja/tutorial.html
|
||||
|
@ -146,84 +109,49 @@ doc/tutorial-macros.html: tutorial-macros.md doc/version_info.html doc/rust.css
|
|||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-container.html
|
||||
doc/tutorial-container.html: tutorial-container.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-ffi.html
|
||||
doc/tutorial-ffi.html: tutorial-ffi.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-borrowed-ptr.html
|
||||
doc/tutorial-borrowed-ptr.html: tutorial-borrowed-ptr.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-tasks.html
|
||||
doc/tutorial-tasks.html: tutorial-tasks.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-conditions.html
|
||||
doc/tutorial-conditions.html: tutorial-conditions.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
DOCS += doc/tutorial-rustpkg.html
|
||||
doc/tutorial-rustpkg.html: tutorial-rustpkg.md doc/version_info.html doc/rust.css \
|
||||
doc/favicon.inc
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html5 --css=rust.css \
|
||||
--include-in-header=doc/favicon.inc \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
||||
|
||||
ifeq ($(CFG_PDFLATEX),)
|
||||
$(info cfg: no pdflatex found, omitting doc/rust.pdf)
|
||||
|
|
Loading…
Reference in New Issue