Skip to content

Commit

Permalink
Allow render_docs.py tool to be run on any directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Mizyrycki committed Jun 25, 2012
1 parent 5ebaabe commit 8a9a5df
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Expand Up @@ -3,7 +3,8 @@
import sys, os import sys, os


# Import OpenHatch version # Import OpenHatch version
sys.path.insert(0,'..') project_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),'..')
sys.path.insert(0,project_path)
from setup import __version__ from setup import __version__


# The suffix of source filenames. # The suffix of source filenames.
Expand Down
18 changes: 0 additions & 18 deletions docs/generate_html.py

This file was deleted.

26 changes: 26 additions & 0 deletions tools/render_docs.py
@@ -0,0 +1,26 @@
"""Generate html documentation"""

__requires__ = 'Sphinx>=1.1.2'

import sys,os,re
from pkg_resources import load_entry_point

# Allow this script to find its doc config resource
docs_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),'../docs')
sys.path.insert(0,docs_path)

import conf

def main(argv=None):
if argv:
sys.argv = argv
# Generate documentation
return load_entry_point(__requires__, 'console_scripts',
'sphinx-build')()

if __name__ == "__main__":

# generate rendered html on the docs/html directory.
os.chdir(docs_path)
sys.exit(main(['generate_docs.py','-b','html','-d','_temp','.','html']))

0 comments on commit 8a9a5df

Please sign in to comment.