##// END OF EJS Templates
Generate docs correctly if pexpect is not available....
Fernando Perez -
Show More
@@ -1,65 +1,74 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """Script to auto-generate our API docs.
2 """Script to auto-generate our API docs.
3 """
3 """
4 # stdlib imports
4 # stdlib imports
5 import os
5 import os
6 import sys
6 import sys
7
7
8 # local imports
8 # local imports
9 sys.path.append(os.path.abspath('sphinxext'))
9 sys.path.append(os.path.abspath('sphinxext'))
10 from apigen import ApiDocWriter
10 from apigen import ApiDocWriter
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 if __name__ == '__main__':
13 if __name__ == '__main__':
14 pjoin = os.path.join
14 pjoin = os.path.join
15 package = 'IPython'
15 package = 'IPython'
16 outdir = pjoin('source','api','generated')
16 outdir = pjoin('source','api','generated')
17 docwriter = ApiDocWriter(package,rst_extension='.txt')
17 docwriter = ApiDocWriter(package,rst_extension='.txt')
18 # You have to escape the . here because . is a special char for regexps.
18 # You have to escape the . here because . is a special char for regexps.
19 # You must do make clean if you change this!
19 # You must do make clean if you change this!
20 docwriter.package_skip_patterns += [r'\.fixes$',
20 docwriter.package_skip_patterns += [r'\.fixes$',
21 r'\.external$',
21 r'\.external$',
22 r'\.extensions',
22 r'\.extensions',
23 r'\.kernel\.config',
23 r'\.kernel\.config',
24 r'\.attic',
24 r'\.attic',
25 r'\.quarantine',
25 r'\.quarantine',
26 r'\.deathrow',
26 r'\.deathrow',
27 r'\.config\.default',
27 r'\.config\.default',
28 r'\.config\.profile',
28 r'\.config\.profile',
29 r'\.frontend',
29 r'\.frontend',
30 r'\.gui'
30 r'\.gui'
31 ]
31 ]
32
32
33 docwriter.module_skip_patterns += [ r'\.core\.fakemodule',
33 docwriter.module_skip_patterns += [ r'\.core\.fakemodule',
34
34
35 # XXX These need fixing, disabling for
35 # XXX These need fixing, disabling for
36 # now but we need to figure out why
36 # now but we need to figure out why
37 # they are breaking. Error from sphinx
37 # they are breaking. Error from sphinx
38 # for each group copied below
38 # for each group copied below
39
39
40 # AttributeError: __abstractmethods__
40 # AttributeError: __abstractmethods__
41 r'\.core\.component',
41 r'\.core\.component',
42 r'\.utils\.traitlets',
42 r'\.utils\.traitlets',
43
43
44 # AttributeError: __provides__
44 # AttributeError: __provides__
45 r'\.kernel\.clusterdir',
45 r'\.kernel\.clusterdir',
46 r'\.kernel\.configobjfactory',
46 r'\.kernel\.configobjfactory',
47 r'\.kernel\.fcutil',
47 r'\.kernel\.fcutil',
48 r'\.kernel\.ipcontrollerapp',
48 r'\.kernel\.ipcontrollerapp',
49 r'\.kernel\.launcher',
49 r'\.kernel\.launcher',
50 r'\.kernel\.task',
50 r'\.kernel\.task',
51 r'\.kernel\.winhpcjob',
51 r'\.kernel\.winhpcjob',
52 r'\.testing\.util',
52 r'\.testing\.util',
53
53
54 # Keeping these disabled is OK
54 # Keeping these disabled is OK
55 r'\.cocoa',
55 r'\.cocoa',
56 r'\.ipdoctest',
56 r'\.ipdoctest',
57 r'\.Gnuplot',
57 r'\.Gnuplot',
58 r'\.frontend\.process\.winprocess',
58 r'\.frontend\.process\.winprocess',
59 r'\.Shell',
59 r'\.Shell',
60 ]
60 ]
61
62 # If we don't have pexpect, we can't load irunner, so skip any code that
63 # depends on it
64 try:
65 import pexpect
66 except ImportError:
67 docwriter.module_skip_patterns += [r'\.lib\.irunner',
68 r'\.testing\.mkdoctests']
69 # Now, generate the outputs
61 docwriter.write_api_docs(outdir)
70 docwriter.write_api_docs(outdir)
62 docwriter.write_index(outdir, 'gen',
71 docwriter.write_index(outdir, 'gen',
63 relative_to = pjoin('source','api')
72 relative_to = pjoin('source','api')
64 )
73 )
65 print '%d files written' % len(docwriter.written_modules)
74 print '%d files written' % len(docwriter.written_modules)
General Comments 0
You need to be logged in to leave comments. Login now