{"id":13440070,"url":"https://github.com/rustache/rustache","last_synced_at":"2025-12-12T14:48:05.815Z","repository":{"id":20951526,"uuid":"24240063","full_name":"rustache/rustache","owner":"rustache","description":"A flexible template engine for Rust","archived":false,"fork":false,"pushed_at":"2018-11-06T09:03:04.000Z","size":2621,"stargazers_count":210,"open_issues_count":5,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-14T17:22:57.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rustache.github.io","language":"Rust","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/rustache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-19T18:06:17.000Z","updated_at":"2024-03-29T17:26:29.000Z","dependencies_parsed_at":"2022-08-17T22:40:35.965Z","dependency_job_id":null,"html_url":"https://github.com/rustache/rustache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustache%2Frustache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustache%2Frustache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustache%2Frustache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustache%2Frustache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustache","download_url":"https://codeload.github.com/rustache/rustache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221745242,"owners_count":16873739,"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-07-31T03:01:19.538Z","updated_at":"2025-12-12T14:48:05.810Z","avatar_url":"https://github.com/rustache.png","language":"Rust","readme":"Rustache [![Build Status](https://travis-ci.org/rustache/rustache.svg?branch=master)](https://travis-ci.org/rustache/rustache)\n====\n\n[Rustache](https://rustache.github.io/) is a [Rust](https://www.rust-lang.org/) implementation of the [Mustache](https://mustache.github.io/) spec.\n\n## Documentation\n\nThe different Mustache tags are documented at the [mustache(5)](http://mustache.github.com/mustache.5.html) man page.\n\nThe project's docs page is located [here](https://docs.rs/rustache/).\n\n## Install\n\nInstall it through [Cargo](https://crates.io/):\n\n```toml\nrustache = \"^0.1\"\n```\n\nThen link it within your crate like so:\n\n```rust\nextern crate rustache;\n```\n\n## API Methods\n\nThe main forward interface that users will interact with when using Rustache\nis the `render` method provided by the `rustache::Render` trait like so:\n\n```rust\n// Renders the given template string\nlet data = rustache::HashBuilder::new().insert(\"name\", \"your name\");\nlet mut out = Cursor::new(Vec::new());\ndata.render(\"{{ name }}\", \u0026mut out).unwrap();\nprintln!(\"{}\", String::from_utf8(out.into_inner()).unwrap());\n```\n\n## Examples\n\nHere's an example of how to pass in data to the `render_text` method using the `HashBuilder`:\n\n```rust\nlet data = HashBuilder::new()\n    .insert(\"name\", \"Bob\");\nlet mut out = Cursor::new(Vec::new());\n\ndata.render(\"{{ name }}\", \u0026mut out);\n```\n\nHere's an example of how to pass in data in the form of a JSON `enum` to a `render` method:\n\n```rust\nlet data = json::from_str(r#\"{\"name\": \"Bob\"}\"#);\nlet mut out = Cursor::new(Vec::new());\n\ndata.render(\"{{ name }}\", \u0026mut out);\n```\n\nFor more examples please see the `tests` directory.\n\n## Testing\n\nSimply clone and run:\n\n```bash\ncargo test\n```\n\n## Roadmap\n\n- [ ] Full Mustache spec compliance.\n\t- [ ] Comment and Section whitespace handling\n\t- [ ] Handle change of delimeters\n\n- [ ] Thread errors through the parser and compiler:\n\n- [ ] Real world project examples.\n\n- [ ] Handle Build and Parser operations concurrently\n\n## Contribute\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.\n\n## License\n\nCopyright (c) 2014 Team Rustache\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nInspired by https://github.com/erickt/rust-mustache:\n\nCopyright (c) 2012 Erick Tryzelaar\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["Libraries","代码","库 Libraries","Rust","库"],"sub_categories":["Template engine","模板引擎","模板引擎 Template engine"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustache%2Frustache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustache%2Frustache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustache%2Frustache/lists"}