source: specdomain/src/specdomain/doc/starter.py @ 938

Last change on this file since 938 was 938, checked in by jemian, 10 years ago

keywords

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 882 bytes
Line 
1#!/usr/bin/env python
2
3# $Id: starter.py 938 2012-06-15 23:10:56Z jemian $
4
5'''
6Builds Sphinx documentation
7(and provides a way to use the source-code debugger for the process)
8'''
9
10import os
11import sphinx
12import sys
13
14
15def force_rebuild_all(parent = '_build'):
16    '''
17    Delete the *doctrees* subdirectory.
18   
19    :param str parent: path to *build* subdirectory (either ``build`` or ``_build``)
20    '''
21    if os.path.exists(parent+'/doctrees'):
22        garbage_list = [
23            parent+'/doctrees/environment.pickle',
24            #parent+'/doctrees/index.doctree',
25            #parent+'/doctrees/test_doc.doctree',
26        ]
27        for item in garbage_list:
28            if os.path.exists(item):
29                os.remove(item)
30        #os.rmdir(parent+'/doctrees')
31
32
33if __name__ == '__main__':
34    force_rebuild_all()
35    args = [sys.argv[0]] + "-b html -d _build/doctrees . _build/html".split()
36    sphinx.main(args)
Note: See TracBrowser for help on using the repository browser.