-
Notifications
You must be signed in to change notification settings - Fork 32
#33 rtd documentation #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
558f58c
1927dd8
f5f9357
02e60f4
888c12e
3ec327e
66919a9
8bf41b3
77eb691
ef16cae
dc9f57b
2691199
1b7e07e
665dd0d
4edb610
63865d0
65e19ca
3960411
09fac74
9885456
811af15
ca2a51e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
API Reference | ||
============= | ||
|
||
.. automodule:: diffsync | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
diffsync.diff | ||
josh-silvas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
------------- | ||
|
||
.. automodule:: diffsync.diff | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
diffsync.enum | ||
------------- | ||
|
||
.. automodule:: diffsync.enum | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
diffsync.exceptions | ||
------------------- | ||
|
||
.. automodule:: diffsync.exceptions | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
diffsync.helpers | ||
---------------- | ||
|
||
.. automodule:: diffsync.helpers | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
diffsync.logging | ||
---------------- | ||
|
||
.. automodule:: diffsync.logging | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
diffsync.utils | ||
-------------- | ||
|
||
.. automodule:: diffsync.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
"""Configuration file for the Sphinx documentation builder. | ||
|
||
This file only contains a selection of the most common options. For a full | ||
list see the documentation: | ||
https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
""" | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# pylint: disable=W,C,R | ||
import os | ||
import sys | ||
|
||
from pathlib import Path | ||
from sphinx.ext.apidoc import main | ||
|
||
try: | ||
import toml | ||
except ImportError: | ||
sys.exit("Please make sure to `pip install toml` or enable the Poetry shell and run `poetry install`.") | ||
|
||
# -- Variable setup -------------------------------------------------------------- | ||
|
||
ROOT_DIR = Path(__file__).parent.parent.parent | ||
CURR_DIR = f"{ROOT_DIR}/docs/source" | ||
PYPROJECT_CONFIG = toml.load(f"{ROOT_DIR}/pyproject.toml") | ||
TOOL_CONFIG = PYPROJECT_CONFIG["tool"]["poetry"] | ||
|
||
# Inserts the diffsync library into the path. This is needed for RTD env to find the | ||
# library needed for autodocs. | ||
sys.path.insert(0, os.path.abspath("../..")) | ||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = TOOL_CONFIG["name"] | ||
copyright = f"2020-2021, {','.join(TOOL_CONFIG['authors'])}" | ||
author = ",".join(TOOL_CONFIG["authors"]) | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = TOOL_CONFIG["version"] | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "m2r2"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm familiar with |
||
|
||
autodoc_default_options = { | ||
"members": True, | ||
"show-inheritance": True, | ||
"special-members": "__init__", | ||
"undoc-members": True, | ||
} | ||
|
||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["templates"] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "sphinx_rtd_theme" | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ["static"] | ||
|
||
|
||
def remove_module_docstring(app, what, name, obj, options, lines): | ||
"""Removes copyright heading on modules to prevent unneeded reference in the API documentation.""" | ||
if what == "module": | ||
# At the module level, remove everything except the first line containing a summary of the module. All | ||
# lines that follow are copyright notices. | ||
del lines[1:] | ||
|
||
|
||
def run_apidoc(_): | ||
"""Adds the sphinx-apidoc command as a callback during the build process.""" | ||
main(["-MTf", "-t", f"{CURR_DIR}/template/api", "-o", f"{CURR_DIR}/api", f"{ROOT_DIR}/{TOOL_CONFIG['name']}"]) | ||
|
||
|
||
def setup(app): | ||
"""Registers the callbacks to be called when the event is emitted.""" | ||
app.connect("builder-inited", run_apidoc) | ||
app.connect("autodoc-process-docstring", remove_module_docstring) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**************************** | ||
Using Multiple Data Sources | ||
**************************** | ||
|
||
.. mdinclude:: ../../../examples/example1/README.md | ||
:start-line: 2 | ||
:end-line: 67 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
****************** | ||
Callback Function | ||
****************** | ||
|
||
.. mdinclude:: ../../../examples/example2/README.md | ||
:start-line: 2 | ||
:end-line: 44 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
############ | ||
Examples | ||
############ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
01-multiple-data-sources | ||
02-callback-function |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
############### | ||
Getting Started | ||
############### | ||
|
||
.. mdinclude:: ../../../README.md | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
:start-line: 28 | ||
:end-line: 153 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Welcome to DiffSync's documentation! | ||
==================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
overview/index | ||
getting_started/index | ||
examples/index | ||
api/diffsync | ||
license/index | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
############ | ||
License | ||
############ | ||
|
||
.. mdinclude:: ../../../LICENSE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
********* | ||
Overview | ||
********* | ||
|
||
.. mdinclude:: ../../../README.md | ||
josh-silvas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:start-line: 2 | ||
:end-line: 25 |
Uh oh!
There was an error while loading. Please reload this page.