Skip to content

Commit

Permalink
docs: Move to gp-libs (our internal helpers for sphinx, #355)
Browse files Browse the repository at this point in the history
- Render changelog in [`linkify_issues`] 
- Fix Table of contents rendering with sphinx autodoc with [`sphinx_toctree_autodoc_fix`]
- Deprecate `sphinx-autoapi`, per above fixing the table of contents issue

  This also removes the need to workaround autoapi bugs.
- Test doctests in our docs via [`pytest_doctest_docutils`] (built on [`doctest_docutils`])

[`linkify_issues`]: https://gp-libs.git-pull.com/linkify_issues/
[`sphinx_toctree_autodoc_fix`]: https://gp-libs.git-pull.com/sphinx_toctree_autodoc_fix/
[`pytest_doctest_docutils`]: https://gp-libs.git-pull.com/doctest/pytest.html
[`doctest_docutils`]: https://gp-libs.git-pull.com/doctest
  • Loading branch information
tony authored Sep 11, 2022
2 parents 9fc840b + ad1821c commit 1c11885
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 27 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

### Documentation

- Move CHANGES to sphinx-autoissues, #350
- Render changelog in [`linkify_issues`] (~~#350~~, #355)
- Fix Table of contents rendering with sphinx autodoc with [`sphinx_toctree_autodoc_fix`] (#355)

[`linkify_issues`]: https://gp-libs.git-pull.com/linkify_issues/
[`sphinx_toctree_autodoc_fix`]: https://gp-libs.git-pull.com/sphinx_toctree_autodoc_fix/

## django-docutils 0.7.0 (2022-08-16)

Expand Down
8 changes: 6 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
## Code block

```{eval-rst}
.. autoclass:: django_docutils.directives.CodeBlock :members: :inherited-members: :private-members:
:show-inheritance: :member-order: bysource
.. autoclass:: django_docutils.directives.CodeBlock
:members:
:inherited-members:
:private-members:
:show-inheritance:
:member-order: bysource
```

## Exceptions
Expand Down
16 changes: 10 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"sphinx_autoissues",
"sphinx_click.ext", # sphinx-click
"sphinx_inline_tabs",
"sphinx_copybutton",
"sphinxext.opengraph",
"sphinxext.rediraffe",
"myst_parser",
"sphinx_toctree_autodoc_fix",
"linkify_issues",
]
myst_enable_extensions = [
"colon_fence",
"substitution",
"replacements",
"strikethrough",
]
myst_enable_extensions = ["colon_fence", "substitution", "replacements"]

templates_path = ["_templates"]

Expand Down Expand Up @@ -83,9 +89,8 @@
]
}

# sphinx-autoissues
issuetracker = "github"
issuetracker_project = about["__github__"].replace("https://github.com/", "")
# linkify_issues
issue_url_tpl = "https://github.com/tony/django-docutils/issues/{issue_id}"

# sphinxext.opengraph
ogp_site_url = about["__docs__"]
Expand All @@ -104,7 +109,6 @@
rediraffe_redirects = "redirects.txt"
rediraffe_branch = "master~1"


htmlhelp_basename = "%sdoc" % about["__title__"]

latex_documents = [
Expand Down
30 changes: 17 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ bitly-api-py3 = "*"
### Docs ###
sphinx = "*"
furo = "*"
gp-libs = "*"
sphinx-autobuild = "*"
sphinx-autodoc-typehints = "*"
sphinx-click = "*"
sphinx-inline-tabs = "*"
sphinxext-opengraph = "*"
sphinx-copybutton = "*"
sphinxext-rediraffe = "*"
sphinx-autoissues = "*"
myst_parser = "*"

### Testing ###
Expand Down Expand Up @@ -114,9 +114,9 @@ docs = [
"sphinx-copybutton",
"sphinxext-opengraph",
"sphinx-inline-tabs",
"sphinx-autoissues",
"myst_parser",
"furo",
"gp-libs",
]
test = [
"pytest",
Expand All @@ -137,11 +137,11 @@ lint = [
"mypy",
"django-stubs",
"types-docutils",
"types-pygments",
"types-pygments",
"types-six",
"types-requests",
"types-tqdm",
"lxml-stubs"
"lxml-stubs",
]

[tool.mypy]
Expand All @@ -160,7 +160,7 @@ module = [
"dirtyfields.*",
"django_extensions.*",
"django_slugify_processor.*",
"django_docutils.*"
"django_docutils.*",
]
ignore_missing_imports = true

Expand Down

0 comments on commit 1c11885

Please sign in to comment.