-
Notifications
You must be signed in to change notification settings - Fork 52
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
Adds docs for readthedocs #8
Conversation
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
asn/index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config for asn
? It lives in its own folder under source/netutils/asn
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like should there be an config/index
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally missed those. I added a general configs
tab. We could break it up how the code is with each file having its own tab under config. Let me know what you think and I can change it if need be.
Good stuff! We should add a test or two.
|
@itdependsnetworks I added a few tests. I'm not sure if they should live in the unit tests folder or not but they check the following,
There is a PR that would've allowed me to use the |
sourcedir (str, optional): Source directory for sphinx to use. Defaults to "source". | ||
builddir (str, optional): Output directory for sphinx to use. Defaults to "build". | ||
""" | ||
print("Building html documentation...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to call clean_docs here, just ensure it is done idempotently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
"build_dir": "docs/build/", | ||
} | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a start/end line test here? Something to ensure that the current start and end line remain the same throughout updates. This will ensure that if the readme is modified, that the tests will fail. If the start or end line change, they simply need to modify the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests to check for that. Let me know what you think.
docs/source/conf.py
Outdated
autodoc_default_options = { | ||
# "exclude-members": "__weakref__", | ||
# "ignore-module-all": , | ||
# "imported-members": , | ||
# "inherited-members": , | ||
"members": True, | ||
# "member-order": "bysource", | ||
# "private-members": , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to keep these?, being that they're just commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took them out. Good call. I believe Sphinx makes it that way when you start with it's template. Thanks Jeff.
tests/unit/test_docs.py
Outdated
assert "index.rst" in os.listdir(folder) | ||
|
||
|
||
def test_overview_section_start_end_lines(load_readme_into_lines): # pylint: disable=redefined-outer-name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just create a data structure, and a single test. Something like
[
{
"overview": {
"start-line": 10,
"start-val": "# netutils\n",
"end-line": 32,
"end-value": "* VLANs - Provide the ability to convert configuration into lists or lists into configuration.\n"
}
},
{
"attribution": {
"start-line": "NN",
"start-val": "TEXT",
"end-line": "NN",
"end-value": "TEXT"
}
}
]
Even better would be if you can dynamically find the line numbers, that are shown here, as an example:
:start-line: 131 :end-line: 178
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. I created an issue for parsing the start
and end
line so I can get that handled down the road.
This now dynamically pulls from the README for the respective section. Was also able to fix the decorated functions and use invoke instead of make. Now, in the
docs
folder you can you just runinvoke html
and it'll build your html files.Edit:
To create files locally.
invoke html
in project root.docs/build