doc: tidy and cleanup CSS deps, add tutorial PDF generation

This commit is contained in:
Adrien Tétar 2013-10-11 20:21:46 +02:00
parent 5d1fc864c7
commit 8d97db48d4
6 changed files with 200 additions and 237 deletions

2
.gitignore vendored
View File

@ -77,7 +77,7 @@ src/.DS_Store
/nd/
/llvm/
version.md
rust.tex
*.tex
keywords.md
x86_64-apple-darwin/
x86_64-unknown-linux-gnu/

View File

@ -1,8 +0,0 @@
/*
Custom styles for the library docs generated by naturaldocs
*/
p {
text-indent: 0;
margin-bottom: 1em;
}

View File

@ -1,6 +0,0 @@
/* Display the full TOC */
#TOC ul ul {
display: block;
padding-left: 2em;
}

7
doc/manual.inc Normal file
View File

@ -0,0 +1,7 @@
<style>
/* Display the full TOC */
#TOC ul ul {
display: block;
padding-left: 2em;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
# Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
@ -24,7 +24,7 @@ doc/rust.css: rust.css
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/manual.css: manual.css
doc/manual.inc: manual.inc
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
@ -41,7 +41,7 @@ endif
ifneq ($(NO_DOCS),1)
DOCS += doc/rust.html
doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.css
doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.inc
@$(call E, pandoc: $@)
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
"$(CFG_PANDOC)" \
@ -49,9 +49,8 @@ doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.css
--section-divs \
--number-sections \
--from=markdown --to=html5 \
--css=rust.css \
--css=manual.css \
--include-before-body=doc/version_info.html \
--css=rust.css --include-in-header=doc/manual.inc \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/rust.tex
@ -61,12 +60,23 @@ doc/rust.tex: rust.md doc/version.md
"$(CFG_PANDOC)" \
--standalone --toc \
--number-sections \
--include-before-body=doc/version.md \
--include-before-body=doc/version.md \
--from=markdown --to=latex \
--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=$@
DOCS += doc/rustpkg.html
doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.css
doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.inc
@$(call E, pandoc: $@)
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
"$(CFG_PANDOC)" \
@ -74,9 +84,8 @@ doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.css
--section-divs \
--number-sections \
--from=markdown --to=html5 \
--css=rust.css \
--css=manual.css \
--include-before-body=doc/version_info.html \
--css=rust.css --include-in-header=doc/manual.inc \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial.html
@ -86,7 +95,7 @@ doc/tutorial.html: tutorial.md doc/version_info.html doc/rust.css
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS_L10N += doc/l10n/ja/tutorial.html
@ -96,7 +105,7 @@ doc/l10n/ja/tutorial.html: doc/l10n/ja/tutorial.md doc/version_info.html doc/rus
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=../../rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-macros.html
@ -107,7 +116,7 @@ doc/tutorial-macros.html: tutorial-macros.md doc/version_info.html \
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-container.html
@ -117,7 +126,7 @@ doc/tutorial-container.html: tutorial-container.md doc/version_info.html doc/rus
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-ffi.html
@ -127,7 +136,7 @@ doc/tutorial-ffi.html: tutorial-ffi.md doc/version_info.html doc/rust.css
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-borrowed-ptr.html
@ -137,7 +146,7 @@ doc/tutorial-borrowed-ptr.html: tutorial-borrowed-ptr.md doc/version_info.html d
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-tasks.html
@ -147,7 +156,7 @@ doc/tutorial-tasks.html: tutorial-tasks.md doc/version_info.html doc/rust.css
$(CFG_PANDOC) --standalone --toc \
--section-divs --number-sections \
--from=markdown --to=html5 --css=rust.css \
--include-before-body=doc/version_info.html \
--include-before-body=doc/version_info.html \
--output=$@
DOCS += doc/tutorial-conditions.html
@ -188,6 +197,14 @@ doc/rust.pdf: doc/rust.tex
-output-directory=doc \
$<
DOCS += doc/tutorial.pdf
doc/tutorial.pdf: doc/tutorial.tex
@$(call E, pdflatex: $@)
$(Q)$(CFG_PDFLATEX) \
-interaction=batchmode \
-output-directory=doc \
$<
endif
endif
endif
@ -251,7 +268,7 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
@$(call E, version-info: $@)
sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
$(CFG_VER_HASH) | head -c 8)/;\
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
GENERATED += doc/version.md doc/version_info.html