blurry-cli 0.8.2__tar.gz → 0.9.0__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.8.2 → blurry_cli-0.9.0}/PKG-INFO +5 -4
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/__init__.py +1 -32
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/markdown/__init__.py +0 -2
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/jinja_plugins/blurry_image_extension.py +0 -6
- blurry_cli-0.9.0/blurry/templates.py +34 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/pyproject.toml +5 -4
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/LICENSE +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/README.md +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/__main__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/async_typer.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/cli.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/constants.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/images.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/markdown/front_matter.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/markdown/renderer_functions/__init__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/markdown/renderer_functions/render_video.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/open_graph.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/__init__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/html_plugins/__init__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/jinja_plugins/__init__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/markdown_plugins/__init__.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/py.typed +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/schema_validation.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/settings.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/sitemap.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/types.py +0 -0
- {blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: blurry-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: A Mistune-based static site generator for Python
|
|
5
5
|
Home-page: https://github.com/blurry-dev/blurry
|
|
6
6
|
License: MIT
|
|
@@ -15,11 +15,12 @@ Classifier: Programming Language :: Python :: 3
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System
|
|
19
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
20
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
22
|
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
22
|
-
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
23
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
23
24
|
Requires-Dist: Jinja2 (>=3.0.0,<4.0.0)
|
|
24
25
|
Requires-Dist: PyLD (>=2.0.3,<3.0.0)
|
|
25
26
|
Requires-Dist: Wand (>=0.6.6,<0.7.0)
|
|
@@ -29,7 +30,7 @@ Requires-Dist: htmlmin2 (>=0.1.13,<0.2.0)
|
|
|
29
30
|
Requires-Dist: jinja2-simple-tags (>=0.6.1,<0.7.0)
|
|
30
31
|
Requires-Dist: livereload (>=2.6.3,<3.0.0)
|
|
31
32
|
Requires-Dist: mistune (>=3.0.0rc5,<4.0.0)
|
|
32
|
-
Requires-Dist: pydantic2-schemaorg (>=0.
|
|
33
|
+
Requires-Dist: pydantic2-schemaorg (>=0.2.0,<0.3.0)
|
|
33
34
|
Requires-Dist: rich (>=13.3.3,<14.0.0)
|
|
34
35
|
Requires-Dist: selectolax (>=0.3.6,<0.4.0)
|
|
35
36
|
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
@@ -11,8 +11,6 @@ from pathlib import Path
|
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
13
13
|
from jinja2 import Environment
|
|
14
|
-
from jinja2 import FileSystemLoader
|
|
15
|
-
from jinja2 import select_autoescape
|
|
16
14
|
from livereload import Server
|
|
17
15
|
from rich import print
|
|
18
16
|
from rich.console import Console
|
|
@@ -25,15 +23,13 @@ from blurry.images import generate_images_for_srcset
|
|
|
25
23
|
from blurry.markdown import convert_markdown_file_to_html
|
|
26
24
|
from blurry.open_graph import open_graph_meta_tags
|
|
27
25
|
from blurry.plugins import discovered_html_plugins
|
|
28
|
-
from blurry.plugins import discovered_jinja_extensions
|
|
29
|
-
from blurry.plugins import discovered_jinja_filter_plugins
|
|
30
26
|
from blurry.schema_validation import validate_front_matter_as_schema
|
|
31
27
|
from blurry.settings import get_build_directory
|
|
32
28
|
from blurry.settings import get_content_directory
|
|
33
|
-
from blurry.settings import get_templates_directory
|
|
34
29
|
from blurry.settings import SETTINGS
|
|
35
30
|
from blurry.settings import update_settings
|
|
36
31
|
from blurry.sitemap import write_sitemap_file
|
|
32
|
+
from blurry.templates import get_jinja_env
|
|
37
33
|
from blurry.types import DirectoryFileData
|
|
38
34
|
from blurry.types import MarkdownFileData
|
|
39
35
|
from blurry.types import TemplateContext
|
|
@@ -58,33 +54,6 @@ print_plugin_table()
|
|
|
58
54
|
app = AsyncTyper()
|
|
59
55
|
|
|
60
56
|
|
|
61
|
-
def get_jinja_env():
|
|
62
|
-
jinja_env = Environment(
|
|
63
|
-
loader=FileSystemLoader(get_templates_directory()),
|
|
64
|
-
autoescape=select_autoescape(
|
|
65
|
-
list(
|
|
66
|
-
{
|
|
67
|
-
SETTINGS["MARKDOWN_FILE_JINJA_TEMPLATE_EXTENSION"].lstrip("."),
|
|
68
|
-
"html",
|
|
69
|
-
"xml",
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
),
|
|
73
|
-
extensions=[
|
|
74
|
-
jinja_extension.load() for jinja_extension in discovered_jinja_extensions
|
|
75
|
-
],
|
|
76
|
-
)
|
|
77
|
-
for filter_plugin in discovered_jinja_filter_plugins:
|
|
78
|
-
try:
|
|
79
|
-
jinja_env.filters[filter_plugin.name] = filter_plugin.load()
|
|
80
|
-
except AttributeError:
|
|
81
|
-
print(
|
|
82
|
-
f"Could not load Jinja filter plugin: {filter_plugin.name}. "
|
|
83
|
-
"Possibly because {filter_plugin.value} is not a valid object reference."
|
|
84
|
-
)
|
|
85
|
-
return jinja_env
|
|
86
|
-
|
|
87
|
-
|
|
88
57
|
async def process_non_markdown_file(filepath: Path):
|
|
89
58
|
CONTENT_DIR = get_content_directory()
|
|
90
59
|
mimetype, _ = mimetypes.guess_type(filepath, strict=False)
|
|
@@ -183,14 +183,12 @@ def convert_markdown_file_to_html(filepath: Path) -> tuple[str, dict[str, Any]]:
|
|
|
183
183
|
|
|
184
184
|
# Add inferred/computed/relative values
|
|
185
185
|
# https://schema.org/image
|
|
186
|
-
# https://schema.org/thumbnailUrl
|
|
187
186
|
front_matter.update({"url": content_path_to_url(filepath.relative_to(CONTENT_DIR))})
|
|
188
187
|
if image := front_matter.get("image"):
|
|
189
188
|
image_copy = deepcopy(image)
|
|
190
189
|
relative_image_path = get_relative_image_path_from_image_property(image_copy)
|
|
191
190
|
image_path = resolve_relative_path_in_markdown(relative_image_path, filepath)
|
|
192
191
|
front_matter["image"] = update_image_with_url(image_copy, image_path)
|
|
193
|
-
front_matter["thumbnailUrl"] = image_path_to_thumbnailUrl(image_path)
|
|
194
192
|
return html, front_matter
|
|
195
193
|
|
|
196
194
|
|
{blurry_cli-0.8.2 → blurry_cli-0.9.0}/blurry/plugins/jinja_plugins/blurry_image_extension.py
RENAMED
|
@@ -60,12 +60,6 @@ class BlurryImage(StandaloneTag):
|
|
|
60
60
|
]:
|
|
61
61
|
image_path = Path(str(image_path).replace(image_path.suffix, ".avif"))
|
|
62
62
|
|
|
63
|
-
if not image_path.exists():
|
|
64
|
-
warning_console.print(
|
|
65
|
-
f"blurry_image: Could not find {image_path}. Skipping."
|
|
66
|
-
)
|
|
67
|
-
return ""
|
|
68
|
-
|
|
69
63
|
attributes["src"] = build_path_to_url(image_path)
|
|
70
64
|
|
|
71
65
|
if "alt" not in attributes:
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from jinja2 import Environment
|
|
2
|
+
from jinja2 import FileSystemLoader
|
|
3
|
+
from jinja2 import select_autoescape
|
|
4
|
+
from blurry.plugins import discovered_jinja_extensions
|
|
5
|
+
from blurry.plugins import discovered_jinja_filter_plugins
|
|
6
|
+
from blurry.settings import get_templates_directory
|
|
7
|
+
from blurry.settings import SETTINGS
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_jinja_env():
|
|
11
|
+
jinja_env = Environment(
|
|
12
|
+
loader=FileSystemLoader(get_templates_directory()),
|
|
13
|
+
autoescape=select_autoescape(
|
|
14
|
+
list(
|
|
15
|
+
{
|
|
16
|
+
SETTINGS["MARKDOWN_FILE_JINJA_TEMPLATE_EXTENSION"].lstrip("."),
|
|
17
|
+
"html",
|
|
18
|
+
"xml",
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
),
|
|
22
|
+
extensions=[
|
|
23
|
+
jinja_extension.load() for jinja_extension in discovered_jinja_extensions
|
|
24
|
+
],
|
|
25
|
+
)
|
|
26
|
+
for filter_plugin in discovered_jinja_filter_plugins:
|
|
27
|
+
try:
|
|
28
|
+
jinja_env.filters[filter_plugin.name] = filter_plugin.load()
|
|
29
|
+
except AttributeError:
|
|
30
|
+
print(
|
|
31
|
+
f"Could not load Jinja filter plugin: {filter_plugin.name}. "
|
|
32
|
+
"Possibly because {filter_plugin.value} is not a valid object reference."
|
|
33
|
+
)
|
|
34
|
+
return jinja_env
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "blurry-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
description = "A Mistune-based static site generator for Python"
|
|
5
5
|
authors = ["John Franey <franey@duck.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -13,11 +13,12 @@ classifiers = [
|
|
|
13
13
|
"Programming Language :: Python :: 3.10",
|
|
14
14
|
"Programming Language :: Python :: 3.11",
|
|
15
15
|
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
16
17
|
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System",
|
|
17
|
-
"Topic :: Internet :: WWW/HTTP :: Site Management
|
|
18
|
+
"Topic :: Internet :: WWW/HTTP :: Site Management",
|
|
18
19
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
19
20
|
"Topic :: Text Processing :: Markup :: HTML ",
|
|
20
|
-
"Topic :: Text Processing :: Markup :: Markdown
|
|
21
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
21
22
|
]
|
|
22
23
|
include = ["LICENSE"]
|
|
23
24
|
packages = [{ include = "blurry" }]
|
|
@@ -35,7 +36,7 @@ selectolax = "^0.3.6"
|
|
|
35
36
|
toml = "^0.10.2"
|
|
36
37
|
typer = "^0.6.1"
|
|
37
38
|
htmlmin2 = "^0.1.13"
|
|
38
|
-
pydantic2-schemaorg = "^0.
|
|
39
|
+
pydantic2-schemaorg = "^0.2.0"
|
|
39
40
|
dpath = "^2.1.6"
|
|
40
41
|
jinja2-simple-tags = "^0.6.1"
|
|
41
42
|
|
|
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
|