blurry-cli 0.9.0__tar.gz → 0.10.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.
Files changed (31) hide show
  1. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/PKG-INFO +6 -4
  2. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/README.md +1 -0
  3. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/__init__.py +4 -3
  4. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/markdown/__init__.py +1 -1
  5. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/templates.py +13 -2
  6. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/pyproject.toml +5 -4
  7. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/LICENSE +0 -0
  8. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/__main__.py +0 -0
  9. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/async_typer.py +0 -0
  10. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/cli.py +0 -0
  11. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/constants.py +0 -0
  12. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/images.py +0 -0
  13. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/markdown/front_matter.py +0 -0
  14. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/markdown/renderer_functions/__init__.py +0 -0
  15. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/markdown/renderer_functions/render_video.py +0 -0
  16. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/open_graph.py +0 -0
  17. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/__init__.py +0 -0
  18. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/html_plugins/__init__.py +0 -0
  19. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
  20. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/jinja_plugins/__init__.py +0 -0
  21. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/jinja_plugins/blurry_image_extension.py +0 -0
  22. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/markdown_plugins/__init__.py +0 -0
  23. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
  24. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
  25. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
  26. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/py.typed +0 -0
  27. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/schema_validation.py +0 -0
  28. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/settings.py +0 -0
  29. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/sitemap.py +0 -0
  30. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/types.py +0 -0
  31. {blurry_cli-0.9.0 → blurry_cli-0.10.0}/blurry/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blurry-cli
3
- Version: 0.9.0
3
+ Version: 0.10.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
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System
20
20
  Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Classifier: Topic :: Text Processing :: Markup :: HTML
22
+ Classifier: Topic :: Text Processing :: Markup :: HTML
23
23
  Classifier: Topic :: Text Processing :: Markup :: Markdown
24
24
  Requires-Dist: Jinja2 (>=3.0.0,<4.0.0)
25
25
  Requires-Dist: PyLD (>=2.0.3,<3.0.0)
@@ -28,8 +28,9 @@ Requires-Dist: dpath (>=2.1.6,<3.0.0)
28
28
  Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0)
29
29
  Requires-Dist: htmlmin2 (>=0.1.13,<0.2.0)
30
30
  Requires-Dist: jinja2-simple-tags (>=0.6.1,<0.7.0)
31
- Requires-Dist: livereload (>=2.6.3,<3.0.0)
32
- Requires-Dist: mistune (>=3.0.0rc5,<4.0.0)
31
+ Requires-Dist: jinjax (>=0.48,<0.49)
32
+ Requires-Dist: livereload (>=2.7.0,<3.0.0)
33
+ Requires-Dist: mistune (>=3.0.2,<4.0.0)
33
34
  Requires-Dist: pydantic2-schemaorg (>=0.2.0,<0.3.0)
34
35
  Requires-Dist: rich (>=13.3.3,<14.0.0)
35
36
  Requires-Dist: selectolax (>=0.3.6,<0.4.0)
@@ -71,6 +72,7 @@ Blurry blends together high-quality libraries:
71
72
 
