pdoc 14.5.0__tar.gz → 14.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pdoc-14.5.0 → pdoc-14.6.0}/CHANGELOG.md +22 -0
- pdoc-14.6.0/LICENSE +5 -0
- {pdoc-14.5.0/pdoc.egg-info → pdoc-14.6.0}/PKG-INFO +2 -2
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/__init__.py +7 -1
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/__main__.py +2 -2
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/doc.py +23 -8
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/docstrings.py +1 -1
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/extract.py +1 -1
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/markdown2/__init__.py +1667 -765
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/render_helpers.py +76 -38
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/content.css +10 -6
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/math.html.jinja2 +0 -1
- {pdoc-14.5.0 → pdoc-14.6.0/pdoc.egg-info}/PKG-INFO +2 -2
- {pdoc-14.5.0 → pdoc-14.6.0}/pyproject.toml +5 -6
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_extract.py +3 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_render_helpers.py +13 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_snapshot.py +1 -0
- pdoc-14.5.0/LICENSE +0 -24
- {pdoc-14.5.0 → pdoc-14.6.0}/MANIFEST.in +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/README.md +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/_compat.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/doc_ast.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/doc_pyi.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/doc_types.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/markdown2/LICENSE +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/markdown2/README.md +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/py.typed +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/render.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/search.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/README.md +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/build-search-index.js +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/custom.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/default/error.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/default/frame.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/default/index.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/default/module.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/README.md +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/bootstrap-reboot.min.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/box-arrow-in-left.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/elasticlunr.min.js +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/favicon.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/navtoggle.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/pdoc-logo.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/deprecated/resources/favicon.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/layout.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/livereload.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/mermaid.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/bootstrap-reboot.min.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/box-arrow-in-left.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/elasticlunr.min.js +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/exclamation-triangle-fill.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/info-circle-fill.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/lightning-fill.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/navtoggle.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/resources/pdoc-logo.svg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/search.html.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/search.js.jinja2 +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/syntax-highlighting.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/templates/theme.css +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc/web.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc.egg-info/SOURCES.txt +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc.egg-info/dependency_links.txt +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc.egg-info/entry_points.txt +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc.egg-info/requires.txt +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/pdoc.egg-info/top_level.txt +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/setup.cfg +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_doc.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_doc_ast.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_doc_pyi.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_doc_types.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_docstrings.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_main.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_search.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_smoke.py +0 -0
- {pdoc-14.5.0 → pdoc-14.6.0}/test/test_web.py +0 -0
@@ -4,6 +4,28 @@
|
|
4
4
|
|
5
5
|
## Unreleased: pdoc next
|
6
6
|
|
7
|
+
## 2024-07-24: pdoc 14.6.0
|
8
|
+
|
9
|
+
- If `example.data.Data` is also exposed as `example.Data`, pdoc now links to `example.Data` in documentation.
|
10
|
+
([#670](https://github.com/mitmproxy/pdoc/pull/670), @nathanthorpe, @mhils)
|
11
|
+
- Add support for [GitHub Markdown Alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts).
|
12
|
+
([#718](https://github.com/mitmproxy/pdoc/pull/718), @mhils)
|
13
|
+
- Improve rendering of enums on Python 3.12+.
|
14
|
+
([#708](https://github.com/mitmproxy/pdoc/pull/708), @mhils)
|
15
|
+
- Fix a bug where hyperlinks would get parsed as docstring references.
|
16
|
+
([#709](https://github.com/mitmproxy/pdoc/pull/709), @mhils)
|
17
|
+
- Fix a TypeError when trying to parse modules that implement `__dir__` incorrectly.
|
18
|
+
([#710](https://github.com/mitmproxy/pdoc/pull/710), @mhils)
|
19
|
+
- Fix a bug where a combination of `@dataclass` and `ctypes.Structure` would crash pdoc.
|
20
|
+
([#711](https://github.com/mitmproxy/pdoc/pull/711), @mhils)
|
21
|
+
- Update bundled version of markdown2.
|
22
|
+
([#717](https://github.com/mitmproxy/pdoc/pull/717), @mhils)
|
23
|
+
|
24
|
+
## 2024-06-25: pdoc 14.5.1
|
25
|
+
|
26
|
+
- **[CVE-2024-38526](https://github.com/mitmproxy/pdoc/security/advisories/GHSA-5vgj-ggm4-fg62):** Documentation generated with math mode (`pdoc --math`) does not include scripts
|
27
|
+
from polyfill.io anymore. Users who produce documentation with math mode should update immediately. All other users are unaffected.
|
28
|
+
([#703](https://github.com/mitmproxy/pdoc/pull/703), @adhintz)
|
7
29
|
|
8
30
|
## 2024-05-16: pdoc 14.5.0
|
9
31
|
|
pdoc-14.6.0/LICENSE
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
Copyright 2024 Maximilian Hils
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
|
4
|
+
|
5
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pdoc
|
3
|
-
Version: 14.
|
3
|
+
Version: 14.6.0
|
4
4
|
Summary: API Documentation for Python Projects
|
5
5
|
Author-email: Maximilian Hils <pdoc@maximilianhils.com>
|
6
|
-
License:
|
6
|
+
License: MIT-0
|
7
7
|
Project-URL: Homepage, https://pdoc.dev
|
8
8
|
Project-URL: Source, https://github.com/mitmproxy/pdoc/
|
9
9
|
Project-URL: Documentation, https://pdoc.dev/docs/pdoc.html
|
@@ -194,11 +194,17 @@ In general, we recommend keeping the following conventions:
|
|
194
194
|
- If you want to document a special `__dunder__` method, the recommended way to do so is
|
195
195
|
to not document the dunder method specifically, but to add some usage examples in the class documentation.
|
196
196
|
|
197
|
+
> [!NOTE]
|
198
|
+
> Hiding an item only removes it from documentation.
|
199
|
+
> It is still displayed in the source code when clicking the "View Source" button.
|
200
|
+
|
197
201
|
As a last resort, you can override pdoc's behavior with a custom module template (see
|
198
202
|
[*How can I edit pdoc's HTML template?*](#edit-pdocs-html-template)).
|
199
203
|
You can find an example at
|
200
204
|
[`examples/custom-template/module.html.jinja2`](https://github.com/mitmproxy/pdoc/blob/main/examples/custom-template/module.html.jinja2).
|
201
205
|
|
206
|
+
Hiding an item only removes it from documentation. It is still displayed in the source code when clicking the "View Source" button.
|
207
|
+
|
202
208
|
## ...exclude submodules from being documented?
|
203
209
|
|
204
210
|
If you would like to exclude specific submodules from the documentation, the recommended way is to specify `__all__` as
|
@@ -475,7 +481,7 @@ You can find an example in [`examples/library-usage`](https://github.com/mitmpro
|
|
475
481
|
from __future__ import annotations
|
476
482
|
|
477
483
|
__docformat__ = "markdown" # explicitly disable rST processing in the examples above.
|
478
|
-
__version__ = "14.
|
484
|
+
__version__ = "14.6.0" # this is read from setup.py
|
479
485
|
|
480
486
|
from pathlib import Path
|
481
487
|
from typing import overload
|
@@ -265,12 +265,12 @@ def get_dev_version() -> str:
|
|
265
265
|
|
266
266
|
def _nicer_showwarning(message, category, filename, lineno, file=None, line=None):
|
267
267
|
"""A replacement for `warnings.showwarning` that renders warnings in a more visually pleasing way."""
|
268
|
-
if category
|
268
|
+
if category is UserWarning:
|
269
269
|
print(
|
270
270
|
f"{yellow}Warn:{default} {message} {gray}({filename}:{lineno}){default}",
|
271
271
|
file=sys.stderr,
|
272
272
|
)
|
273
|
-
elif category
|
273
|
+
elif category is RuntimeWarning:
|
274
274
|
print(
|
275
275
|
f"{yellow}Warn:{default} {message}",
|
276
276
|
file=sys.stderr,
|
@@ -587,15 +587,21 @@ class Class(Namespace[type]):
|
|
587
587
|
if doc == dict.__doc__:
|
588
588
|
# Don't display default docstring for dict subclasses (primarily TypedDict).
|
589
589
|
return ""
|
590
|
-
|
591
|
-
|
592
|
-
# from https://github.com/python/cpython/blob/3.10/Lib/dataclasses.py
|
593
|
-
and doc
|
594
|
-
== self.obj.__name__
|
595
|
-
+ str(inspect.signature(self.obj)).replace(" -> None", "")
|
596
|
-
)
|
597
|
-
if is_dataclass_with_default_docstring:
|
590
|
+
if doc in _Enum_default_docstrings:
|
591
|
+
# Don't display default docstring for enum subclasses.
|
598
592
|
return ""
|
593
|
+
if dataclasses.is_dataclass(self.obj) and doc.startswith(self.obj.__name__):
|
594
|
+
try:
|
595
|
+
sig = inspect.signature(self.obj)
|
596
|
+
except Exception:
|
597
|
+
pass
|
598
|
+
else:
|
599
|
+
# from https://github.com/python/cpython/blob/3.10/Lib/dataclasses.py
|
600
|
+
is_dataclass_with_default_docstring = doc == self.obj.__name__ + str(
|
601
|
+
sig
|
602
|
+
).replace(" -> None", "")
|
603
|
+
if is_dataclass_with_default_docstring:
|
604
|
+
return ""
|
599
605
|
return doc
|
600
606
|
|
601
607
|
@cached_property
|
@@ -1306,6 +1312,15 @@ def _safe_getdoc(obj: Any) -> str:
|
|
1306
1312
|
return doc.strip()
|
1307
1313
|
|
1308
1314
|
|
1315
|
+
_Enum_default_docstrings = tuple(
|
1316
|
+
{
|
1317
|
+
_safe_getdoc(enum.Enum),
|
1318
|
+
_safe_getdoc(enum.IntEnum),
|
1319
|
+
_safe_getdoc(_safe_getattr(enum, "StrEnum", enum.Enum)),
|
1320
|
+
}
|
1321
|
+
)
|
1322
|
+
|
1323
|
+
|
1309
1324
|
def _remove_memory_addresses(x: str) -> str:
|
1310
1325
|
"""Remove memory addresses from repr() output"""
|
1311
1326
|
return re.sub(r" at 0x[0-9a-fA-F]+(?=>)", "", x)
|
@@ -427,7 +427,7 @@ def _rst_admonitions(contents: str, source_file: Path | None) -> str:
|
|
427
427
|
else:
|
428
428
|
heading = ""
|
429
429
|
return (
|
430
|
-
f'{ind}<div class="
|
430
|
+
f'{ind}<div class="alert {type}" markdown="1">\n'
|
431
431
|
f"{heading}"
|
432
432
|
f"{indent(contents, ind)}\n"
|
433
433
|
f"{ind}</div>\n"
|
@@ -253,7 +253,7 @@ def iter_modules2(module: types.ModuleType) -> dict[str, pkgutil.ModuleInfo]:
|
|
253
253
|
# This is a hacky workaround to register them.
|
254
254
|
members = dir(module) if mod_all is None else mod_all
|
255
255
|
for name in members:
|
256
|
-
if name in submodules or name == "__main__":
|
256
|
+
if name in submodules or name == "__main__" or not isinstance(name, str):
|
257
257
|
continue
|
258
258
|
member = getattr(module, name, None)
|
259
259
|
is_wild_child_module = (
|