Skip to content

Commit

Permalink
Merge pull request #29 from dev-cafe/autodoc-rtd
Browse files Browse the repository at this point in the history
Build API docs on RTD
  • Loading branch information
bast committed Mar 11, 2019
2 parents 0848261 + 8f0d88a commit b51e249
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ twine = "*"
watchdog = "*"
wheel = "*"
yapf = "*"
pyyaml = "*"

[packages]
click = "*"
pyparsing = "*"
pyyaml = "*"
24 changes: 15 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import pathlib
import sys

import guzzle_sphinx_theme
from sphinx.apidoc import main

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, str(pathlib.Path(__file__).parents[1]))

from parselglossy import __version__ as psversion # isort:skip

# -- General configuration ---------------------------------------------

extensions = [
'sphinx.ext.napoleon', 'sphinx.ext.viewcode', 'guzzle_sphinx_theme'
]
extensions = ['sphinx.ext.napoleon', 'sphinx.ext.viewcode', 'guzzle_sphinx_theme']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
Expand All @@ -34,14 +33,21 @@
html_title = "parselglossy Documentation"
html_short_title = "parselglossy {}".format(version)
html_show_sourcelink = False
html_sidebars = {
'**':
['logo-text.html', 'globaltoc.html', 'localtoc.html', 'searchbox.html']
}
html_sidebars = {'**': ['logo-text.html', 'globaltoc.html', 'localtoc.html', 'searchbox.html']}
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
html_theme_options = {
# Set the name of the project to appear in the sidebar
"project_nav_name": "parselglossy",
}
html_static_path = ['_static']


def run_apidoc(_):
cur_dir = pathlib.Path(__file__).parent
module = cur_dir.parent / project
main(['-e', '-o', str(cur_dir), str(module), '--force'])


def setup(app):
app.connect('builder-inited', run_apidoc)

0 comments on commit b51e249

Please sign in to comment.