Commit Graph

198 Commits

Author SHA1 Message Date
Ashley Whetter
bc71226c3b Render PEP-695 type aliases as TypeAlias assignments
Partially addresses #414
2024-04-01 22:24:36 -07:00
Ashley Whetter
007077a7db Refactor mapper classes into their bases
This separate used to exist to support parsing multiple languages,
which we no longer do.
2024-03-25 21:14:35 -07:00
Ashley Whetter
a6558dcfc2 Various fixes for own page output
Also added tests for own page output.
Fix some inherited members always being rendered.
Own page members of an entity are linked to after the docstring
of the parent entity.
Fix entities below the "class" level that have their own page
from rendering incorrectly.
Rename "single page output" to "own page output". An entity does
not have a "single page" when its members are spread across
their own pages.
Properties are linked to on their parent classes page.
Children not present in `__all__` are not rendered.
Fixed emitting ignore event twice for methods.
Corrected documentation around `imported-members` to reflect that it
applies only to objects imported into a package, not modules.
Fixed path error on Windows.
2024-03-25 19:49:37 -07:00
Jorge Martinez
2a603b8ac0 Recursive rendering of children with their own page 2024-03-25 19:46:23 -07:00
Ashley Whetter
93fb571a7e Basic tests for single page rendering 2024-03-25 19:46:23 -07:00
George Zhang
0d69974c19 Preserve strings inside Literal type annotations 2024-03-25 19:30:27 -07:00
Ashley Whetter
c4db7eb14a Fix IndexError when a module docstring contains only a heading 2024-02-18 21:17:06 -08:00
laggykiller
823c146b3a Correct handling of __init__.pyi
Closes #405
2024-02-18 16:01:48 -08:00
Ashley Whetter
bbb50f68ae Reformatted to latest stable black style 2024-02-18 15:57:31 -08:00
Ashley Whetter
a22ae9262a Removed support for documenting languages other than Python
For the reasons why, see #248
2023-07-08 10:35:38 -07:00
Ashley Whetter
38a615ff74 Types used in PEP-604 union syntax can be linked with intersphinx
Closes #366
2023-06-10 10:07:20 -07:00
Ashley Whetter
7fa3998438 Fix separated type comments for arguments not merging correctly in Python 3.7 2023-05-30 20:33:59 -07:00
Ashley Whetter
434ef8305a Tests build HTML and parse it to validate structure 2023-05-30 18:59:20 -07:00
Ashley Whetter
0a557fc95e Replaced usage of unidecode with anyascii to fix license incompatibilities
Closes #382
2023-05-22 10:10:05 -07:00
Ashley Whetter
1715dfe0b5 Fix "document isn't included" warning when using autoapi_add_toctree_entry
Closes #319
2023-04-10 16:49:21 -07:00
Ashley Whetter
8ffcd0fd67 Corrected formatting 2023-04-07 10:45:55 -07:00
Marco Sirabella
b4687e6ddc Fix conditional depending on sphinx version 2023-04-07 10:31:26 -07:00
Brandon Wiebe
6b16e02de4
Let Sphinx handle adding domain directives to the toctree (#374)
* Remove ability to add domains to the toctree

* Add towncrier news fragment
2023-03-28 09:13:28 -07:00
Ashley Whetter
58d653e557 Added basic type checking 2023-03-22 22:33:11 -07:00
Ashley Whetter
03aefdf446 Fix more tests 2023-01-16 21:29:00 -08:00
Ashley Whetter
384966090e Fix more tests 2023-01-16 21:26:18 -08:00
Ashley Whetter
3f8730aadd Fix tests 2023-01-16 21:14:38 -08:00
davfsa
1556b17ca8
Use the correct directives for a variable type and value (#353)
* Use the correct directives for a variable type and value

Co-authored-by: PerchunPak <perchunpak@gmail.com>

* Improve multiline value

* Add colons for strings

* Add another testcase

Co-authored-by: PerchunPak <perchunpak@gmail.com>
2023-01-04 20:35:40 -08:00
Ash Berlin-Taylor
d732b49fd5
Don't force member sort order to alphabetic (#362)
* Don't force member sort order to alphabetic

sphinx.ext.autodoc has a `sort_member` function[1] that will sort the object
members for us -- by removing the `sorted` call ourselves we allow the
"bysource" mode to work (with the `sorted` call, since we don't set
`self.analyzer` no extra sorting happens.)

The default sort mode for autodoc is alphabetical, so this should result in no
changes to docs by default

[1]: 9844162473/sphinx/ext/autodoc/__init__.py (L816-L836)
2023-01-04 20:33:25 -08:00
Ashley Whetter
94295a48cd Don't document module level class attribute assignments
Fixes #341
2022-10-23 15:13:53 -07:00
Ashley Whetter
6af1ca718a Remove some autogenerated test data 2022-10-23 14:12:22 -07:00
Ashley Whetter
847b6e5626 Correctly render tuples as tuples, not lists
Fixes #330
2022-10-23 14:09:48 -07:00
Ashley Whetter
a23e2ffe73 Render Python properties with the property directive
Fixes #352.
2022-09-27 15:57:44 -07:00
Bruno P. Kinoshita
c9edd8d1c6
Minor fixes (typos, http->https in links, types) (#348)
* Avoid http->https redirect, use https where possible

* Add autoapi_template_dir to existing array instead of re-declaring

* Typos

* Sphinx util uses int for verbosity in status_iterator

* Sphinx utils uses tuples for TypeField arguments
2022-09-27 12:18:48 -07:00
Jeff Epler
0ac4dc5389 Fix kw-only marker getting ignored if first in the signature (#340)
Closes: #328
2022-07-25 11:46:30 -07:00
Kian-Meng Ang
075736619f
Fix typos (#331) 2022-07-25 11:34:17 -07:00
Nathan Glenn
432b9af5d5
Fix keyerror when using markdown sources (#321)
Setting `source_suffix = ".md"` led to the following cryptic error output:

    Handler <function run_autoapi at 0x10841fc10> for event 'builder-inited' threw an exception (exception: 0)

This issue was that `app.config.source_suffix` is an `OrderedDict` object, which cannot be subscripted
using `[0]`, etc. Instead, use `next(iter(...))` to get the first element of the dictionary.
2022-07-25 11:32:11 -07:00
Zachary Moon
185876a047
Limit signatures to 60 characters in summaries (#311) 2022-07-25 10:30:57 -07:00
Mathieu Bouzard
fc6b8aec77
Fix comment typehints for methods/classmethods (#300)
* Fix comment typehints for methods and classmethods

Co-authored-by: Mathieu <923463-mathbou@users.noreply.gitlab.com>
2022-07-25 10:27:03 -07:00
Ashley Whetter
cd4e1fa59f Fixed tests in Sphinx 5 2022-07-25 10:20:51 -07:00
Ashley Whetter
6028cb104c Fail elegantly when no source files are found
Fixes #324
2022-02-08 21:44:16 -08:00
Ashley Whetter
685d1d34c8 Updated to latest black formatting 2022-02-08 19:37:55 -08:00
Ashley Whetter
38c2089476 Removed prepare_docstring filter used for testing 2021-07-31 18:25:25 -07:00
Ashley Whetter
7d7f042805 Fixed possible incorrect indentation in generated documentation.
Closes #299.
2021-07-31 18:06:12 -07:00
Ashley Whetter
2c5c87157a Explicitly use the domain for generated directives
Closes #292
2021-06-27 17:25:36 -07:00
Ashley Whetter
17ffa2d1b6 Fixed failure to build out of source conf.py files
Closes #293
2021-06-25 20:14:33 -07:00
Ashley Whetter
08e61b93ef Fixed displaying "self" in class signatures 2021-06-25 19:30:54 -07:00
Ashley Whetter
5faec73073 Fixed error when parsing a class with no constructor 2021-06-21 23:10:52 -07:00
Ashley Whetter
613eff53a7 Fixed type annotations being shown for only a single module
Closes #273
2021-04-24 19:43:39 -07:00
Ashley Whetter
86a6d1059c Refactored dotnet error to raise an exception properly 2021-04-12 20:32:37 -07:00
Ashley Whetter
826bb2badd Converted tests to pytest style 2021-04-03 19:01:27 -07:00
Ashley Whetter
bf8f50dc97 Fixed type hints still showing when setting autodoc_typehints
Closes #273
2021-04-02 20:08:34 -07:00
Ashley Whetter
643fed0ccd Can resolve the qualified paths of parameters to generics
Closes #265
2021-03-19 23:11:52 -07:00
Joseph Yu
5435536988 Multiline string are displayed correctly 2021-03-19 22:03:04 -07:00
Joseph Yu
b9a6fcd350 Minor internal test warnings fixes 2021-03-19 21:56:04 -07:00