blurry-cli 0.4.1__tar.gz → 0.4.2__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.
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/PKG-INFO +1 -1
- blurry_cli-0.4.2/blurry/__main__.py +3 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/images.py +1 -3
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/markdown/__init__.py +1 -6
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/html_plugins/minify_html_plugin.py +1 -3
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/pyproject.toml +11 -5
- blurry_cli-0.4.1/blurry/__main__.py +0 -5
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/LICENSE +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/README.md +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/__init__.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/async_typer.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/constants.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/markdown/front_matter.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/markdown/renderer_functions/__init__.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/markdown/renderer_functions/render_video.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/open_graph.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/__init__.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/html_plugins/__init__.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/markdown_plugins/__init__.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/py.typed +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/settings.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/sitemap.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/types.py +0 -0
- {blurry_cli-0.4.1 → blurry_cli-0.4.2}/blurry/utils.py +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import concurrent.futures
|
|
3
2
|
from pathlib import Path
|
|
4
|
-
from typing import Optional
|
|
5
3
|
|
|
6
4
|
from wand.image import Image
|
|
7
5
|
|
|
@@ -31,7 +29,7 @@ def add_image_width_to_path(image_path: Path, width: int) -> Path:
|
|
|
31
29
|
return Path(new_filename)
|
|
32
30
|
|
|
33
31
|
|
|
34
|
-
async def convert_image_to_avif(image_path: Path, target_path:
|
|
32
|
+
async def convert_image_to_avif(image_path: Path, target_path: Path | None = None):
|
|
35
33
|
image_suffix = image_path.suffix
|
|
36
34
|
if image_suffix in [".webp", ".gif"]:
|
|
37
35
|
return
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Any
|
|
3
|
-
from typing import Type
|
|
4
3
|
from typing import TypeGuard
|
|
5
4
|
|
|
6
5
|
import mistune
|
|
@@ -28,7 +27,6 @@ from blurry.settings import SETTINGS
|
|
|
28
27
|
from blurry.types import is_str
|
|
29
28
|
from blurry.utils import build_path_to_url
|
|
30
29
|
from blurry.utils import content_path_to_url
|
|
31
|
-
from blurry.utils import content_path_to_url_pathname
|
|
32
30
|
from blurry.utils import convert_relative_path_in_markdown_file_to_pathname
|
|
33
31
|
from blurry.utils import path_to_url_pathname
|
|
34
32
|
from blurry.utils import remove_lazy_loading_from_first_image
|
|
@@ -129,7 +127,7 @@ class BlurryRenderer(mistune.HTMLRenderer):
|
|
|
129
127
|
|
|
130
128
|
def is_blurry_renderer(
|
|
131
129
|
renderer: mistune.HTMLRenderer,
|
|
132
|
-
) -> TypeGuard[
|
|
130
|
+
) -> TypeGuard[type[BlurryRenderer]]:
|
|
133
131
|
return isinstance(renderer, BlurryRenderer)
|
|
134
132
|
|
|
135
133
|
|
|
@@ -177,9 +175,6 @@ def convert_markdown_file_to_html(filepath: Path) -> tuple[str, dict[str, Any]]:
|
|
|
177
175
|
|
|
178
176
|
# Add inferred/computed/relative values
|
|
179
177
|
front_matter.update({"url": content_path_to_url(filepath.relative_to(CONTENT_DIR))})
|
|
180
|
-
front_matter.update(
|
|
181
|
-
{"pathname": content_path_to_url_pathname(filepath.relative_to(CONTENT_DIR))}
|
|
182
|
-
)
|
|
183
178
|
if image := front_matter.get("image"):
|
|
184
179
|
image_path = filepath.parent / Path(image)
|
|
185
180
|
front_matter["image"] = content_path_to_url(image_path)
|
|
@@ -23,9 +23,7 @@ def minify_style_tags(html: str) -> str:
|
|
|
23
23
|
for style_tag in style_tags:
|
|
24
24
|
css = style_tag.text()
|
|
25
25
|
minified_css = minify_css(css)
|
|
26
|
-
minified_style_tag = HTMLParser(
|
|
27
|
-
f"<style>{minified_css}</style>"
|
|
28
|
-
).head.child # type: ignore
|
|
26
|
+
minified_style_tag = HTMLParser(f"<style>{minified_css}</style>").head.child # type: ignore
|
|
29
27
|
style_tag.replace_with(minified_style_tag) # type: ignore
|
|
30
28
|
|
|
31
29
|
return parser.html or html
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "blurry-cli"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.2"
|
|
4
4
|
description = "A Mistune-based static site generator for Python"
|
|
5
5
|
authors = ["John Franey <franey@duck.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -35,15 +35,17 @@ selectolax = "^0.3.6"
|
|
|
35
35
|
toml = "^0.10.2"
|
|
36
36
|
typer = "^0.6.1"
|
|
37
37
|
|
|
38
|
-
[tool.poetry.
|
|
38
|
+
[tool.poetry.scripts]
|
|
39
|
+
blurry = 'blurry:main'
|
|
40
|
+
|
|
41
|
+
[tool.poetry.group.dev.dependencies]
|
|
39
42
|
black = "^22.10.0"
|
|
43
|
+
nox = "^2023.4.22"
|
|
40
44
|
pyright = "^1.1.311"
|
|
41
45
|
pytest = "^6.2.2"
|
|
42
46
|
pytest-cov = "^2.11.1"
|
|
43
47
|
pytest-watch = "^4.2.0"
|
|
44
|
-
|
|
45
|
-
[tool.poetry.scripts]
|
|
46
|
-
blurry = 'blurry:main'
|
|
48
|
+
ruff = "^0.1.5"
|
|
47
49
|
|
|
48
50
|
[build-system]
|
|
49
51
|
requires = ["poetry-core>=1.0.0"]
|
|
@@ -53,6 +55,10 @@ build-backend = "poetry.core.masonry.api"
|
|
|
53
55
|
include = ["blurry/**"]
|
|
54
56
|
exclude = ["**/node_modules", "**/__pycache__", "**/.*", "blurry/tests"]
|
|
55
57
|
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
target-version = "py310"
|
|
60
|
+
line-length = 88
|
|
61
|
+
|
|
56
62
|
[tool.poetry.plugins."blurry.html_plugins"]
|
|
57
63
|
minify_html = 'blurry.plugins.html_plugins.minify_html_plugin:minify_html'
|
|
58
64
|
|
|
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
|