Skip to content

Commit 583ac1e

Browse files
committed
chore: Template upgrade
1 parent cf81358 commit 583ac1e

File tree

7 files changed

+64
-53
lines changed

7 files changed

+64
-53
lines changed

.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier.
2-
_commit: 1.7.1
2+
_commit: 1.8.2
33
_src_path: gh:pawamoy/copier-uv
44
author_email: dev@pawamoy.fr
55
author_fullname: Timothée Mazzucotelli

docs/css/mkdocstrings.css

+46-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,49 @@ a.autorefs-external::after {
2424
a.external:hover::after,
2525
a.autorefs-external:hover::after {
2626
background-color: var(--md-accent-fg-color);
27-
}
27+
}
28+
29+
/* Tree-like output for backlinks. */
30+
.doc-backlink-list {
31+
--tree-clr: var(--md-default-fg-color);
32+
--tree-font-size: 1rem;
33+
--tree-item-height: 1;
34+
--tree-offset: 1rem;
35+
--tree-thickness: 1px;
36+
--tree-style: solid;
37+
display: grid;
38+
list-style: none !important;
39+
}
40+
41+
.doc-backlink-list li > span:first-child {
42+
text-indent: .3rem;
43+
}
44+
.doc-backlink-list li {
45+
padding-inline-start: var(--tree-offset);
46+
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
47+
position: relative;
48+
margin-left: 0 !important;
49+
50+
&:last-child {
51+
border-color: transparent;
52+
}
53+
&::before{
54+
content: '';
55+
position: absolute;
56+
top: calc(var(--tree-item-height) / 2 * -1 * var(--tree-font-size) + var(--tree-thickness));
57+
left: calc(var(--tree-thickness) * -1);
58+
width: calc(var(--tree-offset) + var(--tree-thickness) * 2);
59+
height: calc(var(--tree-item-height) * var(--tree-font-size));
60+
border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
61+
border-bottom: var(--tree-thickness) var(--tree-style) var(--tree-clr);
62+
}
63+
&::after{
64+
content: '';
65+
position: absolute;
66+
border-radius: 50%;
67+
background-color: var(--tree-clr);
68+
top: calc(var(--tree-item-height) / 2 * 1rem);
69+
left: var(--tree-offset) ;
70+
translate: calc(var(--tree-thickness) * -1) calc(var(--tree-thickness) * -1);
71+
}
72+
}

docs/reference/api.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: API reference
3+
hide:
4+
- navigation
5+
---
6+
7+
# ::: mkdocs_llmstxt

mkdocs.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ nav:
1919
- Changelog: changelog.md
2020
- Credits: credits.md
2121
- License: license.md
22-
# defer to gen-files + literate-nav
23-
- API reference: reference/
22+
- API reference: reference/api.md
2423
- Development:
2524
- Contributing: contributing.md
2625
- Code of Conduct: code_of_conduct.md
@@ -107,11 +106,6 @@ plugins:
107106
- autorefs
108107
- markdown-exec
109108
- section-index
110-
- gen-files:
111-
scripts:
112-
- scripts/gen_api_ref.py
113-
- literate-nav:
114-
nav_file: SUMMARY.txt
115109
- coverage
116110
- mkdocstrings:
117111
handlers:
@@ -121,6 +115,7 @@ plugins:
121115
- https://www.crummy.com/software/BeautifulSoup/bs4/doc/objects.inv
122116
paths: [src]
123117
options:
118+
backlinks: tree
124119
docstring_options:
125120
ignore_init_summary: true
126121
docstring_section_style: list

pyproject.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ getter = "scripts.get_version:get_version"
5454

5555
[tool.pdm.build]
5656
# Include as much as possible in the source distribution, to help redistributors.
57-
excludes = ["**/.pytest_cache"]
57+
excludes = ["**/.pytest_cache", "**/.mypy_cache"]
5858
source-includes = [
5959
"config",
6060
"docs",
@@ -98,14 +98,12 @@ ci = [
9898
"markdown-exec>=1.8",
9999
"mkdocs>=1.6",
100100
"mkdocs-coverage>=1.0",
101-
"mkdocs-gen-files>=0.5",
102101
"mkdocs-git-revision-date-localized-plugin>=1.2",
103-
"mkdocs-literate-nav>=0.6",
104102
"mkdocs-llmstxt>=0.1",
105103
"mkdocs-material>=9.5",
106104
"mkdocs-minify-plugin>=0.8",
107105
"mkdocs-section-index>=0.3",
108-
"mkdocstrings[python]>=0.25",
106+
"mkdocstrings[python]>=0.29",
109107
# YORE: EOL 3.10: Remove line.
110108
"tomli>=2.0; python_version < '3.11'",
111109
]

scripts/gen_api_ref.py

-38
This file was deleted.

tests/test_api.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import griffe
1010
import pytest
11-
from mkdocstrings.inventory import Inventory
11+
from mkdocstrings import Inventory
1212

1313
import mkdocs_llmstxt
1414

@@ -153,7 +153,11 @@ def test_inventory_matches_api(
153153
public_api_paths = {obj.path for obj in public_objects}
154154
public_api_paths.add("mkdocs_llmstxt")
155155
for item in inventory.values():
156-
if item.domain == "py" and "(" not in item.name:
156+
if (
157+
item.domain == "py"
158+
and "(" not in item.name
159+
and (item.name == "mkdocs_llmstxt" or item.name.startswith("mkdocs_llmstxt."))
160+
):
157161
obj = loader.modules_collection[item.name]
158162
if obj.path not in public_api_paths and not any(path in public_api_paths for path in obj.aliases):
159163
not_in_api.append(item.name)

0 commit comments

Comments
 (0)