Skip to content

Commit

Permalink
hotfix: enabled docs build to emulate the readthedocs build and fix i…
Browse files Browse the repository at this point in the history
…ssues
  • Loading branch information
asampat3090 committed May 6, 2018
1 parent 484ad3e commit 0bf97f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 1 addition & 3 deletions devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ $ pip install sphinx-argparse
$ cd docs
$ rm -rf source/*
$ make clean
$ sphinx-apidoc -o source/ ../datmo ../datmo/core ../datmo/tests ../datmo/cli/command ../datmo/cli/driver
$ ln -s ../examples/README.md examples.md
$ make html
$ sphinx-build -b html . _build/html # emulates readthedocs build
$ pip install sphinx-rtd-theme
$ pip install recommonmark
```
Expand Down
17 changes: 16 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Datmo', u'Datmo Documentation', author, 'Datmo',
'One line description of project.', 'Miscellaneous'),
'Open source model tracking for developers.', 'Miscellaneous'),
]

github_doc_root = 'https://github.com/datmo/datmo/tree/master/docs/'
Expand All @@ -168,3 +168,18 @@ def setup(app):
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(AutoStructify)
app.connect('builder-inited', run_apidoc)

def run_apidoc(_):
from sphinx.apidoc import main
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
cur_dir = os.path.abspath(os.path.dirname(__file__))
src_dir = os.path.join(cur_dir, "source")
module = os.path.join(cur_dir,"..","datmo")
main(['-e', '-f', '-o', src_dir, module,
os.path.join(module, "core"),
os.path.join(module, "tests"),
os.path.join(module, "cli", "command"),
os.path.join(module, "cli", "driver")])

0 comments on commit 0bf97f1

Please sign in to comment.