Skip to content

Commit 27ce01c

Browse files
committed
---
yaml --- r: 232348 b: refs/heads/try c: 8d90d3f h: refs/heads/master v: v3
1 parent 688f0dc commit 27ce01c

File tree

167 files changed

+1819
-19783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1819
-19783
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: a4066271b77810aec0a4a309f66a45e4f8b940de
4+
refs/heads/try: 8d90d3f36871a00023cc1f313f91e351c287ca15
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/mk/docs.mk

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
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+
#
1619
# RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the
1720
# rustdoc invocation for xyz.
1821
#
@@ -32,6 +35,8 @@ DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \
3235
guide-testing
3336

3437

38+
PDF_DOCS := reference
39+
3540
RUSTDOC_DEPS_reference := doc/full-toc.inc
3641
RUSTDOC_FLAGS_reference := --html-in-header=doc/full-toc.inc
3742

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

4853
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
4954

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+
5062
# The rustdoc executable...
5163
RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
5264
# ...with rpath included in case --disable-rpath was provided to
@@ -77,10 +89,30 @@ else
7789
HTML_DEPS :=
7890
endif
7991

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+
80108
######################################################################
81109
# Rust version
82110
######################################################################
83111

112+
doc/version.tex: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
113+
@$(call E, version-stamp: $@)
114+
$(Q)echo "$(CFG_VERSION)" >$@
115+
84116
HTML_DEPS += doc/version_info.html
85117
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
86118
$(wildcard $(D)/*.*) | doc/
@@ -89,10 +121,10 @@ doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
89121
s/SHORT_HASH/$(CFG_SHORT_VER_HASH)/; \
90122
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
91123

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

94126
######################################################################
95-
# Docs from rustdoc
127+
# Docs, from rustdoc and sometimes pandoc
96128
######################################################################
97129

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

120152
# 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)
121167
DOC_TARGETS += doc/not_found.html
122168
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
123169
@$(call E, rustdoc: $@)
@@ -133,6 +179,47 @@ doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/
133179
@$$(call E, rustdoc: $$@)
134180
$$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
135181

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+
136223
endef
137224

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

branches/try/mk/tests.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,9 @@ tidy-basic:
268268
.PHONY: tidy-binaries
269269
tidy-binaries:
270270
@$(call E, check: binaries)
271-
$(Q)find $(S)src -type f \
272-
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
271+
$(Q)find $(S)src -type f -perm +a+x \
273272
-not -name '*.rs' -and -not -name '*.py' \
274-
-and -not -name '*.sh' -and -not -name '*.pp' \
273+
-and -not -name '*.sh' \
275274
| grep '^$(S)src/jemalloc' -v \
276275
| grep '^$(S)src/libuv' -v \
277276
| grep '^$(S)src/llvm' -v \

branches/try/src/doc/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
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+
39
## Building
410

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

2228
~~~~
23-
rustdoc reference.md
29+
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
2430
~~~~
2531

2632
(`reference.md` being the Rust Reference Manual.)
2733

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`.
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:
3039

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

branches/try/src/etc/dec2flt_table.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

branches/try/src/etc/test-float-parse/_common.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

branches/try/src/etc/test-float-parse/few-ones.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)