{"id":14968089,"url":"https://github.com/mirkolenz/makejinja","last_synced_at":"2025-04-13T05:06:18.818Z","repository":{"id":64579716,"uuid":"576770710","full_name":"mirkolenz/makejinja","owner":"mirkolenz","description":"Generate entire directory structures using Jinja templates with support for external data and custom plugins.","archived":false,"fork":false,"pushed_at":"2025-04-05T20:08:19.000Z","size":941,"stargazers_count":86,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T00:42:32.673Z","etag":null,"topics":["ansible","automation","cli","dashboard","docker","generator","hassio","home-assistant","jinja","jinja2","library","lovelace","nix","python","template","templating","tools"],"latest_commit_sha":null,"homepage":"https://mirkolenz.github.io/makejinja/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirkolenz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-10T23:17:03.000Z","updated_at":"2025-04-05T20:08:22.000Z","dependencies_parsed_at":"2022-12-20T12:48:39.809Z","dependency_job_id":"6521f92c-b3c8-43ed-adb8-00a82029f3fc","html_url":"https://github.com/mirkolenz/makejinja","commit_stats":{"total_commits":589,"total_committers":8,"mean_commits":73.625,"dds":0.4193548387096774,"last_synced_commit":"dc930eab1a341930113e8d14676eec09dba0cd6a"},"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fmakejinja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fmakejinja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fmakejinja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fmakejinja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirkolenz","download_url":"https://codeload.github.com/mirkolenz/makejinja/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665749,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","automation","cli","dashboard","docker","generator","hassio","home-assistant","jinja","jinja2","library","lovelace","nix","python","template","templating","tools"],"created_at":"2024-09-24T13:39:16.561Z","updated_at":"2025-04-13T05:06:18.799Z","avatar_url":"https://github.com/mirkolenz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003ch1\u003e\u003cp align=\"center\"\u003emakejinja\u003c/p\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"256px\" alt=\"makejinja logo\" src=\"https://raw.githubusercontent.com/mirkolenz/makejinja/main/assets/logo.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/makejinja/\"\u003ePyPI\u003c/a\u003e |\n  \u003ca href=\"https://github.com/users/mirkolenz/packages/container/package/makejinja\"\u003eDocker\u003c/a\u003e |\n  \u003ca href=\"https://mirkolenz.github.io/makejinja\"\u003eDocs\u003c/a\u003e |\n  \u003ca href=\"https://github.com/mirkolenz/makejinja/tree/main/tests/data\"\u003eExample\u003c/a\u003e |\n  \u003ca href=\"https://jinja.palletsprojects.com/en/3.1.x/templates\"\u003eJinja reference\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Generate entire directory structures using Jinja templates with support for external data and custom plugins.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"makejinja demonstration\" src=\"https://mirkolenz.github.io/makejinja/assets/demo.gif\" /\u003e\n\u003c/p\u003e\n\n---\n\n\u003c!-- PDOC_START --\u003e\n\nmakejinja can be used to automatically generate files from [Jinja templates](https://jinja.palletsprojects.com/en/3.1.x/templates).\nIt is conceptually similar to [Ansible templates](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html) since both are built on top of Jinja.\nHowever, makejinja is a standalone tool that can be used without Ansible and offers some advanced features like custom plugins.\nA use case for this tool is generating config files for [Home Assistant](https://www.home-assistant.io/):\nUsing the same language that the built-in templates use, you can greatly simplify your configuration.\nAn [example for Home Assistant](https://github.com/mirkolenz/makejinja/tree/main/tests/data) can be found in the tests directory.\n\n## Highlights\n\n- Recursively render nested directories containing template files to a common output directory.\n- Load data files containing variables to use in your Jinja templates from YAML, TOML, and Python files.\n- Write custom [plugins](https://mirkolenz.github.io/makejinja/makejinja/plugin.html#Plugin) to extend the functionality of makejinja.\n- Adjust all Jinja options (e.g., whitespace behavior and delimiters) to your needs via CLI flags or a config file.\n\n## Installation\n\nThe tool is written in Python and can be installed via pip, nix, and docker.\nIt can be used as a CLI tool or as a Python library.\n\n### PIP\n\nmakejinja is available on [PyPI](https://pypi.org/project/makejinja/) and can be installed via `pip`:\n\n```shell\npip install makejinja\nmakejinja -i ./input -o ./output\n```\n\n### Nix\n\nIf you use the `nix` package manager, you can add this repository as an input to your flake and use `makejinja.packages.${system}.default` or apply the overlay `makejinja.overlays.default`.\nYou can also run it directly as follows:\n\n```shell\nnix run github:mirkolenz/makejinja -- -i ./input -o ./output\n```\n\n### Docker\n\nWe automatically publish an image to the [GitHub Container Registry](https://ghcr.io/mirkolenz/makejinja).\nTo use it, mount a directory to the container and pass the options as the command:\n\n```shell\ndocker run --rm -v $(pwd)/data:/data ghcr.io/mirkolenz/makejinja:latest -i /data/input -o /data/output\n```\n\n## Usage in Terminal / Command Line\n\nIn its default configuration, makejinja searches the input directory recursively for files ending in `.jinja`.\nIt then renders these files and writes them to the output directory, preserving the directory structure.\nOur [documentation](https://mirkolenz.github.io/makejinja/makejinja/cli.html) contains a detailed description of all options and can also be accessed via `makejinja --help`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirkolenz%2Fmakejinja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirkolenz%2Fmakejinja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirkolenz%2Fmakejinja/lists"}