-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from xsnippet/docs
docs: produce API docs from OpenAPI spec
- Loading branch information
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import pkg_resources | ||
|
||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
project = 'XSnippet API' | ||
copyright = '2017, The XSnippet Team' | ||
release = pkg_resources.get_distribution('xsnippet-api').version | ||
version = '.'.join(release.split('.')[:2]) | ||
extensions = [ | ||
'sphinxcontrib.redoc', | ||
] | ||
source_suffix = '.rst' | ||
master_doc = 'index' | ||
exclude_patterns = ['_build'] | ||
pygments_style = 'sphinx' | ||
redoc = [ | ||
{ | ||
'name': project, | ||
'page': 'api/index', | ||
'spec': os.path.join(here, '..', 'contrib', 'openapi', 'spec.yml'), | ||
}, | ||
] | ||
|
||
if not os.environ.get('READTHEDOCS') == 'True': | ||
import sphinx_rtd_theme | ||
html_theme = 'sphinx_rtd_theme' | ||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
XSnippet API | ||
============ | ||
|
||
At the time we do not have docs other than `API docs <api>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sphinxcontrib-redoc >= 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters