Skip to content

Commit 1582742

Browse files
committed
---
yaml --- r: 7639 b: refs/heads/master c: 7857dcb h: refs/heads/master i: 7637: 60bfa66 7635: 5d869e1 7631: 1f233ac v: v3
1 parent e28fede commit 1582742

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 7c1d1d6c9a63e76e24ac31bad96940ab1fb44d0f
2+
refs/heads/master: 7857dcb88c7e6ab615415541655393aa2b44bb95

trunk/src/etc/rustdoc.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# A little helper script for passing rustdoc output through markdown
2+
# and pandoc
3+
4+
import sys, os, commands;
5+
6+
if len(sys.argv) < 2:
7+
print("Please provide an input crate")
8+
sys.exit(1)
9+
10+
crate = sys.argv[1]
11+
12+
status, output = commands.getstatusoutput("rustdoc " + crate)
13+
14+
basename = os.path.splitext(os.path.basename(crate))[0]
15+
16+
markdownfile = basename + ".md"
17+
18+
f = open(markdownfile, 'w')
19+
f.write(output)
20+
f.close()
21+
22+
status, output = commands.getstatusoutput("markdown " + markdownfile)
23+
24+
htmlfile = basename + ".md.html"
25+
26+
f = open(htmlfile, 'w')
27+
f.write(output)
28+
f.close()
29+
30+
pdcmd = "pandoc --standalone --toc --section-divs --number-sections \
31+
--from=markdown --to=html --css=rust.css \
32+
--output=" + basename + ".pd.html " + markdownfile
33+
34+
os.system(pdcmd)

0 commit comments

Comments
 (0)