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 fix #137

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
# Use this for generating API docs
"sphinx.ext.autodoc",
# This can parse google style docstrings
"sphinxcontrib.autodoc_pydantic",
# Used for BaseModel autodoc
"sphinx.ext.napoleon",
# For linking to external sphinx documentation
"sphinx.ext.intersphinx",
Expand Down Expand Up @@ -84,6 +86,10 @@
("py:class", "starlette.responses.JSONResponse"),
]

# pydantic models
autodoc_pydantic_model_show_json = True
autodoc_pydantic_model_show_config_summary = False

# Both the class’ and the __init__ method’s docstring are concatenated and
# inserted into the main body of the autoclass directive
autoclass_content = "both"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dev = [
"pytest-cov",
"ruff",
"sphinx-autobuild",
"autodoc-pydantic",
"sphinx-copybutton",
"sphinx-design",
"sphinxcontrib-openapi",
Expand Down Expand Up @@ -106,7 +107,7 @@ commands =
pre-commit: pre-commit run --all-files {posargs}
type-checking: mypy src tests {posargs}
tests: pytest --cov=scanspec --cov-report term --cov-report xml:cov.xml {posargs}
docs: sphinx-{posargs:build -E --keep-going} -T docs build/html
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
"""

[tool.ruff]
Expand Down
Loading