-
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
Merged
dgarros
merged 22 commits into
networktocode:master
from
josh-silvas:#33-rtd-documentation
Oct 8, 2021
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
558f58c
Adds RTD files and dependencies
josh-silvas 1927dd8
Adds RTD requirements
josh-silvas f5f9357
Adds sphinx callback for RTD to run apidoc generator.
josh-silvas 02e60f4
Update getting_started/index.rst line lengh
josh-silvas 888c12e
Updates docs/conf.py with correct root directory.
josh-silvas 3ec327e
Adds import of diffsync library
josh-silvas 66919a9
Updates path imports
josh-silvas 8bf41b3
Updates doc requirements.txt
josh-silvas 77eb691
Add invoke commands for documentation.
josh-silvas ef16cae
Adds small changes for tests.
josh-silvas dc9f57b
Move doc requirements into pyproject.toml
josh-silvas 2691199
Adds toml to optional poetry install
josh-silvas 1b7e07e
Updates toml version
josh-silvas 665dd0d
Update example titles.
josh-silvas 4edb610
Update documentation and homepage reference in pyproject.toml to poin…
josh-silvas 63865d0
Update docs/source/conf.py
josh-silvas 65e19ca
Convert from sphinx to mkdocs as per the standard.
josh-silvas 3960411
Updates poetry.extras for the docs
josh-silvas 09fac74
Adds doc dependencies in as optional
josh-silvas 9885456
Revert to sphinx
josh-silvas 811af15
Fixes separate pages for api reference.
josh-silvas ca2a51e
Removes api_doc invoke function as this is now handled via a sphinx c…
josh-silvas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -286,3 +286,6 @@ fabric.properties | |
.vscode/* | ||
|
||
*.code-workspace | ||
|
||
## Sphinx Documentation ## | ||
docs/build |
This file contains hidden or 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,15 @@ | ||
--- | ||
version: 2 | ||
|
||
sphinx: | ||
builder: "html" | ||
configuration: "docs/source/conf.py" | ||
fail_on_warning: false | ||
|
||
python: | ||
version: 3.7 | ||
install: | ||
- method: "pip" | ||
path: "." | ||
extra_requirements: | ||
- "docs" |
This file contains hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
diffsync.diff | ||
============= | ||
|
||
.. automodule:: diffsync.diff | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,7 @@ | ||
diffsync.enum | ||
============= | ||
|
||
.. automodule:: diffsync.enum | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,7 @@ | ||
diffsync.exceptions | ||
=================== | ||
|
||
.. automodule:: diffsync.exceptions | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,7 @@ | ||
diffsync.helpers | ||
================ | ||
|
||
.. automodule:: diffsync.helpers | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,7 @@ | ||
diffsync.logging | ||
================ | ||
|
||
.. automodule:: diffsync.logging | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,18 @@ | ||
API Reference | ||
============= | ||
|
||
.. automodule:: diffsync | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
diffsync.diff | ||
diffsync.enum | ||
diffsync.exceptions | ||
diffsync.helpers | ||
diffsync.logging | ||
diffsync.utils |
This file contains hidden or 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,7 @@ | ||
diffsync.utils | ||
============== | ||
|
||
.. automodule:: diffsync.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or 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,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(["-MTfe", "-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) |
This file contains hidden or 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,7 @@ | ||
**************************** | ||
Using Multiple Data Sources | ||
**************************** | ||
|
||
.. mdinclude:: ../../../examples/example1/README.md | ||
:start-line: 2 | ||
:end-line: 67 |
This file contains hidden or 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,7 @@ | ||
****************** | ||
Callback Function | ||
****************** | ||
|
||
.. mdinclude:: ../../../examples/example2/README.md | ||
:start-line: 2 | ||
:end-line: 44 |
This file contains hidden or 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,9 @@ | ||
############ | ||
Examples | ||
############ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
01-multiple-data-sources | ||
02-callback-function |
This file contains hidden or 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,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 |
This file contains hidden or 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,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` |
This file contains hidden or 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,5 @@ | ||
############ | ||
License | ||
############ | ||
|
||
.. mdinclude:: ../../../LICENSE |
This file contains hidden or 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,7 @@ | ||
********* | ||
Overview | ||
********* | ||
|
||
.. mdinclude:: ../../../README.md | ||
josh-silvas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:start-line: 2 | ||
:end-line: 25 |
This file contains hidden or 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,62 @@ | ||
body { | ||
font-family: 'Fira Sans', 'Noto Sans', 'Source Sans Pro', 'Segoe UI', Roboto, 'Lucida Sans Unicode', 'Lucida Grande', 'DejaVu Sans', sans-serif; | ||
} | ||
@media (min-width: 60em) { | ||
body { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
} | ||
#jschemer-nav { | ||
min-width: 15rem; | ||
padding: 1em; | ||
} | ||
.jschemer-schema { | ||
border: 0.05em solid #CCC; | ||
border-radius: 0.25em; | ||
margin: 0.5em; | ||
max-width: 60em; | ||
padding: 1em; | ||
} | ||
.jschemer-schema code, | ||
.jschemer-schema pre { | ||
background-color: rgba(27, 31, 35, 0.05); | ||
border-radius: 0.1em; | ||
font-size: 85%; | ||
line-height: 1.5; | ||
} | ||
.jschemer-schema pre { | ||
padding: 1em 0.5em; | ||
} | ||
.jschemer-schema code { | ||
display: inline; | ||
font-family: 'Fira Mono', 'Noto Mono', 'Source Code Pro', Consolas, 'Roboto Mono', 'Lucida Console', Monaco, 'DejaVu Sans Mono', monospace; | ||
font-size: 85%; | ||
line-height: inherit; | ||
padding: 0.2em 0.4em; | ||
word-wrap: normal; | ||
} | ||
.jschemer-schema pre > code { | ||
background-color: transparent; | ||
padding: 0; | ||
} | ||
.jschemer-schema h1 { | ||
display: inline; | ||
font-size: 1.5em; | ||
vertical-align: middle; | ||
} | ||
.jschemer-schema h1 code::before { | ||
content: '"'; | ||
} | ||
.jschemer-schema h1 code::after { | ||
content: '"'; | ||
} | ||
.jschemer-schema h2 { | ||
font-size: 1em; | ||
} | ||
main > .jschemer-schema > details > summary > h1 { | ||
font-size: 2em; | ||
} | ||
main ul { | ||
list-style: disc; | ||
} |
This file contains hidden or 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,13 @@ | ||
/* override table width restrictions */ | ||
@media screen and (min-width: 767px) { | ||
|
||
.wy-table-responsive table td { | ||
/* !important prevents the common CSS stylesheets from overriding | ||
this as on RTD they are loaded after this stylesheet */ | ||
white-space: normal !important; | ||
} | ||
|
||
.wy-table-responsive { | ||
overflow: visible !important; | ||
} | ||
} |
This file contains hidden or 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,9 @@ | ||
{%- if show_headings %} | ||
{{- basename | e | heading }} | ||
|
||
{% endif -%} | ||
.. automodule:: {{ qualname }} | ||
{%- for option in automodule_options %} | ||
:{{ option }}: | ||
{%- endfor %} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.