render-engine 2025.10.3a1__tar.gz → 2025.11.1__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.
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.gitignore +2 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/PKG-INFO +1 -1
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/collection.md +2 -1
- render_engine-2025.11.1/docs/docs/content_manager.md +67 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/mkdocs.yml +1 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/pyproject.toml +1 -1
- render_engine-2025.11.1/src/render_engine/__version__.py +34 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/collection.py +18 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/content_managers/base_content_manager.py +6 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/content_managers/file_content_manager.py +21 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/site.py +11 -1
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/PKG-INFO +1 -1
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/SOURCES.txt +2 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_collections.py +56 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.all-contributorsrc +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.devcontainer/Dockerfile +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.devcontainer/devcontainer.json +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.devcontainer/setup.sh +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/FUNDING.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/ISSUE_TEMPLATE/config.yaml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/ISSUE_TEMPLATE/form_issue_template.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/dependabot-bot.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/dependabot.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/labeler.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/release.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/devcontainer-ci.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/labeler.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/lint.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/publish.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/scorecard.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/workflows/test.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.markdownlint.json +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.pre-commit-config.yaml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.readthedocs.yml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/.vscode/tasks.json +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/CONTRIBUTING.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/README.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/SECURITY.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/.markdownlint.json +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/archive.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/create environment vs code.gif +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/create-app-help.png +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/create-codespace.gif +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/launching a dev container.gif +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/render-engine-init-help.png +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/render-engine-init.png +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/cli.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/CODE_OF_CONDUCT.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/CONTRIBUTING.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/environment_setup.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/custom_collections.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/feeds.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/building-your-site.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/creating-a-collection.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/creating-a-page.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/creating-your-app.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/getting-started.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/installation.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/layout.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/index.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/page.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/parsers.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/plugins.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/site.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/site_map.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/templates.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/theme_management.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/requirements.txt +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/noxfile.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/requirements.txt +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/setup.cfg +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/.gitignore +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/__init__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/__main__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/_base_object.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/archive.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/blog.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/content_managers/__init__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/engine.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/extras/__init__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/feeds.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/hookspecs.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/links.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/page.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/parsers/markdown.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/plugins.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/py.typed +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/__init__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/archive.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/base.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/base_collection_path.md +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/base_templates/_archive.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/base_templates/_base.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/base_templates/_page.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/components/footer.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/components/page_title.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/page.html +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/rss2.0.xml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/rss2.0_items.xml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/sitemap.xml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/render_engine_templates/sitemap_item.xml +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/site_map.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/themes.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/utils/__init__.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/dependency_links.txt +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/requires.txt +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/top_level.txt +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/conftest.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_archive.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_base_object.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_blog.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_engine.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_feeds/conftest_feed.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_feeds/test_feeds.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_page.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_parsers_remove_2024_3_1.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_plugins.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_site.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_site_map.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_templates/test_base_html.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_theme_manager.py +0 -0
- {render_engine-2025.10.3a1 → render_engine-2025.11.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: render_engine
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.11.1
|
|
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/
|
|
@@ -46,7 +46,8 @@ sort_reverse: bool = False
|
|
|
46
46
|
title: str
|
|
47
47
|
template: str | None
|
|
48
48
|
archive_template str | None: The template to use for the archive pages.
|
|
49
|
-
|
|
49
|
+
ContentManager: type[ContentManager] | None = FileContentManager: The `ContentManager` to use.
|
|
50
|
+
content_manager_extras: dict[str, Any]: Configuration options to send to the `ContentManager` during instantiation.
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
## Attributes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Enhancing Functionality with Content Managers"
|
|
3
|
+
description: "Guide to using creating Content Managers to use alternate content storage systems."
|
|
4
|
+
date: August 22, 2024
|
|
5
|
+
tags: ["content_manager", "render-engine", "customization"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Content Managers are a way to control how and where your content is stored.
|
|
9
|
+
|
|
10
|
+
## Introduction
|
|
11
|
+
|
|
12
|
+
Render Engine `Collection` uses a `ContentManager` to manage the storage of content for site generation. By default
|
|
13
|
+
content is stored in the file system with each piece of content existing in a discrete file. With an alternate
|
|
14
|
+
`ContentManager` the content can be stored in a database, JSON file, or other alternate data store.
|
|
15
|
+
|
|
16
|
+
## Selecting a `ContentManager`
|
|
17
|
+
|
|
18
|
+
The `ContentManager` for a given [`Collection`](collection.md) is controlled by the `ContentManager` attribute. When
|
|
19
|
+
the class is instantiated the `ContentManager` is also instantiated with any `content_manager_extras` being passed
|
|
20
|
+
as arguments. To access the `ContentManager` of a given `Collection` use the `content_manager` attribute.
|
|
21
|
+
|
|
22
|
+
## Creating a `ContentManager`
|
|
23
|
+
|
|
24
|
+
To create a `ContentManager` create a sub-class of `ContentManager` that implements the following methods:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
@property
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def pages(self) -> Iterable:
|
|
30
|
+
"""The Page objects managed by the content manager"""
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
@abstractmethod
|
|
34
|
+
def create_entry(self, filepath: Path = None, editor: str = None, metadata: dict = None, content: str = None):
|
|
35
|
+
"""Create a new entry"""
|
|
36
|
+
...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### `pages`
|
|
40
|
+
|
|
41
|
+
The `pages` property is how the `Collection` accesses its content. It is a method that _must_ be implemented by
|
|
42
|
+
every `ContentManager`. An example `pages` implementation (from the
|
|
43
|
+
[`FileContentManger`](https://github.com/render-engine/render-engine/blob/main/src/render_engine/content_managers/file_content_manager.py)) is:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
@property
|
|
47
|
+
def pages(self) -> Iterable:
|
|
48
|
+
if self._pages is None:
|
|
49
|
+
self._pages = [self.collection.get_page(page) for page in self.iter_content_path()]
|
|
50
|
+
yield from self._pages
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `create_entry`
|
|
54
|
+
|
|
55
|
+
The `create_entry` method is used by the Render Engine CLI tool to add new entries. It is responsible for adding
|
|
56
|
+
the new entry to the datastore and, if an `editor` is specified, giving the user the ability to edit the new entry
|
|
57
|
+
prior to committing the entry to the datastore.
|
|
58
|
+
|
|
59
|
+
#### Arguments
|
|
60
|
+
|
|
61
|
+
- `filepath: Path`: The path on the filesystem to store the new entry.
|
|
62
|
+
- `editor: str`: The text editor to open for editing the new entry.
|
|
63
|
+
- `content: str`: The initial content for the new entry.
|
|
64
|
+
- `metadata: dict`: The metadata for the new entry.
|
|
65
|
+
|
|
66
|
+
!!! Note
|
|
67
|
+
Not every `ContentManager` actually needs all the arguments that are passed.
|
|
@@ -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.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (2025, 11, 1)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'g3ef9c0acb'
|
|
@@ -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} ."
|
|
@@ -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.1
|
|
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/
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/SOURCES.txt
RENAMED
|
@@ -34,6 +34,7 @@ docs/requirements.txt
|
|
|
34
34
|
docs/docs/archive.md
|
|
35
35
|
docs/docs/cli.md
|
|
36
36
|
docs/docs/collection.md
|
|
37
|
+
docs/docs/content_manager.md
|
|
37
38
|
docs/docs/custom_collections.md
|
|
38
39
|
docs/docs/feeds.md
|
|
39
40
|
docs/docs/index.md
|
|
@@ -63,6 +64,7 @@ docs/docs/getting-started/layout.md
|
|
|
63
64
|
src/render_engine/.gitignore
|
|
64
65
|
src/render_engine/__init__.py
|
|
65
66
|
src/render_engine/__main__.py
|
|
67
|
+
src/render_engine/__version__.py
|
|
66
68
|
src/render_engine/_base_object.py
|
|
67
69
|
src/render_engine/archive.py
|
|
68
70
|
src/render_engine/blog.py
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pathlib
|
|
2
|
+
import textwrap
|
|
2
3
|
|
|
3
4
|
import pluggy
|
|
4
5
|
import pytest
|
|
@@ -360,3 +361,58 @@ def test_collection_custom_sort_by_list_with_date():
|
|
|
360
361
|
|
|
361
362
|
# Verify the sorted order by checking custom_sort_content values
|
|
362
363
|
assert [page.custom_sort_content for page in sorted_pages] == [page.custom_sort_content for page in expected_pages]
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
@pytest.mark.parametrize(
|
|
367
|
+
"content, context, expected",
|
|
368
|
+
[
|
|
369
|
+
(
|
|
370
|
+
"",
|
|
371
|
+
{"title": "title"},
|
|
372
|
+
textwrap.dedent("""---
|
|
373
|
+
title: title
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
Hello, world!"""),
|
|
377
|
+
),
|
|
378
|
+
(
|
|
379
|
+
"test",
|
|
380
|
+
{},
|
|
381
|
+
textwrap.dedent("""---
|
|
382
|
+
title: Untitled Entry
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
test"""),
|
|
386
|
+
),
|
|
387
|
+
(
|
|
388
|
+
"",
|
|
389
|
+
{},
|
|
390
|
+
textwrap.dedent("""---
|
|
391
|
+
title: Untitled Entry
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
Hello, world!"""),
|
|
395
|
+
),
|
|
396
|
+
],
|
|
397
|
+
)
|
|
398
|
+
def test_create_entry(tmp_path: pathlib.Path, content, context, expected):
|
|
399
|
+
"""Test the create_entry method"""
|
|
400
|
+
tmp_dir = tmp_path / "content"
|
|
401
|
+
tmp_dir.mkdir()
|
|
402
|
+
|
|
403
|
+
class BasicCollection(Collection):
|
|
404
|
+
content_path = tmp_dir.absolute()
|
|
405
|
+
|
|
406
|
+
filename = "test.md"
|
|
407
|
+
filepath = tmp_dir / filename
|
|
408
|
+
assert str(filepath) in BasicCollection().create_entry(
|
|
409
|
+
filepath=filepath, editor=None, content=content, metadata=context
|
|
410
|
+
)
|
|
411
|
+
assert filepath.read_text().strip() == expected
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
def test_create_entry_no_filename():
|
|
415
|
+
"""Test create_entry with no filename raises an exception"""
|
|
416
|
+
# Since the base Collection object uses a FileContentManager
|
|
417
|
+
with pytest.raises(ValueError):
|
|
418
|
+
Collection().create_entry()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/.github/ISSUE_TEMPLATE/form_issue_template.yml
RENAMED
|
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
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/launching a dev container.gif
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/render-engine-init-help.png
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/assets/render-engine-init.png
RENAMED
|
File without changes
|
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/CODE_OF_CONDUCT.md
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/CONTRIBUTING.md
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/contributing/environment_setup.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/creating-a-page.md
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/creating-your-app.md
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/getting-started.md
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/docs/docs/getting-started/installation.md
RENAMED
|
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
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine/content_managers/__init__.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/requires.txt
RENAMED
|
File without changes
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/src/render_engine.egg-info/top_level.txt
RENAMED
|
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
|
{render_engine-2025.10.3a1 → render_engine-2025.11.1}/tests/test_templates/test_base_html.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|