Repository navigation
Add Sphinx documentation with auto-generated API reference #43
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
Hector Hernandez (hectorhdzg)
merged 3 commits into
microsoft:main
from
hectorhdzg:feature/sphinx-docs
Apr 20, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -10,5 +10,7 @@ build/ | |
| .env | ||
| .pytest_cache/ | ||
| .mypy_cache/ | ||
| docs/_build/ | ||
| docs/api/ | ||
| *.log | ||
| *_output.txt | ||
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,25 @@ | ||
| # Minimal makefile for Sphinx documentation | ||
| # | ||
|
|
||
| # You can set these variables from the command line, and also | ||
| # from the environment for the first two. | ||
| SPHINXOPTS ?= | ||
| SPHINXBUILD ?= sphinx-build | ||
| SPHINXAPIDOC ?= sphinx-apidoc | ||
| SOURCEDIR = . | ||
| BUILDDIR = _build | ||
| APIDOCDIR = api | ||
|
|
||
| # Put it first so that "make" without argument is like "make help". | ||
| help: | ||
| @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
|
||
| apidoc: | ||
| @$(SPHINXAPIDOC) -o "$(APIDOCDIR)" ../src/microsoft --force --module-first --separate | ||
|
|
||
| .PHONY: help apidoc Makefile | ||
|
|
||
| # Catch-all target: route all unknown targets to Sphinx using the new | ||
| # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
| %: Makefile apidoc | ||
| @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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,69 @@ | ||
| # Configuration file for the Sphinx documentation builder. | ||
| # | ||
| # For the full list of built-in configuration values, see the documentation: | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
|
||
| import os | ||
| import sys | ||
|
|
||
| # -- Path setup -------------------------------------------------------------- | ||
|
|
||
| # Add the src directory so autodoc can find the modules | ||
| sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) | ||
|
|
||
| # -- Project information ----------------------------------------------------- | ||
|
|
||
| project = "Microsoft OpenTelemetry Distro for Python" | ||
| copyright = "Microsoft Corporation" # pylint: disable=redefined-builtin | ||
| author = "Microsoft" | ||
|
|
||
| # -- General configuration --------------------------------------------------- | ||
|
|
||
| # Easy automatic cross-references for `code in backticks` | ||
| default_role = "any" | ||
|
|
||
| extensions = [ | ||
| # API doc generation | ||
| "sphinx.ext.autodoc", | ||
| # Support for google-style docstrings | ||
| "sphinx.ext.napoleon", | ||
| # Infer types from hints instead of docstrings | ||
| "sphinx_autodoc_typehints", | ||
| # Add links to source from generated docs | ||
| "sphinx.ext.viewcode", | ||
| # Link to other sphinx docs | ||
| "sphinx.ext.intersphinx", | ||
| # Add a .nojekyll file for GitHub Pages | ||
| "sphinx.ext.githubpages", | ||
| ] | ||
|
|
||
| intersphinx_mapping = { | ||
| "python": ("https://docs.python.org/3/", None), | ||
| "opentelemetry": ( | ||
| "https://opentelemetry-python.readthedocs.io/en/latest/", | ||
| None, | ||
| ), | ||
| } | ||
|
|
||
| templates_path = ["_templates"] | ||
|
|
||
| exclude_patterns = [ | ||
| "_build", | ||
| "Thumbs.db", | ||
| ".DS_Store", | ||
| ] | ||
|
|
||
| autodoc_default_options = { | ||
| "members": True, | ||
| "undoc-members": True, | ||
| "show-inheritance": True, | ||
| "member-order": "bysource", | ||
| } | ||
|
|
||
| # Napoleon configuration | ||
| napoleon_use_ivar = True | ||
|
|
||
| # -- Options for HTML output ------------------------------------------------- | ||
|
|
||
| html_theme = "sphinx_rtd_theme" | ||
| html_static_path = [] |
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 @@ | ||
| Microsoft OpenTelemetry Distro for Python | ||
| ========================================== | ||
|
|
||
| Welcome to the API reference for the Microsoft OpenTelemetry Distro for Python. | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 4 | ||
| :caption: API Reference | ||
|
|
||
| api/microsoft | ||
|
|
||
|
|
||
| Indices and tables | ||
| ================== | ||
|
|
||
| * :ref:`genindex` | ||
| * :ref:`modindex` | ||
| * :ref:`search` |
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,43 @@ | ||
| @ECHO OFF | ||
|
|
||
| pushd %~dp0 | ||
|
|
||
| REM Command file for Sphinx documentation | ||
|
|
||
| if "%SPHINXBUILD%" == "" ( | ||
| set SPHINXBUILD=sphinx-build | ||
| ) | ||
| set SOURCEDIR=. | ||
| set BUILDDIR=_build | ||
|
|
||
| %SPHINXBUILD% >NUL 2>NUL | ||
| if errorlevel 9009 ( | ||
| echo. | ||
| echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
| echo.installed, then set the SPHINXBUILD environment variable to point | ||
| echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
| echo.may add the Sphinx directory to PATH. | ||
| echo. | ||
| echo.If you don't have Sphinx installed, install it with: | ||
| echo. | ||
| echo. pip install sphinx | ||
| echo. | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| if "%SPHINXAPIDOC%" == "" ( | ||
| set SPHINXAPIDOC=sphinx-apidoc | ||
| ) | ||
|
|
||
| %SPHINXAPIDOC% -o api ..\src\microsoft --force --module-first --separate | ||
|
|
||
| if "%1" == "" goto help | ||
|
|
||
| %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
| goto end | ||
|
|
||
| :help | ||
| %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
|
||
| :end | ||
| popd | ||
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
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.