{"id":16334876,"url":"https://github.com/ncfavier/templa","last_synced_at":"2025-08-08T16:11:02.592Z","repository":{"id":66325203,"uuid":"301121491","full_name":"ncfavier/templa","owner":"ncfavier","description":"A script-based template engine","archived":false,"fork":false,"pushed_at":"2020-10-04T12:16:33.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T11:45:45.299Z","etag":null,"topics":["template-engine"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncfavier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-10-04T12:14:25.000Z","updated_at":"2020-10-04T14:58:15.000Z","dependencies_parsed_at":"2023-03-10T23:49:28.080Z","dependency_job_id":null,"html_url":"https://github.com/ncfavier/templa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ncfavier/templa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncfavier%2Ftempla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncfavier%2Ftempla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncfavier%2Ftempla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncfavier%2Ftempla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncfavier","download_url":"https://codeload.github.com/ncfavier/templa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncfavier%2Ftempla/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269449458,"owners_count":24419086,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["template-engine"],"created_at":"2024-10-10T23:39:30.312Z","updated_at":"2025-08-08T16:11:02.567Z","avatar_url":"https://github.com/ncfavier.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# templa\n\nA simple and *very* stupid [template engine](https://en.wikipedia.org/wiki/Template_processor).\n\nIt executes **scripts** embedded in **template files** and substitutes their output in-place.\n\n## Principle\n\n*templa* processes **template files** and generates **output files** according to the following principle:\n\nAny segment of a file between a line that starts with `#!` (a *shebang*, possibly indented) and a line that ends with `!#` (or the end of the file) is considered an **embedded script**.\n\nThis embedded script is isolated in a temporary file, with the proper amount of indentation removed and the final `!#` stripped, and then executed. The standard output of that program is added to the output file, replacing the embedded script.\n\nA literal `#!` can be escaped with `##!`.\n\n## Example\n\n#### Input\n```html\n\u003ch1\u003eFiles\u003c/h1\u003e\n\u003cul\u003e\n    #!/bin/bash\n    for file in *; do\n        printf '\u003cli\u003e%s\u003c/li\u003e\\n' \"$file\"\n    done !#\n\u003c/ul\u003e\n```\n\n#### Output\n```html\n\u003ch1\u003eFiles\u003c/h1\u003e\n\u003cul\u003e\n    \u003cli\u003eLICENSE\u003c/li\u003e\n    \u003cli\u003eMakefile\u003c/li\u003e\n    \u003cli\u003eREADME.md\u003c/li\u003e\n    \u003cli\u003etempla\u003c/li\u003e\n    \u003cli\u003etemplates\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n----------\n\nTo see a live example, check out [`templates/README.md`](/templa/tree/templates/README.md).\n\n## Installing\n\n*templa* requires **Bash version 4** or later, as well as **GNU coreutils**. These should be present on most GNU/Linux systems.\n\nClone this repository on your system and copy the `templa` executable to some location in your PATH, e.g. `/usr/local/bin` or `~/.bin`.\n\n## Using\n\n    Usage: templa [-qh] [-t target] templates...\n        Render the templates from TEMPLATES to the TARGET directory.\n    \n    Options:\n        -t  Choose the target directory. By default, the current directory is used.\n            If - is given, render everything to standard output.\n        -v  Verbose mode, print file names to standard output before rendering them.\n        -q  Quiet mode, don't print errors.\n        -h  Show this help message.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncfavier%2Ftempla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncfavier%2Ftempla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncfavier%2Ftempla/lists"}