mkdocs-ultralytics-plugin 0.2.5__tar.gz → 0.2.6__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.
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/PKG-INFO +7 -6
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/README.md +5 -5
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/PKG-INFO +7 -6
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/plugin/__init__.py +1 -1
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/plugin/main.py +3 -2
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/plugin/postprocess.py +22 -21
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/plugin/processor.py +3 -3
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/plugin/utils.py +12 -15
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/pyproject.toml +1 -3
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/LICENSE +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/SOURCES.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/dependency_links.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/entry_points.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/requires.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/mkdocs_ultralytics_plugin.egg-info/top_level.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.5 → mkdocs_ultralytics_plugin-0.2.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-ultralytics-plugin
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: An MkDocs plugin that provides Ultralytics Docs customizations at https://docs.ultralytics.com.
|
|
5
5
|
Author-email: Glenn Jocher <hello@ultralytics.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -24,6 +24,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
27
28
|
Classifier: Topic :: Software Development
|
|
28
29
|
Classifier: Topic :: Scientific/Engineering
|
|
29
30
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -41,7 +42,7 @@ Provides-Extra: dev
|
|
|
41
42
|
Requires-Dist: pytest; extra == "dev"
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
|
-
<a href="https://www.ultralytics.com
|
|
45
|
+
<a href="https://www.ultralytics.com"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
|
45
46
|
|
|
46
47
|
# 🚀 MkDocs Ultralytics Plugin
|
|
47
48
|
|
|
@@ -55,8 +56,8 @@ Welcome to the MkDocs Ultralytics Plugin! 📄 This powerful tool enhances your
|
|
|
55
56
|
[](https://github.com/ultralytics/mkdocs/actions/workflows/format.yml)
|
|
56
57
|
|
|
57
58
|
[](https://discord.com/invite/ultralytics)
|
|
58
|
-
[](https://community.ultralytics.com
|
|
59
|
-
[](https://reddit.com/r/ultralytics)
|
|
59
|
+
[](https://community.ultralytics.com)
|
|
60
|
+
[](https://www.reddit.com/r/ultralytics/)
|
|
60
61
|
|
|
61
62
|
## ✨ Features
|
|
62
63
|
|
|
@@ -162,7 +163,7 @@ jekyll build && python postprocess.py
|
|
|
162
163
|
|
|
163
164
|
## ⚙️ Configuration Options
|
|
164
165
|
|
|
165
|
-
Both modes support the
|
|
166
|
+
Both modes support the feature options below. Differences: `enabled` applies to plugin mode only, while postprocess mode reads `site_dir`, `docs_dir`, and `site_url` as arguments (plugin mode gets these from `mkdocs.yml`) and additionally accepts `use_processes` (default `True`) and `workers` (default: CPU count) to control parallelism.
|
|
166
167
|
|
|
167
168
|
| Option | Type | Default | Description |
|
|
168
169
|
| ------------------- | ---- | ------- | -------------------------------- |
|
|
@@ -238,7 +239,7 @@ Both plugin mode and postprocess mode use the same `process_html()` function in
|
|
|
238
239
|
|
|
239
240
|
Collaboration fuels innovation! 🤗 The success of Ultralytics' open-source projects thrives on community contributions. We welcome your involvement, whether it's fixing bugs, proposing new features, improving documentation, engaging in discussions, or sharing how you use Ultralytics tools.
|
|
240
241
|
|
|
241
|
-
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing
|
|
242
|
+
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details. Filling out our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) also provides valuable feedback. We sincerely appreciate 🙇♂️ every contribution!
|
|
242
243
|
|
|
243
244
|
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
|
244
245
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<a href="https://www.ultralytics.com
|
|
1
|
+
<a href="https://www.ultralytics.com"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
|
2
2
|
|
|
3
3
|
# 🚀 MkDocs Ultralytics Plugin
|
|
4
4
|
|
|
@@ -12,8 +12,8 @@ Welcome to the MkDocs Ultralytics Plugin! 📄 This powerful tool enhances your
|
|
|
12
12
|
[](https://github.com/ultralytics/mkdocs/actions/workflows/format.yml)
|
|
13
13
|
|
|
14
14
|
[](https://discord.com/invite/ultralytics)
|
|
15
|
-
[](https://community.ultralytics.com
|
|
16
|
-
[](https://reddit.com/r/ultralytics)
|
|
15
|
+
[](https://community.ultralytics.com)
|
|
16
|
+
[](https://www.reddit.com/r/ultralytics/)
|
|
17
17
|
|
|
18
18
|
## ✨ Features
|
|
19
19
|
|
|
@@ -119,7 +119,7 @@ jekyll build && python postprocess.py
|
|
|
119
119
|
|
|
120
120
|
## ⚙️ Configuration Options
|
|
121
121
|
|
|
122
|
-
Both modes support the
|
|
122
|
+
Both modes support the feature options below. Differences: `enabled` applies to plugin mode only, while postprocess mode reads `site_dir`, `docs_dir`, and `site_url` as arguments (plugin mode gets these from `mkdocs.yml`) and additionally accepts `use_processes` (default `True`) and `workers` (default: CPU count) to control parallelism.
|
|
123
123
|
|
|
124
124
|
| Option | Type | Default | Description |
|
|
125
125
|
| ------------------- | ---- | ------- | -------------------------------- |
|
|
@@ -195,7 +195,7 @@ Both plugin mode and postprocess mode use the same `process_html()` function in
|
|
|
195
195
|
|
|
196
196
|
Collaboration fuels innovation! 🤗 The success of Ultralytics' open-source projects thrives on community contributions. We welcome your involvement, whether it's fixing bugs, proposing new features, improving documentation, engaging in discussions, or sharing how you use Ultralytics tools.
|
|
197
197
|
|
|
198
|
-
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing
|
|
198
|
+
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details. Filling out our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) also provides valuable feedback. We sincerely appreciate 🙇♂️ every contribution!
|
|
199
199
|
|
|
200
200
|
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
|
201
201
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-ultralytics-plugin
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: An MkDocs plugin that provides Ultralytics Docs customizations at https://docs.ultralytics.com.
|
|
5
5
|
Author-email: Glenn Jocher <hello@ultralytics.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -24,6 +24,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
27
28
|
Classifier: Topic :: Software Development
|
|
28
29
|
Classifier: Topic :: Scientific/Engineering
|
|
29
30
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -41,7 +42,7 @@ Provides-Extra: dev
|
|
|
41
42
|
Requires-Dist: pytest; extra == "dev"
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
|
-
<a href="https://www.ultralytics.com
|
|
45
|
+
<a href="https://www.ultralytics.com"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
|
45
46
|
|
|
46
47
|
# 🚀 MkDocs Ultralytics Plugin
|
|
47
48
|
|
|
@@ -55,8 +56,8 @@ Welcome to the MkDocs Ultralytics Plugin! 📄 This powerful tool enhances your
|
|
|
55
56
|
[](https://github.com/ultralytics/mkdocs/actions/workflows/format.yml)
|
|
56
57
|
|
|
57
58
|
[](https://discord.com/invite/ultralytics)
|
|
58
|
-
[](https://community.ultralytics.com
|
|
59
|
-
[](https://reddit.com/r/ultralytics)
|
|
59
|
+
[](https://community.ultralytics.com)
|
|
60
|
+
[](https://www.reddit.com/r/ultralytics/)
|
|
60
61
|
|
|
61
62
|
## ✨ Features
|
|
62
63
|
|
|
@@ -162,7 +163,7 @@ jekyll build && python postprocess.py
|
|
|
162
163
|
|
|
163
164
|
## ⚙️ Configuration Options
|
|
164
165
|
|
|
165
|
-
Both modes support the
|
|
166
|
+
Both modes support the feature options below. Differences: `enabled` applies to plugin mode only, while postprocess mode reads `site_dir`, `docs_dir`, and `site_url` as arguments (plugin mode gets these from `mkdocs.yml`) and additionally accepts `use_processes` (default `True`) and `workers` (default: CPU count) to control parallelism.
|
|
166
167
|
|
|
167
168
|
| Option | Type | Default | Description |
|
|
168
169
|
| ------------------- | ---- | ------- | -------------------------------- |
|
|
@@ -238,7 +239,7 @@ Both plugin mode and postprocess mode use the same `process_html()` function in
|
|
|
238
239
|
|
|
239
240
|
Collaboration fuels innovation! 🤗 The success of Ultralytics' open-source projects thrives on community contributions. We welcome your involvement, whether it's fixing bugs, proposing new features, improving documentation, engaging in discussions, or sharing how you use Ultralytics tools.
|
|
240
241
|
|
|
241
|
-
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing
|
|
242
|
+
Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details. Filling out our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) also provides valuable feedback. We sincerely appreciate 🙇♂️ every contribution!
|
|
242
243
|
|
|
243
244
|
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
|
244
245
|
|
|
@@ -8,7 +8,7 @@ from pathlib import Path
|
|
|
8
8
|
from mkdocs.config import config_options
|
|
9
9
|
from mkdocs.plugins import BasePlugin
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
from plugin import processor
|
|
12
12
|
from plugin.processor import process_html
|
|
13
13
|
from plugin.utils import resolve_all_authors
|
|
14
14
|
|
|
@@ -67,7 +67,8 @@ class MetaPlugin(BasePlugin):
|
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
try:
|
|
70
|
-
|
|
70
|
+
# MkDocs normalizes site_url to end in "/" and gives the home page url "./"
|
|
71
|
+
page_url = f"{(config['site_url'] or '').rstrip('/')}/{page.url}".rstrip("/.") or "/"
|
|
71
72
|
title = page.title
|
|
72
73
|
keywords = page.meta.get("keywords", None) if hasattr(page, "meta") else None
|
|
73
74
|
|
|
@@ -14,7 +14,7 @@ try:
|
|
|
14
14
|
except ImportError:
|
|
15
15
|
TQDM = None
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
from plugin import processor
|
|
18
18
|
from plugin.processor import process_html
|
|
19
19
|
from plugin.utils import resolve_all_authors
|
|
20
20
|
|
|
@@ -88,7 +88,7 @@ def process_html_file(
|
|
|
88
88
|
|
|
89
89
|
# Get page URL - calculate relative path from site_dir
|
|
90
90
|
rel_path = html_path.relative_to(site_dir).as_posix()
|
|
91
|
-
page_url = f"{site_url.rstrip('/')}/{rel_path}".replace("/index.html", "/"
|
|
91
|
+
page_url = f"{site_url.rstrip('/')}/{rel_path}".replace("/index.html", "") or "/"
|
|
92
92
|
|
|
93
93
|
# Get title
|
|
94
94
|
title = soup.find("h1").text if soup.find("h1") else soup.title.string if soup.title else ""
|
|
@@ -181,8 +181,9 @@ def generate_llms_txt(
|
|
|
181
181
|
|
|
182
182
|
def md_to_url(md_path: str) -> str:
|
|
183
183
|
"""Convert markdown path to HTML URL."""
|
|
184
|
-
url = md_path.
|
|
185
|
-
|
|
184
|
+
url = md_path[:-3] if md_path.endswith(".md") else md_path
|
|
185
|
+
url = url[:-6] if url.endswith("/index") else url
|
|
186
|
+
return (site_url or "/") if url == "index" else f"{site_url}/{url}"
|
|
186
187
|
|
|
187
188
|
if nav:
|
|
188
189
|
|
|
@@ -304,23 +305,23 @@ def postprocess_site(
|
|
|
304
305
|
# Enable logging only for the synchronous path; pools run without per-task log_fn to remain pickle-safe.
|
|
305
306
|
log_fn = (progress.write if verbose and progress else print if verbose else None) if worker_count == 1 else None
|
|
306
307
|
|
|
307
|
-
task_kwargs =
|
|
308
|
-
site_dir
|
|
309
|
-
md_index
|
|
310
|
-
git_data
|
|
311
|
-
repo_url
|
|
312
|
-
site_url
|
|
313
|
-
default_image
|
|
314
|
-
add_desc
|
|
315
|
-
add_image
|
|
316
|
-
add_keywords
|
|
317
|
-
add_share_buttons
|
|
318
|
-
add_authors
|
|
319
|
-
add_json_ld
|
|
320
|
-
add_css
|
|
321
|
-
add_copy_llm
|
|
322
|
-
verbose
|
|
323
|
-
|
|
308
|
+
task_kwargs = {
|
|
309
|
+
"site_dir": site_dir,
|
|
310
|
+
"md_index": md_index,
|
|
311
|
+
"git_data": git_data,
|
|
312
|
+
"repo_url": repo_url,
|
|
313
|
+
"site_url": site_url,
|
|
314
|
+
"default_image": default_image,
|
|
315
|
+
"add_desc": add_desc,
|
|
316
|
+
"add_image": add_image,
|
|
317
|
+
"add_keywords": add_keywords,
|
|
318
|
+
"add_share_buttons": add_share_buttons,
|
|
319
|
+
"add_authors": add_authors,
|
|
320
|
+
"add_json_ld": add_json_ld,
|
|
321
|
+
"add_css": add_css,
|
|
322
|
+
"add_copy_llm": add_copy_llm,
|
|
323
|
+
"verbose": verbose,
|
|
324
|
+
}
|
|
324
325
|
|
|
325
326
|
if worker_count == 1:
|
|
326
327
|
for html_file in html_files:
|
|
@@ -6,7 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
import json
|
|
7
7
|
import re
|
|
8
8
|
import subprocess
|
|
9
|
-
from datetime import datetime, timedelta
|
|
9
|
+
from datetime import datetime, timedelta, timezone
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from typing import Any
|
|
12
12
|
from urllib.parse import quote
|
|
@@ -15,7 +15,7 @@ from bs4 import BeautifulSoup
|
|
|
15
15
|
|
|
16
16
|
from plugin.utils import calculate_time_difference, get_youtube_video_ids
|
|
17
17
|
|
|
18
|
-
today = datetime.now()
|
|
18
|
+
today = datetime.now(timezone.utc)
|
|
19
19
|
DEFAULT_CREATION_DATE = (today - timedelta(days=365)).strftime("%Y-%m-%d %H:%M:%S +0000")
|
|
20
20
|
DEFAULT_MODIFIED_DATE = (today - timedelta(days=40)).strftime("%Y-%m-%d %H:%M:%S +0000")
|
|
21
21
|
|
|
@@ -529,7 +529,7 @@ def process_html(
|
|
|
529
529
|
{
|
|
530
530
|
"@type": "Organization",
|
|
531
531
|
"name": "Ultralytics",
|
|
532
|
-
"url": "https://ultralytics.com
|
|
532
|
+
"url": "https://ultralytics.com",
|
|
533
533
|
}
|
|
534
534
|
],
|
|
535
535
|
"abstract": meta.get("description", ""),
|
|
@@ -147,20 +147,17 @@ def resolve_github_user(
|
|
|
147
147
|
|
|
148
148
|
# Query the commit API when git history provides a commit for this email. This resolves authors whose commit email
|
|
149
149
|
# is linked to a GitHub account but hidden from user search.
|
|
150
|
-
if repo_path := _github_repo_path(repo_url):
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
)
|
|
156
|
-
if
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return cache[email]
|
|
162
|
-
except Exception:
|
|
163
|
-
pass
|
|
150
|
+
if (repo_path := _github_repo_path(repo_url)) and commit_sha:
|
|
151
|
+
try:
|
|
152
|
+
response = requests.get(f"https://api.github.com/repos/{repo_path}/commits/{commit_sha}", timeout=TIMEOUT)
|
|
153
|
+
if response.status_code == 200:
|
|
154
|
+
data = response.json()
|
|
155
|
+
author = data.get("author") or {}
|
|
156
|
+
if author.get("login") and author.get("avatar_url"):
|
|
157
|
+
cache[email] = {"username": author["login"], "avatar": author["avatar_url"]}
|
|
158
|
+
return cache[email]
|
|
159
|
+
except Exception:
|
|
160
|
+
pass
|
|
164
161
|
|
|
165
162
|
# Query GitHub REST API
|
|
166
163
|
if verbose:
|
|
@@ -238,7 +235,7 @@ def resolve_all_authors(
|
|
|
238
235
|
# Build authors list for each file entry
|
|
239
236
|
github_repo_url = repo_url or "https://github.com/ultralytics/ultralytics"
|
|
240
237
|
|
|
241
|
-
for
|
|
238
|
+
for entry in git_data.values():
|
|
242
239
|
emails = entry.get("emails", {})
|
|
243
240
|
if not emails and default_author:
|
|
244
241
|
emails = {default_author: 1}
|
|
@@ -50,6 +50,7 @@ classifiers = [
|
|
|
50
50
|
"Programming Language :: Python :: 3.12",
|
|
51
51
|
"Programming Language :: Python :: 3.13",
|
|
52
52
|
"Programming Language :: Python :: 3.14",
|
|
53
|
+
"Programming Language :: Python :: 3.15",
|
|
53
54
|
"Topic :: Software Development",
|
|
54
55
|
"Topic :: Scientific/Engineering",
|
|
55
56
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
@@ -77,8 +78,5 @@ ultralytics = "plugin:MetaPlugin" # executes the function `MetaPlugin` from thi
|
|
|
77
78
|
[project.optional-dependencies] # Optional
|
|
78
79
|
dev = ["pytest"]
|
|
79
80
|
|
|
80
|
-
[tool.setuptools] # This is configuration specific to the `setuptools` build backend.
|
|
81
|
-
package-data = { "sample" = ["*.yaml"] }
|
|
82
|
-
|
|
83
81
|
[tool.setuptools.dynamic]
|
|
84
82
|
version = {attr = "plugin.__version__"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|