feat(devgen): add custom template rendering function

- New Features:
  - Introduced `render_custom_template()` function to render Jinja2 templates from strings.
  - Enables dynamic template rendering without requiring file-based templates.
```
This commit is contained in:
sankalp committed 2025-12-25 00:04:40 +05:45
1 parent 37e5d94373
commit f2ff3327c3
1 file changed
+7
+7
View File
@@ -212,6 +212,13 @@ def load_template_env(sub_dir: str) -> Environment:
return Environment(loader=FileSystemLoader(template_dir))
def render_custom_template(template_str: str, **context) -> str:
"""Renders a Jinja2 template from a string."""
env = Environment()
template = env.from_string(template_str)
return template.render(**context)
def load_config() -> Dict[str, Any]:
config_path = Path.home() / ".devgen.yaml"