render-engine 2025.10.3a1__py3-none-any.whl → 2025.11.1a1__py3-none-any.whl
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.
- render_engine/__version__.py +34 -0
- render_engine/collection.py +18 -0
- render_engine/content_managers/base_content_manager.py +6 -0
- render_engine/content_managers/file_content_manager.py +21 -0
- render_engine/site.py +11 -1
- {render_engine-2025.10.3a1.dist-info → render_engine-2025.11.1a1.dist-info}/METADATA +1 -1
- {render_engine-2025.10.3a1.dist-info → render_engine-2025.11.1a1.dist-info}/RECORD +9 -8
- {render_engine-2025.10.3a1.dist-info → render_engine-2025.11.1a1.dist-info}/WHEEL +0 -0
- {render_engine-2025.10.3a1.dist-info → render_engine-2025.11.1a1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '2025.11.1a1'
|
|
32
|
+
__version_tuple__ = version_tuple = (2025, 11, 1, 'a1')
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
render_engine/collection.py
CHANGED
|
@@ -288,6 +288,24 @@ class Collection(BaseObject):
|
|
|
288
288
|
feed.site = self.site
|
|
289
289
|
feed.render(route="./", theme_manager=self.site.theme_manager)
|
|
290
290
|
|
|
291
|
+
def create_entry(
|
|
292
|
+
self, filepath: Path = None, editor: str = None, content: str = None, metadata: dict = None
|
|
293
|
+
) -> str:
|
|
294
|
+
"""
|
|
295
|
+
Create a new entry for the Collection
|
|
296
|
+
|
|
297
|
+
:param filepath: Path object for the new entry
|
|
298
|
+
:param editor: Editor to open to edit the entry.
|
|
299
|
+
:param content: Content for the new entry
|
|
300
|
+
:param metadata: Metadata for the new entry
|
|
301
|
+
"""
|
|
302
|
+
context = copy.deepcopy(self._metadata_attrs())
|
|
303
|
+
if metadata:
|
|
304
|
+
context.update(metadata)
|
|
305
|
+
return self.content_manager.create_entry(
|
|
306
|
+
filepath=filepath, editor=editor, metadata=context, content=content or "Hello, world!"
|
|
307
|
+
)
|
|
308
|
+
|
|
291
309
|
|
|
292
310
|
def render_archives(archive, **kwargs) -> list[Archive]:
|
|
293
311
|
return [archive.render(pages=archive.pages, **kwargs) for archive in archive]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
from collections.abc import Generator, Iterable
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class ContentManager(ABC):
|
|
@@ -14,3 +15,8 @@ class ContentManager(ABC):
|
|
|
14
15
|
def __iter__(self) -> Generator:
|
|
15
16
|
"""Iterator for the ContentManager"""
|
|
16
17
|
yield from self.pages
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def create_entry(self, filepath: Path = None, editor: str = None, metadata: dict = None, content: str = None):
|
|
21
|
+
"""Create a new entry"""
|
|
22
|
+
...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import subprocess
|
|
1
2
|
from collections.abc import Iterable
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
|
|
@@ -34,3 +35,23 @@ class FileContentManager(ContentManager):
|
|
|
34
35
|
@pages.setter
|
|
35
36
|
def pages(self, value: Iterable):
|
|
36
37
|
self._pages = value
|
|
38
|
+
|
|
39
|
+
def create_entry(
|
|
40
|
+
self, filepath: Path = None, editor: str = None, metadata: dict = None, content: str = None
|
|
41
|
+
) -> str:
|
|
42
|
+
"""
|
|
43
|
+
Create a new entry for the Collection
|
|
44
|
+
|
|
45
|
+
:param filepath: Path object for the new entry
|
|
46
|
+
:param editor: Editor to open to edit the entry.
|
|
47
|
+
:param content: The content for the entry
|
|
48
|
+
:param metadata: Metadata for the new entry
|
|
49
|
+
"""
|
|
50
|
+
if not filepath:
|
|
51
|
+
raise ValueError("filepath needs to be specified.")
|
|
52
|
+
|
|
53
|
+
parsed_content = self.collection.Parser.create_entry(content=content, **metadata)
|
|
54
|
+
filepath.write_text(parsed_content)
|
|
55
|
+
if editor:
|
|
56
|
+
subprocess.run([editor, filepath])
|
|
57
|
+
return f"New entry created at {filepath} ."
|
render_engine/site.py
CHANGED
|
@@ -3,6 +3,7 @@ import logging
|
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
|
+
import rich
|
|
6
7
|
from jinja2 import FileSystemLoader, PrefixLoader
|
|
7
8
|
from rich.progress import Progress
|
|
8
9
|
|
|
@@ -13,6 +14,12 @@ from .plugins import PluginManager, handle_plugin_registration
|
|
|
13
14
|
from .site_map import SiteMap
|
|
14
15
|
from .themes import Theme, ThemeManager
|
|
15
16
|
|
|
17
|
+
try:
|
|
18
|
+
# Get the RE version for display. If it's not set it means we're working locally.
|
|
19
|
+
from render_engine.__version__ import __version__ as re_version
|
|
20
|
+
except ImportError:
|
|
21
|
+
re_version = "development"
|
|
22
|
+
|
|
16
23
|
|
|
17
24
|
class Site:
|
|
18
25
|
"""
|
|
@@ -251,7 +258,10 @@ class Site:
|
|
|
251
258
|
You can choose to call it manually in your file or
|
|
252
259
|
use the CLI command [`render-engine build`][src.render_engine.cli.build]
|
|
253
260
|
"""
|
|
254
|
-
|
|
261
|
+
rich.print(
|
|
262
|
+
f"[green]Building {repr(self.site_vars.get('SITE_TITLE', 'your site'))} "
|
|
263
|
+
f"with Render Engine version {re_version}"
|
|
264
|
+
)
|
|
255
265
|
with Progress() as progress:
|
|
256
266
|
task_site_map = progress.add_task("Generating site map", total=1)
|
|
257
267
|
self._site_map = SiteMap(self.route_list, self.site_vars.get("SITE_URL", ""))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: render_engine
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.11.1a1
|
|
4
4
|
Summary: A Flexible Static Site Generator for Python
|
|
5
5
|
Project-URL: homepage, https://github.com/render-engine/render-engine/
|
|
6
6
|
Project-URL: repository, https://github.com/render-engine/render-engine/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
render_engine/.gitignore,sha256=74oa8YR8gNxKxB6lCtoqmgtB2xpZnWM539Qsl4wI_lg,12
|
|
2
2
|
render_engine/__init__.py,sha256=3fgua4ZA9o1pvQ5unhY1gRARLXFqAu019NEYqZTjP20,154
|
|
3
3
|
render_engine/__main__.py,sha256=uI7aBBZz0qSDwwwD11nS5oltWsuLw9hStfYo8O1aNws,144
|
|
4
|
+
render_engine/__version__.py,sha256=BCpwT8NcnBJ07_dARP0flYekyhShasjtVTPdA443a-A,720
|
|
4
5
|
render_engine/_base_object.py,sha256=DIyLdQ6gS4a0DP46zwGYkYIyewh8uRFznJmaUch7d8M,3546
|
|
5
6
|
render_engine/archive.py,sha256=S3-kCmDNVKkEfKDKxcEk-sXkBD0vS0RDnFfPunYkU8g,2072
|
|
6
7
|
render_engine/blog.py,sha256=f9GqFUFsta0KZnFhCiajobpfQyALqvgI5sbLm6zt1zw,1571
|
|
7
|
-
render_engine/collection.py,sha256=
|
|
8
|
+
render_engine/collection.py,sha256=eqeVxZ_ASrOra7kayhAkPSHocpM1mbxwhsH6ZtK-oMk,11294
|
|
8
9
|
render_engine/engine.py,sha256=GOtUiq4ny5GHaLSCeH5u1Zk1JnWJVh63vK7etJiwS20,2843
|
|
9
10
|
render_engine/feeds.py,sha256=i-VHsb6pRplMzaenBn6oeqh9yI_N4WVUAExPox6iJgw,921
|
|
10
11
|
render_engine/hookspecs.py,sha256=GhOpw0zTQjfwWOFYYbJ4P7Cvq-oy1MmTPHmd90dr0kg,2292
|
|
@@ -12,12 +13,12 @@ render_engine/links.py,sha256=pKmQMTz8-yGX8IecHcrlF3Dkejk7cptaO3qCkQiHB9I,2560
|
|
|
12
13
|
render_engine/page.py,sha256=l6sKWNJ4gBtC_ONEc0u479q3znL-8Q7U_phNqXqmh6w,8988
|
|
13
14
|
render_engine/plugins.py,sha256=NXM8QTbbRV-DwgpQRoIhILijJBN4SyYg2Rkk1LUAuZM,4703
|
|
14
15
|
render_engine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
render_engine/site.py,sha256=
|
|
16
|
+
render_engine/site.py,sha256=aarHkveSVDOy7hRPzrx_ga3DmmirZQcLvcJdyw-b8lY,13329
|
|
16
17
|
render_engine/site_map.py,sha256=I1p_yMDMy1jpIivgNgZptnsxZa8NkcrpciVJE3DlFlQ,5422
|
|
17
18
|
render_engine/themes.py,sha256=TFG1rd34QCBvBWfeDbawgsn6kprmjsDTa1pdDSwDMic,4207
|
|
18
19
|
render_engine/content_managers/__init__.py,sha256=z1x99J0GNcfqYFrugD0EleiZR6b-sfM6zViDTH1iF0s,161
|
|
19
|
-
render_engine/content_managers/base_content_manager.py,sha256=
|
|
20
|
-
render_engine/content_managers/file_content_manager.py,sha256=
|
|
20
|
+
render_engine/content_managers/base_content_manager.py,sha256=umb2Tze7UE7ON74hOe_WiykOk9-xTPw40_l3W5Cy5_U,620
|
|
21
|
+
render_engine/content_managers/file_content_manager.py,sha256=pKyldWKGocI2WAY8H_6d9dWY26hUxm4N5_oavO_FxJ0,1884
|
|
21
22
|
render_engine/extras/__init__.py,sha256=L4jr4A7Jl-ODnSx1q2fP3_dBo37Dw6yepNRddu1nFNo,72
|
|
22
23
|
render_engine/parsers/markdown.py,sha256=0jpixCaoHaL0IRSvFIljJIRCvFkXoKTEYQNK38LwMDU,287
|
|
23
24
|
render_engine/render_engine_templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -35,7 +36,7 @@ render_engine/render_engine_templates/base_templates/_page.html,sha256=jjrY2BAwl
|
|
|
35
36
|
render_engine/render_engine_templates/components/footer.html,sha256=HkPGGhfN0HcYm7t8zgXWCQ3bsCbT8FxT4_n2-9e1zUE,74
|
|
36
37
|
render_engine/render_engine_templates/components/page_title.html,sha256=l8aE1TY94UPHXHqAyy6jv4IoN2Hv9cbrTPh7ILkMyxg,137
|
|
37
38
|
render_engine/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
render_engine-2025.
|
|
39
|
-
render_engine-2025.
|
|
40
|
-
render_engine-2025.
|
|
41
|
-
render_engine-2025.
|
|
39
|
+
render_engine-2025.11.1a1.dist-info/METADATA,sha256=xmk3ud0hPXdvQ4Svm3QHsCgwyNYbC6-vU_OBd24PvPA,11895
|
|
40
|
+
render_engine-2025.11.1a1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
41
|
+
render_engine-2025.11.1a1.dist-info/top_level.txt,sha256=aNGALDMsFyrusho04AvUjSivsgEE9tQp_LP_jGr312Q,14
|
|
42
|
+
render_engine-2025.11.1a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|