Mercurial > pylearn
comparison doc/scripts/docgen.py @ 1516:57feab73c783
Remove :api: role, do not generate epydoc by default
author | Pascal Lamblin <lamblinp@iro.umontreal.ca> |
---|---|
date | Mon, 05 Mar 2012 17:35:15 -0500 |
parents | 9472d234db2e |
children |
comparison
equal
deleted
inserted
replaced
1515:1de26774035f | 1516:57feab73c783 |
---|---|
26 print ' --nopdf: do not produce a PDF file from the doc, only HTML' | 26 print ' --nopdf: do not produce a PDF file from the doc, only HTML' |
27 print ' --epydoc: only compile the api documentation (requires epydoc)' | 27 print ' --epydoc: only compile the api documentation (requires epydoc)' |
28 print ' --help: this help' | 28 print ' --help: this help' |
29 sys.exit(0) | 29 sys.exit(0) |
30 | 30 |
31 options['--all'] = not (bool(options['--epydoc']) ^ bool(options['--rst'])) | 31 if not (options['--epydoc'] or options['--rst']): |
32 # Default is now rst | |
33 options['--rst'] = True | |
32 | 34 |
33 def mkdir(path): | 35 def mkdir(path): |
34 try: | 36 try: |
35 os.mkdir(path) | 37 os.mkdir(path) |
36 except OSError: | 38 except OSError: |
37 pass | 39 pass |
38 | 40 |
39 outdir = options['-o'] or (pylearn_root + '/html') | 41 outdir = options['-o'] or (pylearn_root + '/html') |
40 mkdir(outdir) | 42 mkdir(outdir) |
41 os.chdir(outdir) | 43 os.chdir(outdir) |
42 mkdir("doc") | |
43 mkdir("api") | |
44 | 44 |
45 # Make sure the appropriate 'theano' directory is in the PYTHONPATH | 45 # Make sure the appropriate 'theano' directory is in the PYTHONPATH |
46 pythonpath = os.environ.get('PYTHONPATH', '') | 46 pythonpath = os.environ.get('PYTHONPATH', '') |
47 pythonpath = pylearn_root + ':' + pythonpath | 47 pythonpath = pylearn_root + ':' + pythonpath |
48 os.environ['PYTHONPATH'] = pythonpath | 48 os.environ['PYTHONPATH'] = pythonpath |
49 | 49 |
50 if options['--all'] or options['--epydoc']: | 50 if options['--all'] or options['--epydoc']: |
51 mkdir("api") | |
51 from epydoc.cli import cli | 52 from epydoc.cli import cli |
52 sys.path[0:0] = [pylearn_root] | 53 sys.path[0:0] = [pylearn_root] |
53 | 54 |
54 #Generate HTML doc | 55 #Generate HTML doc |
55 | 56 |
61 | 62 |
62 # Generate PDF doc | 63 # Generate PDF doc |
63 # TODO | 64 # TODO |
64 | 65 |
65 if options['--all'] or options['--rst']: | 66 if options['--all'] or options['--rst']: |
67 mkdir("doc") | |
66 import sphinx | 68 import sphinx |
67 sys.path[0:0] = [os.path.join(pylearn_root, 'doc')] | 69 sys.path[0:0] = [os.path.join(pylearn_root, 'doc')] |
68 sphinx.main(['', '-E', os.path.join(pylearn_root, 'doc'), '.']) | 70 sphinx.main(['', '-E', os.path.join(pylearn_root, 'doc'), '.']) |
69 | 71 |
70 if not options['--nopdf']: | 72 if not options['--nopdf']: |