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

docs: Enable githubpages, intersphinx, and type hints #430

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/Publish_NIMS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ jobs:
- name: Update API Reference Documents(Generated using Sphinx)
run: |
rm -rf docs
mkdir -p docs
touch docs/.nojekyll
mkdir -p docs
poetry run sphinx-build _docs_source docs -b html

- name: Commit file changes.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/check_nims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
- name: Build docs and check for errors/warnings
run: |
rm -rf docs
mkdir -p docs
touch docs/.nojekyll
mkdir -p docs
poetry run sphinx-build _docs_source docs -b html -W --keep-going
- name: Revert docs
run: git clean -dfx docs/ && git restore docs/
24 changes: 19 additions & 5 deletions _docs_source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"autoapi.extension",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_click",
"m2r2",
"sphinx_click",
"sphinx.ext.autodoc",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

root_path = pathlib.Path(__file__).parent.parent
Expand Down Expand Up @@ -45,7 +47,7 @@
autoapi_options.remove("private-members") # note: remove this to include "_" members in docs
autoapi_dirs = [root_path / "ni_measurementlink_service"]
autoapi_type = "python"
autodoc_typehints = "none"
autodoc_typehints = "description"


# WARNING: more than one target found for cross-reference 'MeasurementInfo':
Expand Down Expand Up @@ -76,6 +78,18 @@ def setup(sphinx):
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


intersphinx_mapping = {
"nidaqmx": ("https://nidaqmx-python.readthedocs.io/en/stable/", None),
"nidcpower": ("https://nidcpower.readthedocs.io/en/stable/", None),
"nidigital": ("https://nidigital.readthedocs.io/en/stable/", None),
"nidmm": ("https://nidmm.readthedocs.io/en/stable/", None),
"nifgen": ("https://nifgen.readthedocs.io/en/stable/", None),
"niscope": ("https://niscope.readthedocs.io/en/stable/", None),
"niswitch": ("https://niswitch.readthedocs.io/en/stable/", None),
"python": ("https://docs.python.org/3", None),
}


# -- Options for HTML output ----------------------------------------------


Expand Down
Loading