{"id":15497269,"url":"https://github.com/jwerle/mush","last_synced_at":"2025-07-16T15:33:38.822Z","repository":{"id":12587219,"uuid":"15257966","full_name":"jwerle/mush","owner":"jwerle","description":"Mustache templates for bash","archived":false,"fork":false,"pushed_at":"2023-02-17T18:17:41.000Z","size":33,"stargazers_count":146,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T12:21:30.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/jwerle.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}},"created_at":"2013-12-17T15:21:58.000Z","updated_at":"2024-12-17T11:15:57.000Z","dependencies_parsed_at":"2022-09-11T16:41:25.432Z","dependency_job_id":null,"html_url":"https://github.com/jwerle/mush","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jwerle/mush","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fmush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fmush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fmush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fmush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/mush/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fmush/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265521465,"owners_count":23781514,"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":[],"created_at":"2024-10-02T08:32:26.918Z","updated_at":"2025-07-16T15:33:38.781Z","avatar_url":"https://github.com/jwerle.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"mush\n====\n\nMustache templates for bash\n\n## install\n\nWith [bpkg](https://github.com/bpkg/bpkg):\n\n```sh\n$ bpkg install -g jwerle/mush\n```\n\nFrom source:\n\n```sh\n$ make install\n```\n\n## usage\n\nSuppose you have a template file:\n\n***./template.ms***\n\n```\nVAR={{VAR}}\n```\n\nYou can compile it like such: \n\n```sh\n$ cat ./template.ms | VAR=VALUE mush\nVAR=123\n```\n\nYou can utilize stdin in the same way with `echo`\n\n```sh\necho \"Today's date is {{DATE}}\" | DATE=`date +%D` mush\nToday's date is 12/17/13\n```\n\nVariables are passed to the view environment variable\ndefinition. Due to the way variables are scoped to the\ntemplates. All environment variables are available to the\ntemplate. This includes variables like `$HOME` and `$USER`\n\nCompile a HTML file with partial:\n\n***index.html.ms*** (layout)\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/\u003e\n    \u003ctitle\u003e{{title}}\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"{{main_css}}\" type=\"text/css\" /\u003e\n    \u003cscript type=\"text/javascript\" src=\"{{main_js}}\" charset=\"utf-8\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\n      {{content}}\n    \u003c/div\u003e\n   \u003c/body\u003e\n\u003c/html\u003e\n```\n\n***page.html.ms*** (partial)\n\n```html\n\u003cdiv id=\"{{name}}\" class=\"page\"\u003e This is the {{name}} page \u003c/div\u003e\n```\n\n```sh\n$ cat index.html.ms | \\\n  title=\"Awesome Web Site\" \\\n  main_css=\"/css/main.css\" \\\n  main_js=\"/js/main.js\" \\\n  content=\"`cat page.html.ms | name=home mush`\" \\\n  mush\n```\n\nThis will yield:\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/\u003e\n    \u003ctitle\u003efoo\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"/css/main.css\" type=\"text/css\" /\u003e\n    \u003cscript type=\"text/javascript\" src=\"/js/app.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\n      \u003cdiv id=\"home\" class=\"page\"\u003e This is the home page \u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## api\n\n```\nusage: mush [-ehV] [-f \u003cfile\u003e] [-o \u003cfile\u003e]\n\nexamples:\n  $ cat file.ms | FOO=BAR mush\n  $ VALUE=123 mush -f file.ms -o file\n  $ echo \"Today's date is {{DATE}}\" | DATE=`date +%D` mush\n  $ cat ./template.ms | VAR=VALUE mush\n\noptions:\n  -f, --file \u003cfile\u003e       file to parse\n  -o, --out \u003cfile\u003e        output file\n  -e, --escape            escapes html html entities\n  -h, --help              display this message\n  -V, --version           output version\n```\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fmush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Fmush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fmush/lists"}