File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments