Permalink
Browse files

Merge pull request #44 from mzdaniel/tools

Allow render_docs.py tool to be run on any directory
  • Loading branch information...
2 parents e673c68 + 8a9a5df commit 3fb1e53c89b6b50206f31042883b3d8f9933492b @paulproteus paulproteus committed Jun 27, 2012
Showing with 28 additions and 19 deletions.
  1. +2 −1 docs/conf.py
  2. +0 −18 docs/generate_html.py
  3. +26 −0 tools/render_docs.py
View
3 docs/conf.py
@@ -3,7 +3,8 @@
import sys, os
# 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__
# The suffix of source filenames.
View
18 docs/generate_html.py
@@ -1,18 +0,0 @@
-"""Generate html documentation"""
-
-__requires__ = 'Sphinx>=1.1.2'
-
-import sys,os,re,conf
-from pkg_resources import load_entry_point
-
-
-def main(argv=None):
- if argv:
- sys.argv = argv
- # Generate documentation
- return load_entry_point(__requires__, 'console_scripts',
- 'sphinx-build')()
-
-if __name__ == "__main__":
- sys.exit(main(['generate_html.py','-b','html','-d','_temp','.','html']))
-
View
26 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 3fb1e53

Please sign in to comment.