# L10N_LANGS are the languages for which the docs have been
# translated.
######################################################################
-DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
+DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
guide-tasks guide-container guide-pointers guide-testing \
- guide-runtime complement-bugreport complement-cheatsheet \
- complement-lang-faq complement-project-faq rust rustdoc \
- guide-unsafe
+ guide-runtime complement-bugreport \
+ complement-lang-faq complement-design-faq complement-project-faq rust \
+ rustdoc guide-unsafe
PDF_DOCS := tutorial rust
# Generally no need to edit below here.
# The options are passed to the documentation generators.
-RUSTDOC_HTML_OPTS = --markdown-css rust.css \
- --markdown-before-content=doc/version_info.html \
- --markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
+RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
+ --markdown-in-header=doc/favicon.inc \
+ --markdown-after-content=doc/footer.inc \
+ --markdown-playground-url='http://play.rust-lang.org/'
+
+RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
PANDOC_BASE_OPTS := --standalone --toc --number-sections
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
$(wildcard $(D)/*.*) | doc/
@$(call E, version-info: $@)
- sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
+ $(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
$(CFG_VER_HASH) | head -c 8)/;\
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
@$(call E, pandoc: $@)
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
+# HTML (rustdoc)
+DOC_TARGETS += doc/not_found.html
+doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
+ @$(call E, rustdoc: $@)
+ $(Q)$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) \
+ --markdown-css http://doc.rust-lang.org/rust.css $<
+
define DEF_DOC
# HTML (rustdoc)
DOC_TARGETS += doc/$(1).html
doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/
@$$(call E, rustdoc: $$@)
- $$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
+ $$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
ifneq ($(ONLY_HTML_DOCS),1)
$$(RSINPUTS_$(1)) \
$$(RUSTDOC_EXE) \
$$(foreach dep,$$(RUST_DEPS_$(1)), \
- $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep))
+ $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
+ doc/$$(dep)/)
else
LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))
endif
+doc/$(1)/:
+ $$(Q)mkdir -p $$@
+
$(2) += doc/$(1)/index.html
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
-doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1))
+doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
@$$(call E, rustdoc $$@)
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
endef
ifdef CFG_DISABLE_DOCS
$(info cfg: disabling doc build (CFG_DISABLE_DOCS))
DOC_TARGETS :=
+ COMPILER_DOC_TARGETS :=
endif
docs: $(DOC_TARGETS)