72
73
  - [Mistune](https://mistune.readthedocs.io/) to convert Markdown to HTML
73
74
  - [Jinja](https://jinja.palletsprojects.com/) for HTML templating
75
+ - [JinjaX](https://jinjax.scaletti.dev/) for Jinja components
74
76
  - [LiveReload](https://livereload.readthedocs.io/) for an HTTP server with automatic browser reloading
75
77
  - [Typer](https://typer.tiangolo.com/) for its CLI interface
76
78
  - [ImageMagick](https://imagemagick.org/index.php) to resize and convert images
@@ -31,6 +31,7 @@ Blurry blends together high-quality libraries:
31
31
 
32
32
  - [Mistune](https://mistune.readthedocs.io/) to convert Markdown to HTML
33
33
  - [Jinja](https://jinja.palletsprojects.com/) for HTML templating
34
+ - [JinjaX](https://jinjax.scaletti.dev/) for Jinja components
34
35
  - [LiveReload](https://livereload.readthedocs.io/) for an HTTP server with automatic browser reloading
35
36
  - [Typer](https://typer.tiangolo.com/) for its CLI interface
36
37
  - [ImageMagick](https://imagemagick.org/index.php) to resize and convert images
@@ -47,9 +47,6 @@ def json_converter_with_dates(item: Any) -> None | str:
47
47
 
48
48
  warning_console = Console(stderr=True, style="bold yellow")
49
49
 
50
- print_blurry_name()
51
- print_plugin_table()
52
-
53
50
 
54
51
  app = AsyncTyper()
55
52
 
@@ -157,6 +154,10 @@ async def write_html_file(
157
154
  @app.async_command()
158
155
  async def build(release=True):
159
156
  """Generates HTML content from Markdown files."""
157
+
158
+ print_blurry_name()
159
+ print_plugin_table()
160
+
160
161
  update_settings()
161
162
  jinja_env = get_jinja_env()
162
163
  os.environ.setdefault(f"{ENV_VAR_PREFIX}BUILD_MODE", "prod" if release else "dev")
@@ -80,7 +80,7 @@ class BlurryRenderer(mistune.HTMLRenderer):
80
80
  attributes["width"] = image_width
81
81
  attributes["height"] = image_height
82
82
 
83
- if image_is_animated:
83
+ if image_is_animated or extension.lower() == "svg":
84
84
  attributes_str = " ".join(
85
85
  f'{name}="{value}"' for name, value in attributes.items()
86
86
  )
@@ -1,15 +1,21 @@
1
+ import jinjax
1
2
  from jinja2 import Environment
2
3
  from jinja2 import FileSystemLoader
3
4
  from jinja2 import select_autoescape
5
+
4
6
  from blurry.plugins import discovered_jinja_extensions
5
7
  from blurry.plugins import discovered_jinja_filter_plugins
6
8
  from blurry.settings import get_templates_directory
7
9
  from blurry.settings import SETTINGS
8
10
 
9
11
 
10
- def get_jinja_env():
12
+ def get_jinja_env() -> Environment:
13
+ """
14
+ Returns a Jinja environment complete with JinjaX and any installed Jinja extensions and filters.
15
+ """
16
+ templates_directory = get_templates_directory()
11
17
  jinja_env = Environment(
12
- loader=FileSystemLoader(get_templates_directory()),
18
+ loader=FileSystemLoader(templates_directory),
13
19
  autoescape=select_autoescape(
14
20
  list(
15
21
  {
@@ -31,4 +37,9 @@ def get_jinja_env():
31
37
  f"Could not load Jinja filter plugin: {filter_plugin.name}. "
32
38
  "Possibly because {filter_plugin.value} is not a valid object reference."
33
39
  )
40
+
41
+ jinja_env.add_extension(jinjax.JinjaX)
42
+ catalog = jinjax.Catalog(jinja_env=jinja_env)
43
+ catalog.add_folder(templates_directory / "components")
44
+
34
45
  return jinja_env
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "blurry-cli"
3
- version = "0.9.0"
3
+ version = "0.10.0"
4
4
  description = "A Mistune-based static site generator for Python"
5
5
  authors = ["John Franey <franey@duck.com>"]
6
6
  license = "MIT"
@@ -17,7 +17,7 @@ classifiers = [
17
17
  "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System",
18
18
  "Topic :: Internet :: WWW/HTTP :: Site Management",
19
19
  "Topic :: Software Development :: Libraries :: Python Modules",
20
- "Topic :: Text Processing :: Markup :: HTML ",
20
+ "Topic :: Text Processing :: Markup :: HTML",
21
21
  "Topic :: Text Processing :: Markup :: Markdown",
22
22
  ]
23
23
  include = ["LICENSE"]
@@ -28,8 +28,8 @@ Jinja2 = "^3.0.0"
28
28
  PyLD = "^2.0.3"
29
29
  Wand = "^0.6.6"
30
30
  ffmpeg-python = "^0.2.0"
31
- livereload = "^2.6.3"
32
- mistune = "^3.0.0rc5"
31
+ livereload = "^2.7.0"
32
+ mistune = "^3.0.2"
33
33
  python = "^3.10"
34
34
  rich = "^13.3.3"
35
35
  selectolax = "^0.3.6"
@@ -39,6 +39,7 @@ htmlmin2 = "^0.1.13"
39
39
  pydantic2-schemaorg = "^0.2.0"
40
40
  dpath = "^2.1.6"
41
41
  jinja2-simple-tags = "^0.6.1"
42
+ jinjax = "^0.48"
42
43
 
43
44
  [tool.poetry.scripts]
44
45
  blurry = 'blurry:main'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes