mkdocs-ultralytics-plugin 0.2.0__tar.gz → 0.2.1__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.0 → mkdocs_ultralytics_plugin-0.2.1}/PKG-INFO +1 -1
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/PKG-INFO +1 -1
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/plugin/__init__.py +1 -1
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/plugin/processor.py +22 -10
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/LICENSE +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/README.md +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/SOURCES.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/dependency_links.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/entry_points.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/requires.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/mkdocs_ultralytics_plugin.egg-info/top_level.txt +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/plugin/main.py +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/plugin/postprocess.py +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/plugin/utils.py +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/pyproject.toml +0 -0
- {mkdocs_ultralytics_plugin-0.2.0 → mkdocs_ultralytics_plugin-0.2.1}/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.1
|
|
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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-ultralytics-plugin
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
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>
|
|
@@ -245,17 +245,29 @@ def process_html(
|
|
|
245
245
|
if len(desc) >= 10:
|
|
246
246
|
meta["description"] = desc
|
|
247
247
|
|
|
248
|
+
# ---------- IMAGE PICKING (body only, non-AVIF) ----------
|
|
248
249
|
if add_image:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
250
|
+
search_root = soup.find("article", class_="md-content__inner") or soup.body or soup
|
|
251
|
+
|
|
252
|
+
image_src: str | None = None
|
|
253
|
+
for img in search_root.find_all("img", src=True):
|
|
254
|
+
src = img["src"]
|
|
255
|
+
lower = src.lower()
|
|
256
|
+
if not lower or ".avif" in lower:
|
|
257
|
+
continue
|
|
258
|
+
if lower.startswith(("javascript:", "data:")):
|
|
259
|
+
continue
|
|
260
|
+
image_src = src
|
|
261
|
+
break
|
|
262
|
+
|
|
263
|
+
if not image_src and (youtube_ids := get_youtube_video_ids(soup)):
|
|
264
|
+
image_src = f"https://img.youtube.com/vi/{youtube_ids[0]}/maxresdefault.jpg"
|
|
265
|
+
if not image_src and default_image:
|
|
266
|
+
image_src = default_image
|
|
267
|
+
|
|
268
|
+
if image_src:
|
|
269
|
+
meta["image"] = image_src
|
|
270
|
+
# ---------------------------------------------------------
|
|
259
271
|
|
|
260
272
|
# Add meta tags to head
|
|
261
273
|
if not soup.find("meta", attrs={"name": "title"}):
|
|
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
|