Skip to content
Open
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
8 changes: 7 additions & 1 deletion .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yaml'
- 'noxfile.py'
- 'setup.py'
- 'respx/__init__.py'
- 'respx/router.py'
- 'scripts/check_docs_inventory.py'
- '.github/workflows/check-docs.yml'

jobs:
Expand All @@ -17,4 +23,4 @@ jobs:
python-version: "3.10"
- run: pip install nox
- name: Build
run: nox -N -s docs
run: nox -N -s docs_test
10 changes: 8 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ on:
- master
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- 'mkdocs.yaml'
- 'noxfile.py'
- 'setup.py'
- 'respx/__init__.py'
- 'respx/router.py'
- 'scripts/check_docs_inventory.py'
- '.github/workflows/publish-docs.yml'

jobs:
build:
Expand All @@ -19,7 +25,7 @@ jobs:
python-version: "3.10"
- run: pip install nox
- name: Build
run: nox -N -s docs
run: nox -N -s docs_test
- name: Publish
if: github.repository_owner == 'lundberg'
run: |
Expand Down
17 changes: 17 additions & 0 deletions docs/objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# API Objects

::: respx.Router
options:
members: false
show_if_no_docstring: true
show_root_full_path: false
show_root_heading: true
show_source: false

::: respx.MockRouter
options:
members: false
show_if_no_docstring: true
show_root_full_path: false
show_root_heading: true
show_source: false
9 changes: 8 additions & 1 deletion mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ nav:
- Mock HTTPX: "versions/0.14.0/mocking.md"
- Developer Interface: "versions/0.14.0/api.md"

not_in_nav: |
/objects.md

plugins:
- search
- mkdocstrings:
enable_inventory: true

markdown_extensions:
- admonition
- codehilite:
css_class: highlight
- mkautodoc
11 changes: 10 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ def mypy(session):

@nox.session(python="3.10")
def docs(session):
deps = ["mkdocs", "mkdocs-material", "mkautodoc>=0.1.0"]
deps = [
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]>=1.0",
]
session.install("--upgrade", *deps)
session.install("-e", ".")
args = session.posargs if session.posargs else ["build"]
session.run("mkdocs", *args)


@nox.session(python="3.10", requires=["docs"])
def docs_test(session):
session.run("python", "scripts/check_docs_inventory.py")