pdoc 15.0.2__tar.gz → 15.0.4__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-15.0.2 → pdoc-15.0.4}/CHANGELOG.md +13 -1
- {pdoc-15.0.2/pdoc.egg-info → pdoc-15.0.4}/PKG-INFO +1 -1
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/__init__.py +1 -1
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/extract.py +1 -1
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/render_helpers.py +1 -1
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/content.css +22 -1
- pdoc-15.0.4/pdoc/templates/resources/exclamation-octagon-fill.svg +1 -0
- pdoc-15.0.4/pdoc/templates/resources/exclamation-square-fill.svg +1 -0
- pdoc-15.0.4/pdoc/templates/resources/lightbulb.svg +1 -0
- {pdoc-15.0.2 → pdoc-15.0.4/pdoc.egg-info}/PKG-INFO +1 -1
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc.egg-info/SOURCES.txt +3 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_extract.py +4 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_render_helpers.py +16 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/LICENSE +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/MANIFEST.in +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/README.md +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/__main__.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/_compat.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/doc.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/doc_ast.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/doc_pyi.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/doc_types.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/docstrings.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/markdown2/LICENSE +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/markdown2/README.md +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/markdown2/__init__.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/py.typed +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/render.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/search.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/README.md +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/build-search-index.js +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/custom.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/default/error.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/default/frame.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/default/index.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/default/module.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/README.md +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/bootstrap-reboot.min.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/box-arrow-in-left.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/elasticlunr.min.js +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/favicon.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/navtoggle.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/pdoc-logo.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/deprecated/resources/favicon.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/layout.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/livereload.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/math.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/mermaid.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/bootstrap-reboot.min.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/box-arrow-in-left.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/elasticlunr.min.js +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/exclamation-triangle-fill.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/info-circle-fill.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/lightning-fill.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/navtoggle.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/resources/pdoc-logo.svg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/search.html.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/search.js.jinja2 +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/syntax-highlighting.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/templates/theme.css +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc/web.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc.egg-info/dependency_links.txt +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc.egg-info/entry_points.txt +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc.egg-info/requires.txt +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pdoc.egg-info/top_level.txt +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/pyproject.toml +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/setup.cfg +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_doc.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_doc_ast.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_doc_pyi.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_doc_types.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_docstrings.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_main.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_search.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_smoke.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_snapshot.py +0 -0
- {pdoc-15.0.2 → pdoc-15.0.4}/test/test_web.py +0 -0
@@ -5,12 +5,24 @@
|
|
5
5
|
## Unreleased: pdoc next
|
6
6
|
|
7
7
|
|
8
|
+
## 2025-06-04: pdoc 15.0.4
|
9
|
+
|
10
|
+
- Include included HTML headers in the ToC by default by enabling markdown2's `mixed=True` option of the `header-ids` extra
|
11
|
+
(#806, @mrossinek)
|
12
|
+
- Make `pdoc .` work to document the module in the current directory.
|
13
|
+
([#813](https://github.com/mitmproxy/pdoc/pull/813), @mhils)
|
14
|
+
|
15
|
+
## 2025-04-21: pdoc 15.0.3
|
16
|
+
|
17
|
+
- Add missing styles for Github's markdown alerts.
|
18
|
+
([#796](https://github.com/mitmproxy/pdoc/pull/796), @Steve-Tech)
|
19
|
+
|
8
20
|
## 2025-04-17: pdoc 15.0.2
|
9
21
|
|
10
22
|
- Fix a bug where type aliases wouldn't be linked.
|
11
23
|
([#798](https://github.com/mitmproxy/pdoc/pull/798), @mhils)
|
12
24
|
- Fix a bug where invalid Numpydoc docstrings would raise an exception.
|
13
|
-
([#789](https://github.com/mitmproxy/pdoc/pull/789), @mhils)
|
25
|
+
([#789](https://github.com/mitmproxy/pdoc/pull/789), @tobiscode, @mhils)
|
14
26
|
- Improve debuggability of docstring processing
|
15
27
|
([#784](https://github.com/mitmproxy/pdoc/pull/784), @tobiscode)
|
16
28
|
- Fix handling of URL-escaped module names
|
@@ -481,7 +481,7 @@ You can find an example in [`examples/library-usage`](https://github.com/mitmpro
|
|
481
481
|
from __future__ import annotations
|
482
482
|
|
483
483
|
__docformat__ = "markdown" # explicitly disable rST processing in the examples above.
|
484
|
-
__version__ = "15.0.
|
484
|
+
__version__ = "15.0.4" # this is read from setup.py
|
485
485
|
|
486
486
|
from pathlib import Path
|
487
487
|
from typing import overload
|
@@ -112,7 +112,7 @@ def parse_spec(spec: Path | str) -> str:
|
|
112
112
|
raise ModuleNotFoundError
|
113
113
|
except pdoc.docstrings.AnyException:
|
114
114
|
# Module does not exist, use local file.
|
115
|
-
spec = pspec
|
115
|
+
spec = pspec.resolve()
|
116
116
|
else:
|
117
117
|
# Module does exist. We now check if the local file/directory is the same (e.g. after pip install -e),
|
118
118
|
# and emit a warning if that's not the case.
|
@@ -61,7 +61,7 @@ markdown_extensions = {
|
|
61
61
|
"cuddled-lists": None,
|
62
62
|
"fenced-code-blocks": {"cssclass": formatter.cssclass},
|
63
63
|
"footnotes": None,
|
64
|
-
"header-ids": None,
|
64
|
+
"header-ids": {"mixed": True, "prefix": None, "reset-count": True},
|
65
65
|
"link-patterns": None,
|
66
66
|
"markdown-in-html": None,
|
67
67
|
"mermaid": None,
|
@@ -45,13 +45,27 @@ This makes sure that the pdoc styling doesn't leak to the rest of the page when
|
|
45
45
|
}
|
46
46
|
|
47
47
|
/* Admonitions are currently not stylable via theme.css */
|
48
|
-
.pdoc .alert.note
|
48
|
+
.pdoc .alert.note {
|
49
49
|
color: #084298;
|
50
50
|
background-color: #cfe2ff;
|
51
51
|
border-color: #b6d4fe;
|
52
52
|
background-image: url("data:image/svg+xml,{% filter urlencode %}{% include 'resources/info-circle-fill.svg' %}{% endfilter %}");
|
53
53
|
}
|
54
54
|
|
55
|
+
.pdoc .alert.tip {
|
56
|
+
color: #0a3622;
|
57
|
+
background-color: #d1e7dd;
|
58
|
+
border-color: #a3cfbb;
|
59
|
+
background-image: url("data:image/svg+xml,{% filter urlencode %}{% include 'resources/lightbulb.svg' %}{% endfilter %}");
|
60
|
+
}
|
61
|
+
|
62
|
+
.pdoc .alert.important {
|
63
|
+
color: #055160;
|
64
|
+
background-color: #cff4fc;
|
65
|
+
border-color: #9eeaf9;
|
66
|
+
background-image: url("data:image/svg+xml,{% filter urlencode %}{% include 'resources/exclamation-square-fill.svg' %}{% endfilter %}");
|
67
|
+
}
|
68
|
+
|
55
69
|
.pdoc .alert.warning {
|
56
70
|
color: #664d03;
|
57
71
|
background-color: #fff3cd;
|
@@ -59,6 +73,13 @@ This makes sure that the pdoc styling doesn't leak to the rest of the page when
|
|
59
73
|
background-image: url("data:image/svg+xml,{% filter urlencode %}{% include 'resources/exclamation-triangle-fill.svg' %}{% endfilter %}");
|
60
74
|
}
|
61
75
|
|
76
|
+
.pdoc .alert.caution {
|
77
|
+
color: #842029;
|
78
|
+
background-color: #f8d7da;
|
79
|
+
border-color: #f5c2c7;
|
80
|
+
background-image: url("data:image/svg+xml,{% filter urlencode %}{% include 'resources/exclamation-octagon-fill.svg' %}{% endfilter %}");
|
81
|
+
}
|
82
|
+
|
62
83
|
.pdoc .alert.danger {
|
63
84
|
color: #842029;
|
64
85
|
background-color: #f8d7da;
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#842029" viewBox="0 0 16 16"><path d="M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#055160" viewBox="0 0 16 16"><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm6 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#0a3622" viewBox="0 0 16 16"><path d="M2 6a6 6 0 1 1 10.174 4.31c-.203.196-.359.4-.453.619l-.762 1.769A.5.5 0 0 1 10.5 13a.5.5 0 0 1 0 1 .5.5 0 0 1 0 1l-.224.447a1 1 0 0 1-.894.553H6.618a1 1 0 0 1-.894-.553L5.5 15a.5.5 0 0 1 0-1 .5.5 0 0 1 0-1 .5.5 0 0 1-.46-.302l-.761-1.77a2 2 0 0 0-.453-.618A5.98 5.98 0 0 1 2 6m6-5a5 5 0 0 0-3.479 8.592c.263.254.514.564.676.941L5.83 12h4.342l.632-1.467c.162-.377.413-.687.676-.941A5 5 0 0 0 8 1"/></svg>
|
@@ -53,8 +53,11 @@ pdoc/templates/deprecated/resources/favicon.svg
|
|
53
53
|
pdoc/templates/resources/bootstrap-reboot.min.css
|
54
54
|
pdoc/templates/resources/box-arrow-in-left.svg
|
55
55
|
pdoc/templates/resources/elasticlunr.min.js
|
56
|
+
pdoc/templates/resources/exclamation-octagon-fill.svg
|
57
|
+
pdoc/templates/resources/exclamation-square-fill.svg
|
56
58
|
pdoc/templates/resources/exclamation-triangle-fill.svg
|
57
59
|
pdoc/templates/resources/info-circle-fill.svg
|
60
|
+
pdoc/templates/resources/lightbulb.svg
|
58
61
|
pdoc/templates/resources/lightning-fill.svg
|
59
62
|
pdoc/templates/resources/navtoggle.svg
|
60
63
|
pdoc/templates/resources/pdoc-logo.svg
|
@@ -100,6 +100,10 @@ def test_parse_spec(monkeypatch):
|
|
100
100
|
assert str(here / "testdata") in sys.path
|
101
101
|
sys.path = p
|
102
102
|
|
103
|
+
monkeypatch.chdir(here / "testdata" / "demopackage" / "subpackage")
|
104
|
+
assert parse_spec(".") == "demopackage.subpackage"
|
105
|
+
assert parse_spec("..") == "demopackage"
|
106
|
+
|
103
107
|
|
104
108
|
def test_parse_spec_mod_and_dir(tmp_path, monkeypatch):
|
105
109
|
"""Test that we display a warning when both a module and a local directory exist with the provided name."""
|
@@ -110,6 +110,22 @@ def test_markdown_toc():
|
|
110
110
|
assert to_html("#foo\n#bar").toc_html # type: ignore
|
111
111
|
|
112
112
|
|
113
|
+
def test_mixed_toc():
|
114
|
+
"""
|
115
|
+
markdown2 can handle mixed markdown and HTML headings.
|
116
|
+
|
117
|
+
Let's test that this works as expected.
|
118
|
+
"""
|
119
|
+
expected = [
|
120
|
+
"<ul>",
|
121
|
+
' <li><a href="#foo">foo</a></li>',
|
122
|
+
' <li><a href="#bar">bar</a></li>',
|
123
|
+
"</ul>",
|
124
|
+
"",
|
125
|
+
]
|
126
|
+
assert to_html("#foo\n<h1>bar</h1>").toc_html == "\n".join(expected)
|
127
|
+
|
128
|
+
|
113
129
|
@pytest.mark.parametrize(
|
114
130
|
"md,html",
|
115
131
|
[
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|