{"id":18000194,"url":"https://github.com/stackbuilders/stache","last_synced_at":"2025-04-06T03:10:42.285Z","repository":{"id":9363307,"uuid":"61818483","full_name":"stackbuilders/stache","owner":"stackbuilders","description":"Mustache templates for Haskell","archived":false,"fork":false,"pushed_at":"2024-10-29T04:05:50.000Z","size":291,"stargazers_count":28,"open_issues_count":4,"forks_count":10,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-10-30T00:35:08.395Z","etag":null,"topics":["hacktoberfest","hacktoberfest2023","haskell","mustache-templates"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/stackbuilders.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":"2016-06-23T16:03:12.000Z","updated_at":"2024-10-29T04:05:52.000Z","dependencies_parsed_at":"2022-08-20T23:10:44.508Z","dependency_job_id":"104d938f-9313-4306-9f51-547184cf5801","html_url":"https://github.com/stackbuilders/stache","commit_stats":{"total_commits":208,"total_committers":9,"mean_commits":23.11111111111111,"dds":"0.48557692307692313","last_synced_commit":"1abf06c81cffaddf28d7ef0a423cde0aa984cfbf"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fstache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fstache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fstache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fstache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbuilders","download_url":"https://codeload.github.com/stackbuilders/stache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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":["hacktoberfest","hacktoberfest2023","haskell","mustache-templates"],"created_at":"2024-10-29T23:10:20.683Z","updated_at":"2025-04-06T03:10:42.235Z","avatar_url":"https://github.com/stackbuilders.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stache\n\n[![Hackage](https://img.shields.io/hackage/v/stache.svg?style=flat)](https://hackage.haskell.org/package/stache)\n[![Stackage Nightly](http://stackage.org/package/stache/badge/nightly)](http://stackage.org/nightly/package/stache)\n[![Stackage LTS](http://stackage.org/package/stache/badge/lts)](http://stackage.org/lts/package/stache)\n[![CI](https://github.com/stackbuilders/stache/actions/workflows/ci.yaml/badge.svg)](https://github.com/stackbuilders/stache/actions/workflows/ci.yaml)\n\nThis is a Haskell implementation of Mustache templates. The implementation\nconforms to the version 1.1.3 of the official [Mustache\nspecification](https://github.com/mustache/spec). It has a minimal but\ncomplete API—three functions to compile templates (from directory, from\nfile, and from lazy text) and one to render them.\n\nThe implementation uses the Megaparsec parsing library to parse the\ntemplates which results in high-quality error messages.\n\nFor rendering one only needs to create Aeson's `Value` that is used for\ninterpolation of template variables. Since the library re-uses Aeson's\ninstances and most data types in the Haskell ecosystem are instances of\nclasses like `Data.Aeson.ToJSON`, the process is simple for the end user.\n\nTemplate Haskell helpers for compilation of templates at compile time are\navailable in the `Text.Mustache.Compile.TH` module.\n\nOne feature that is not currently supported is lambdas. The feature is\nmarked as optional in the spec and can be emulated via processing of parsed\ntemplate representation. The decision to drop lambdas is intentional, for\nthe sake of simplicity and better integration with Aeson.\n\n## Usage\n\nHere is an example of basic usage:\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Main (main) where\n\nimport Data.Aeson\nimport Data.Text\nimport Text.Megaparsec\nimport Text.Mustache\nimport qualified Data.Text.Lazy.IO as TIO\n\nmain :: IO ()\nmain = do\n  let res = compileMustacheText \"foo\"\n        \"Hi, {{name}}! You have:\\n{{#things}}\\n  * {{.}}\\n{{/things}}\\n\"\n  case res of\n    Left bundle -\u003e putStrLn (errorBundlePretty bundle)\n    Right template -\u003e TIO.putStr $ renderMustache template $ object\n      [ \"name\"   .= (\"John\" :: Text)\n      , \"things\" .= [\"pen\" :: Text, \"candle\", \"egg\"]\n      ]\n```\n\nIf I run the program, it prints the following:\n\n```\nHi, John! You have:\n  * pen\n  * candle\n  * egg\n```\n\nFor more information about Mustache templates the following links may be\nhelpful:\n\n* The official Mustache site: https://mustache.github.io/\n* The manual: https://mustache.github.io/mustache.5.html\n* The specification: https://github.com/mustache/spec\n* Stack Builders Stache tutorial: https://www.stackbuilders.com/tutorials/haskell/mustache-templates/\n\n## License\n\nMIT, see [the LICENSE file](LICENSE).\n\n## Contributing\n\nDo you want to contribute to this project? Please take a look at our [contributing guideline](/docs/CONTRIBUTING.md) to know how you can help us build it.\n\n---\n\u003cimg src=\"https://www.stackbuilders.com/media/images/Sb-supports.original.png\" alt=\"Stack Builders\" width=\"50%\"\u003e\u003c/img\u003e\n[Check out our libraries](https://github.com/stackbuilders/) | [Join our team](https://www.stackbuilders.com/join-us/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fstache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbuilders%2Fstache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fstache/lists"}