Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow render_docs.py tool to be run on any directory

  • Loading branch information...
commit 8a9a5df57e10c0f761b438dbbb2268087e429e4a 1 parent 5ebaabe
Daniel Mizyrycki authored
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']))
+
Please sign in to comment.
Something went wrong with that request. Please try again.