{"id":16348456,"url":"https://github.com/devinus/walrus","last_synced_at":"2025-03-21T00:30:26.744Z","repository":{"id":1284486,"uuid":"1224152","full_name":"devinus/walrus","owner":"devinus","description":"Walrus - Mustache-like Templating","archived":false,"fork":false,"pushed_at":"2012-05-09T16:17:50.000Z","size":915,"stargazers_count":44,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-17T19:01:40.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/devinus/walrus","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devinus.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":"2011-01-05T20:21:41.000Z","updated_at":"2024-05-21T00:59:32.000Z","dependencies_parsed_at":"2022-07-06T16:34:19.298Z","dependency_job_id":null,"html_url":"https://github.com/devinus/walrus","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/devinus%2Fwalrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fwalrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fwalrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fwalrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devinus","download_url":"https://codeload.github.com/devinus/walrus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717124,"owners_count":20498280,"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-11T00:52:11.361Z","updated_at":"2025-03-21T00:30:26.288Z","avatar_url":"https://github.com/devinus.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"Walrus - Mustache-like Templating\n=================================\n\nWalrus is 50% Mustache and 50% large flippered marine mammal.\n\nLexing is done with Leex and parsing is done with Yecc, both\nof which are included in newer versions of Erlang.\n\nMost Mustache constructs work, such as variables, unescaped\nvariables, blocks, and inverse blocks. However, The Walrus is\nan opinionated animal, and partials will never be supported.\nAlso, functions passed into the context are simply evaluated\nand are not passed the raw template.\n\nYou can skip lexing and parsing templates every time you want\nto render them by using `compile/1`, which returns a renderer\nyou can then pass a context that renders the template.\n\nExamples\n--------\n\n### Simple Render\n\n    1\u003e Tmpl = \"Hello {{{name}}}.\n    1\u003e \n    1\u003e Drinks:\n    1\u003e \n    1\u003e {{#drinks}}\n    1\u003e     - {{name}}, {{tastiness}}\n    1\u003e {{/drinks}}\".\n    \"Hello {{{name}}}.\\n\\nDrinks:\\n\\n{{#drinks}}\\n    - {{name}}, {{tastiness}}\\n{{/drinks}}\"\n    2\u003e \n    2\u003e Ctx = [{name, \"Devin \u0026 Jane\"},\n    2\u003e        {drinks, [[{name, \"Beer\"},\n    2\u003e                   {tastiness, 5}],\n    2\u003e                  [{name, \"Juice\"},\n    2\u003e                   {tastiness, 8}]]}].\n    [{name,\"Devin \u0026 Jane\"},\n     {drinks,[[{name,\"Beer\"},{tastiness,5}],\n              [{name,\"Juice\"},{tastiness,8}]]}]\n    3\u003e \n    3\u003e walrus:render(Tmpl, Ctx).\n    \u003c\u003c\"Hello Devin \u0026 Jane.\\n\\nDrinks:\\n\\n\\n    - Beer, 5\\n\\n    - Juice, 8\\n\"\u003e\u003e\n\n### Compiled Renderer\n\n    1\u003e Renderer = walrus:compile(\"Hello {{{name}}}.\\n\\nDrinks:\\n\\n{{#drinks}}\\n    - {{name}}, {{tastiness}}\\n{{/drinks}}\").\n    #Fun\u003cwalrus.0.90102984\u003e\n    2\u003e Ctx = [{name, \"Devin \u0026 Jane\"},\n    2\u003e        {drinks, [[{name, \"Beer\"},\n    2\u003e                   {tastiness, 5}],\n    2\u003e                  [{name, \"Juice\"},\n    2\u003e                   {tastiness, 8}]]}].\n    [{name,\"Devin \u0026 Jane\"},\n     {drinks,[[{name,\"Beer\"},{tastiness,5}],\n              [{name,\"Juice\"},{tastiness,8}]]}]\n    3\u003e \n    3\u003e Renderer(Ctx).\n    \u003c\u003c\"Hello Devin \u0026 Jane.\\n\\nDrinks:\\n\\n\\n    - Beer, 5\\n\\n    - Juice, 8\\n\"\u003e\u003e\n\nAcknowledgments\n---------------\nRobert Virding helped me tremendously when I struggled to\nunderstand Leex. He's also responsible for\n`([^{}]|({[^{])|(}[^}]))+`.\n\nLicense\n-------\n\nAll code released into the public domain (see `UNLICENSE`)\nexcept for the file `walrus_mochinum.erl`, which has it's own\nlicense (see `LICENSE`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinus%2Fwalrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevinus%2Fwalrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinus%2Fwalrus/lists"}