jx 0.3.0__tar.gz → 0.4.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.
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jx
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Replace your HTML templates with Python server-Side components
5
5
  Author-email: Juan Pablo Scaletti <juanpablo@jpscaletti.com>
6
- Project-URL: Homepage, https://jx.scaletti.dev/
7
- Project-URL: GitHub, https://github.com/jpsca/jx
6
+ Project-URL: Code, https://github.com/jpsca/jx
7
+ Project-URL: Documentation, https://jx.scaletti.dev/
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Environment :: Web Environment
10
10
  Classifier: Intended Audience :: Developers
@@ -24,17 +24,16 @@ License-File: LICENSE
24
24
  Requires-Dist: jinja2>=3.0
25
25
  Dynamic: license-file
26
26
 
27
- <h1>
28
- <img src="./docs/logo-jx.png" height="100" align="top">
29
- </h1>
30
-
31
- Super components powers for your Jinja templates.
32
-
33
- <p>
34
- <img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
35
- <img alt="license: MIT" src="./docs/license.svg">
27
+ <div align="center">
28
+ <h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
29
+ </div>
30
+ <p align="center">
31
+ <img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
32
+ <img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
36
33
  </p>
37
34
 
35
+ ### Python server-side components
36
+
38
37
  From chaos to clarity: The power of components in your server-side-rendered Python web app.
39
38
 
40
39
  <!-- Documentation: https://jx.scaletti.dev/ -->
@@ -1,14 +1,13 @@
1
- <h1>
2
- <img src="./docs/logo-jx.png" height="100" align="top">
3
- </h1>
4
-
5
- Super components powers for your Jinja templates.
6
-
7
- <p>
8
- <img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
9
- <img alt="license: MIT" src="./docs/license.svg">
1
+ <div align="center">
2
+ <h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
3
+ </div>
4
+ <p align="center">
5
+ <img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
6
+ <img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
10
7
  </p>
11
8
 
9
+ ### Python server-side components
10
+
12
11
  From chaos to clarity: The power of components in your server-side-rendered Python web app.
13
12
 
14
13
  <!-- Documentation: https://jx.scaletti.dev/ -->
@@ -4,7 +4,7 @@ requires = ["setuptools"]
4
4
 
5
5
  [project]
6
6
  name = "jx"
7
- version = "0.3.0"
7
+ version = "0.4.0"
8
8
  description = "Replace your HTML templates with Python server-Side components"
9
9
  authors = [
10
10
  {name = "Juan Pablo Scaletti", email = "juanpablo@jpscaletti.com"},
@@ -32,8 +32,8 @@ dependencies = [
32
32
  ]
33
33
 
34
34
  [project.urls]
35
- Homepage = "https://jx.scaletti.dev/"
36
- GitHub = "https://github.com/jpsca/jx"
35
+ Code = "https://github.com/jpsca/jx"
36
+ Documentation = "https://jx.scaletti.dev/"
37
37
 
38
38
  [dependency-groups]
39
39
  dev = [
@@ -55,6 +55,13 @@ test = [
55
55
  [tool.setuptools.packages.find]
56
56
  where = ["src"]
57
57
 
58
+
59
+ [tool.ty.src]
60
+ exclude = [
61
+ "docs",
62
+ ]
63
+
64
+
58
65
  [tool.coverage.run]
59
66
  branch = true
60
67
 
@@ -81,9 +88,9 @@ addopts = "--doctest-modules"
81
88
  legacy_tox_ini = """
82
89
  [tox]
83
90
  env_list =
84
- 3.14
85
- 3.13
86
91
  3.12
92
+ 3.13
93
+ 3.14
87
94
 
88
95
  [testenv]
89
96
  runner = uv-venv-lock-runner
@@ -24,7 +24,7 @@ RX_TAG_NAME = re.compile(rf"<(?P<tag>{re_tag_name})(\s|\n|/|>)")
24
24
  re_attr_name = r""
25
25
  re_equal = r""
26
26
  re_attr = r"""
27
- (?P<name>[:a-zA-Z@$_][a-zA-Z@:$_0-9-]*)
27
+ (?P<name>[:a-zA-Z@$_][a-zA-Z@:$_0-9-\.]*)
28
28
  (?:
29
29
  \s*=\s*
30
30
  (?P<value>".*?"|'.*?'|\{\{.*?\}\})
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jx
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Replace your HTML templates with Python server-Side components
5
5
  Author-email: Juan Pablo Scaletti <juanpablo@jpscaletti.com>
6
- Project-URL: Homepage, https://jx.scaletti.dev/
7
- Project-URL: GitHub, https://github.com/jpsca/jx
6
+ Project-URL: Code, https://github.com/jpsca/jx
7
+ Project-URL: Documentation, https://jx.scaletti.dev/
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Environment :: Web Environment
10
10
  Classifier: Intended Audience :: Developers
@@ -24,17 +24,16 @@ License-File: LICENSE
24
24
  Requires-Dist: jinja2>=3.0
25
25
  Dynamic: license-file
26
26
 
27
- <h1>
28
- <img src="./docs/logo-jx.png" height="100" align="top">
29
- </h1>
30
-
31
- Super components powers for your Jinja templates.
32
-
33
- <p>
34
- <img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
35
- <img alt="license: MIT" src="./docs/license.svg">
27
+ <div align="center">
28
+ <h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
29
+ </div>
30
+ <p align="center">
31
+ <img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
32
+ <img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
36
33
  </p>
37
34
 
35
+ ### Python server-side components
36
+
38
37
  From chaos to clarity: The power of components in your server-side-rendered Python web app.
39
38
 
40
39
  <!-- Documentation: https://jx.scaletti.dev/ -->
@@ -473,3 +473,30 @@ AFTER
473
473
  <link rel="stylesheet" href="before.css">
474
474
  BEFORE
475
475
  """.strip()
476
+
477
+
478
+ def test_alpine_sintax(folder):
479
+ (folder / "greeting.jinja").write_text("""
480
+ {#def message #}
481
+ <button @click.prevent="alert('{{ message }}')">Say Hi</button>""")
482
+ cat = Catalog(folder, auto_reload=False)
483
+
484
+ html = cat.render("greeting.jinja", message="Hello world!")
485
+ print(html)
486
+ assert html == """<button @click.prevent="alert('Hello world!')">Say Hi</button>"""
487
+
488
+
489
+ def test_alpine_sintax_in_component(folder):
490
+ (folder / "button.jinja").write_text(
491
+ """<button {{ attrs.render() }}>{{ content }}</button>"""
492
+ )
493
+
494
+ (folder / "greeting.jinja").write_text("""
495
+ {# import "button.jinja" as Button #}
496
+ <Button @click.prevent="alert('Hello world!')">Say Hi</Button>
497
+ """)
498
+ cat = Catalog(folder, auto_reload=False)
499
+
500
+ html = cat.render("greeting.jinja")
501
+ print(html)
502
+ assert html == """<button @click.prevent="alert('Hello world!')">Say Hi</button>"""
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