{"id":17103030,"url":"https://github.com/helpermethod/termplates","last_synced_at":"2025-03-23T19:40:53.621Z","repository":{"id":146262730,"uuid":"161521544","full_name":"helpermethod/termplates","owner":"helpermethod","description":"Mustache Templates for the Commandline","archived":false,"fork":false,"pushed_at":"2021-11-30T11:40:49.000Z","size":77,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T02:59:43.154Z","etag":null,"topics":["cli","command-line","escape-codes","mustache"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helpermethod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-12T17:20:52.000Z","updated_at":"2023-03-08T04:19:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f4cb4e7-9778-4c59-bbf1-ffe6ed80cd09","html_url":"https://github.com/helpermethod/termplates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpermethod%2Ftermplates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpermethod%2Ftermplates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpermethod%2Ftermplates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpermethod%2Ftermplates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helpermethod","download_url":"https://codeload.github.com/helpermethod/termplates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245161623,"owners_count":20570690,"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":["cli","command-line","escape-codes","mustache"],"created_at":"2024-10-14T15:31:11.945Z","updated_at":"2025-03-23T19:40:53.590Z","avatar_url":"https://github.com/helpermethod.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TERMplates\n\n[![Download](https://api.bintray.com/packages/helpermethod/maven/termplates/images/download.svg)](https://bintray.com/helpermethod/maven/termplates/_latestVersion)\n\n`TERMplates` is a small wrapper around [mustache.java](https://github.com/spullara/mustache.java) which adds support for\nANSI escape codes to render colors and text decorations.\n\n## Features\n\n* **Colors** Apply foreground and background colors.\n* **Text Decorations** Underline and bolden text.\n* **TTY detection** Ignore ANSI escape codes when not started from an interactive commandline.\n\n## Installation\n\n### Maven\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ebintray\u003c/id\u003e\n        \u003curl\u003ehttp://dl.bintray.com/helpermethod/maven\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.helpermethod\u003c/groupId\u003e\n  \u003cartifactId\u003etermplates\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nrepositories {\n    maven {\n        url  \"https://dl.bintray.com/helpermethod/maven\"\n    }\n}\n\ncompile 'com.github.helpermethod:termplates:0.1.0'\n```\n\n## Usage\n\nThe static `renderInline` method takes a Mustache template of type `String` and a model of type `Map` or `Object`\nand returns the rendered template as a `String`.\n\n```java\nvar model = new Map.of(\"name\",\"TERMplates\");\n\nSystem.out.println(Termplates.renderInline(\"Hello {{name}}!\", model));\n```\n\nColors can be accessed by using the {{term}} namespace.\n\n```java\nSystem.out.println(Termplates.renderInline(\"Hello {{#term.red}}{{name}}{{/term.red}}\", Map.of(\"name\", \"TERMplates\")));\n```\n\nColors and text decorations can be combined by nesting them (for a full list of supported escape sequences, see [ANSI Escape Codes](#ansi-escape-codes).\n).\n\n```java\nSystem.out.println(Termplates.renderInline(\"Hello {{#term.bold}}{{#term.red}}{{name}}{{/term.red}}{{term.bold}}\", Map.of(\"name\", \"TERMplates\")));\n```\n\nFor rendering more complex templates, create a file ending on `.mustache` under `src/main/resources/templates`, e.g.\n`movies.mustache`.\n\n```hbs\n{{#term.underline}}MOVIES{{/term.underline}}\n\n{{! iterates over the `movies` array and renders each element on its own line }}\n{{#movies}}\n{{.}}\n{{/movies}}\n```\n\nUse the static `renderFile` method to render the file containing the method.\n\n```java\n// note that you reference the file only by its prefix, i.e. \"movies\", not \"movies.mustache\"\nSystem.out.println(renderFile(\"movies\", Map.of(\"movies\", List.of(\"Evil Dead\", \"Evil Dead 2\", \"Army Of Darkness\"))));\n```\n\n## ANSI Escape Codes\n\n## Foreground Colors\n\n| Color | Function |\n| --- | --- |\n| black | `term.black` |\n| red | `term.red` |\n| green | `term.green` |\n| yellow | `term.yellow` |\n| blue | `term.magenta` |\n| magenta | `term.magenta` |\n| cyan | `term.cyan` |\n| white | `term.white` |\n\n## Text Decorations\n\n| Decoration | Function |\n| --- | --- |\n| bold | `term.bold` |\n| underline | `term.underline` |\n| reverse | `term.reverse` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpermethod%2Ftermplates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpermethod%2Ftermplates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpermethod%2Ftermplates/lists"}