Skip to content
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

Add sphinx docs #12

Merged
merged 27 commits into from
Jun 21, 2019
Merged

Add sphinx docs #12

merged 27 commits into from
Jun 21, 2019

Conversation

c24t
Copy link
Member

@c24t c24t commented Jun 4, 2019

This PR adds sphinx boilerplate for generating API docs. Most files are generated with sphinx-quickstart and sphinx-apidoc with few changes.

This branch builds on #11, I'll rebase as it's updated.

You can build the html docs from this branch as:

pip install sphinx sphinx_autodoc_typehints sphinx_rtd_theme
sphinx-quickstart
sphinx-apidoc --force -e -o docs opentelemetry
(cd docs; make html)

I also pushed the generated html docs to the sphinx-docs-built branch, which you can check out to view the docs without building them yourself.

@c24t c24t added the meta Related to repo itself, process, community, ... label Jun 4, 2019
Copy link
Member

@Oberon00 Oberon00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the comment LGTM, but of course this can only be merged once the dependent #11 is merged.

---------------

.. automodule:: opentelemetry.api
:members:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these options seem to be the same everywhere, they should be added to the configuration https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options

@c24t
Copy link
Member Author

c24t commented Jun 20, 2019

Should we (1) document the constructor args in the class docstring as opencensus does or (2) whitelist __init__ and keep the docs there?

Option 1:

Screen Shot 2019-06-20 at 11 54 07 AM

and option 2:

Screen Shot 2019-06-20 at 11 54 42 AM

I have a slight preference for option 1, but option 2 is more explicit.

@c24t
Copy link
Member Author

c24t commented Jun 20, 2019

I updated the sphinx-docs-built branch, see the generated html docs there.

@c24t c24t requested a review from carlosalberto as a code owner June 21, 2019 19:25
@c24t
Copy link
Member Author

c24t commented Jun 21, 2019

I update the docs for the package move in #21 and removed a lot of the generated API doc boilerplate. After the package move autodoc generates empty docs for the new empty packages from #19, I removed these by hand.

I also moved the opentelemetry.trace module docs up to the top-level TOC with the expectation that we'll curate the TOC ourselves instead of leaving it up to autodoc. These changes mean we can't just run sphinx-apidoc and make html to generate the docs; we have to prune some generated files by hand.

Screen Shot 2019-06-21 at 12 27 05 PM

Screen Shot 2019-06-21 at 12 27 17 PM

@c24t c24t merged commit e7b5279 into open-telemetry:master Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to repo itself, process, community, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants