File tree Expand file tree Collapse file tree 3 files changed +15
-23
lines changed Expand file tree Collapse file tree 3 files changed +15
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 21
21
# If extensions (or modules to document with autodoc) are in another directory,
22
22
# add these directories to sys.path here. If the directory is relative to the
23
23
# documentation root, use os.path.abspath to make it absolute, like shown here.
24
+ sys .path .insert (0 , os .path .abspath ('docs' ))
24
25
sys .path .insert (0 , os .path .abspath ('.' ))
25
26
26
27
master_doc = 'docs/index'
Original file line number Diff line number Diff line change 1
1
import sphinx .parsers
2
- import docutils .parsers .rst as rst
3
2
4
3
class CStrip (sphinx .parsers .Parser ):
5
- def __init (self ):
6
- self .rst_parser = rst . Parser ()
4
+ def __init__ (self ):
5
+ self .rst_parser = sphinx . parsers . RSTParser ()
7
6
8
- def parse (self , inputstring , document ):
9
- print (inputstring )
10
- self .rst_parser (stripped , document )
7
+ def parse (self , inputstring , document ):
8
+ # This setting is missing starting with Sphinx 1.7.1 so we set it ourself.
9
+ document .settings .tab_width = 4
10
+ stripped = []
11
+ for line in inputstring .split ("\n " ):
12
+ line = line .strip ()
13
+ if line == "//|" :
14
+ stripped .append ("" )
15
+ elif line .startswith ("//| " ):
16
+ stripped .append (line [len ("//| " ):])
17
+ stripped = "\r \n " .join (stripped )
18
+ self .rst_parser .parse (stripped , document )
You can’t perform that action at this time.
0 commit comments