Skip to content

Commit b2aef9d

Browse files
committed
Auto merge of #27789 - chriskrycho:remove_pandoc_references, r=steveklabnik
Per @steveklabnik's comment [here](rust-lang/cargo#739 (comment)), the Pandoc components of the Makefile are no longer used, and as such the corresponding components of the documentation are out of date. - I've removed the Pandoc (and therefore also LaTeX) elements of the makefile and confirmed that the build proceeds correctly. - I updated the documentation to reference `rustdoc` and of Pandoc. r? @steveklabnik
2 parents aed55dc + 75f7a68 commit b2aef9d

File tree

2 files changed

+6
-102
lines changed

2 files changed

+6
-102
lines changed

mk/docs.mk

+2-89
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#
1414
# The DOCS variable is their names (with no file extension).
1515
#
16-
# PDF_DOCS lists the targets for which PDF documentation should be
17-
# build.
18-
#
1916
# RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the
2017
# rustdoc invocation for xyz.
2118
#
@@ -35,8 +32,6 @@ DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \
3532
guide-testing
3633

3734

38-
PDF_DOCS := reference
39-
4035
RUSTDOC_DEPS_reference := doc/full-toc.inc
4136
RUSTDOC_FLAGS_reference := --html-in-header=doc/full-toc.inc
4237

@@ -52,13 +47,6 @@ RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
5247

5348
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
5449

55-
PANDOC_BASE_OPTS := --standalone --toc --number-sections
56-
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --from=markdown --to=latex \
57-
--include-before-body=doc/version.tex \
58-
--include-before-body=doc/footer.tex \
59-
--include-in-header=doc/uptack.tex
60-
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
61-
6250
# The rustdoc executable...
6351
RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
6452
# ...with rpath included in case --disable-rpath was provided to
@@ -89,30 +77,10 @@ else
8977
HTML_DEPS :=
9078
endif
9179

92-
# Check for xelatex
93-
94-
ifneq ($(CFG_XELATEX),)
95-
CFG_LATEX := $(CFG_XELATEX)
96-
XELATEX = 1
97-
else
98-
$(info cfg: no xelatex found, disabling LaTeX docs)
99-
NO_PDF_DOCS = 1
100-
endif
101-
102-
ifeq ($(CFG_PANDOC),)
103-
$(info cfg: no pandoc found, omitting PDF and EPUB docs)
104-
ONLY_HTML_DOCS = 1
105-
endif
106-
107-
10880
######################################################################
10981
# Rust version
11082
######################################################################
11183

112-
doc/version.tex: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
113-
@$(call E, version-stamp: $@)
114-
$(Q)echo "$(CFG_VERSION)" >$@
115-
11684
HTML_DEPS += doc/version_info.html
11785
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
11886
$(wildcard $(D)/*.*) | doc/
@@ -121,10 +89,10 @@ doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
12189
s/SHORT_HASH/$(CFG_SHORT_VER_HASH)/; \
12290
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
12391

124-
GENERATED += doc/version.tex doc/version_info.html
92+
GENERATED += doc/version_info.html
12593

12694
######################################################################
127-
# Docs, from rustdoc and sometimes pandoc
95+
# Docs from rustdoc
12896
######################################################################
12997

13098
doc/:
@@ -150,20 +118,6 @@ doc/footer.inc: $(D)/footer.inc | doc/
150118
$(Q)cp -PRp $< $@ 2> /dev/null
151119

152120
# The (english) documentation for each doc item.
153-
154-
define DEF_SHOULD_BUILD_PDF_DOC
155-
SHOULD_BUILD_PDF_DOC_$(1) = 1
156-
endef
157-
$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))
158-
159-
doc/footer.tex: $(D)/footer.inc | doc/
160-
@$(call E, pandoc: $@)
161-
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
162-
163-
doc/uptack.tex: $(D)/uptack.tex | doc/
164-
$(Q)cp $< $@
165-
166-
# HTML (rustdoc)
167121
DOC_TARGETS += doc/not_found.html
168122
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
169123
@$(call E, rustdoc: $@)
@@ -179,47 +133,6 @@ doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/
179133
@$$(call E, rustdoc: $$@)
180134
$$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
181135

182-
ifneq ($(ONLY_HTML_DOCS),1)
183-
184-
# EPUB (pandoc directly)
185-
DOC_TARGETS += doc/$(1).epub
186-
doc/$(1).epub: $$(D)/$(1).md | doc/
187-
@$$(call E, pandoc: $$@)
188-
$$(CFG_PANDOC) $$(PANDOC_EPUB_OPTS) $$< --output=$$@
189-
190-
# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
191-
DOC_TARGETS += doc/$(1).tex
192-
doc/$(1).tex: $$(D)/$(1).md doc/uptack.tex doc/footer.tex doc/version.tex | doc/
193-
@$$(call E, pandoc: $$@)
194-
$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) $$< --output=$$@
195-
196-
ifneq ($(NO_PDF_DOCS),1)
197-
ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1)
198-
DOC_TARGETS += doc/$(1).pdf
199-
ifneq ($(XELATEX),1)
200-
doc/$(1).pdf: doc/$(1).tex
201-
@$$(call E, latex compiler: $$@)
202-
$$(Q)$$(CFG_LATEX) \
203-
-interaction=batchmode \
204-
-output-directory=doc \
205-
$$<
206-
else
207-
# The version of xelatex on the snap bots seemingly ingores -output-directory
208-
# So we'll output to . and move to the doc directory manually.
209-
# This will leave some intermediate files in the build directory.
210-
doc/$(1).pdf: doc/$(1).tex
211-
@$$(call E, latex compiler: $$@)
212-
$$(Q)$$(CFG_LATEX) \
213-
-interaction=batchmode \
214-
-output-directory=. \
215-
$$<
216-
$$(Q)mv ./$(1).pdf $$@
217-
endif # XELATEX
218-
endif # SHOULD_BUILD_PDF_DOCS_$(1)
219-
endif # NO_PDF_DOCS
220-
221-
endif # ONLY_HTML_DOCS
222-
223136
endef
224137

225138
$(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname))))

src/doc/README.md

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Rust documentations
22

3-
## Dependencies
4-
5-
[Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal
6-
document converter, is required to generate docs as HTML from Rust's
7-
source code.
8-
93
## Building
104

115
To generate all the docs, just run `make docs` from the root of the repository.
@@ -26,15 +20,12 @@ To generate an HTML version of a doc from Markdown manually, you can do
2620
something like:
2721

2822
~~~~
29-
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
23+
rustdoc reference.md
3024
~~~~
3125

3226
(`reference.md` being the Rust Reference Manual.)
3327

34-
The syntax for pandoc flavored markdown can be found at:
35-
36-
- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
37-
38-
A nice quick reference (for non-pandoc markdown) is at:
28+
An overview of how to use the `rustdoc` command is available [in the docs][1].
29+
Further details are available from the command line by with `rustdoc --help`.
3930

40-
- http://kramdown.gettalong.org/quickref.html
31+
[1]: https://github.com/rust-lang/rust/blob/master/src/doc/trpl/documentation.md

0 commit comments

Comments
 (0)