Skip to content

Commit 8aacb86

Browse files
committed
---
yaml --- r: 12011 b: refs/heads/master c: 0a347e7 h: refs/heads/master i: 12009: 5b0609c 12007: 835b0ca v: v3
1 parent 53af90a commit 8aacb86

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 57281f52e509fc13c2c978a43b18ee70a910f4e7
2+
refs/heads/master: 0a347e760f4757fc75e63f005857c63894fc9e1e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/doc/prep.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ var out = outfile ? fs.createWriteStream(outfile) : process.stdout;
4040
while ((line = lines[cur++]) != null) {
4141
if (/^~~~/.test(line)) {
4242
var block = "", bline;
43-
var isRust = !/notrust/.test(line);
43+
var notRust =
44+
/notrust/.test(line)
45+
// These are all used by the language ref to indicate things
46+
// that are not Rust source code
47+
|| /ebnf/.test(line)
48+
|| /abnf/.test(line)
49+
|| /keyword/.test(line)
50+
|| /field/.test(line)
51+
|| /precedence/.test(line);
52+
var isRust = !notRust;
4453
while ((bline = lines[cur++]) != null) {
4554
if (/^~~~/.test(bline)) break;
4655
if (!/^\s*##? /.test(bline)) block += bline + "\n";

trunk/mk/docs.mk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@ ifeq ($(CFG_PANDOC),)
1212
$(info cfg: no pandoc found, omitting doc/rust.pdf)
1313
else
1414

15+
ifeq ($(CFG_NODE),)
16+
$(info cfg: no node found, omitting doc/tutorial.html)
17+
else
18+
1519
DOCS += doc/rust.html
1620
doc/rust.html: rust.md doc/version.md doc/keywords.md $(S)doc/rust.css
1721
@$(call E, pandoc: $@)
18-
$(Q)"$(CFG_PANDOC)" \
22+
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
23+
"$(CFG_PANDOC)" \
1924
--standalone --toc \
2025
--section-divs \
2126
--number-sections \
2227
--from=markdown --to=html \
2328
--css=rust.css \
24-
--output=$@ \
25-
$<
29+
--output=$@
2630
@$(call E, cp: $(S)doc/rust.css)
2731
-$(Q)cp -a $(S)doc/rust.css doc/rust.css 2> /dev/null
2832

33+
endif
2934

3035
ifeq ($(CFG_PDFLATEX),)
3136
$(info cfg: no pdflatex found, omitting doc/rust.pdf)

0 commit comments

Comments
 (0)