{"metadata":{"name":"hew/template","vers":"0.6.0","description":"Mustache-lite HTML templating for Hew — safe interpolation with automatic HTML escaping","license":"MIT OR Apache-2.0","authors":["Hew Contributors"],"deps":[],"features":{},"keywords":["template","html","mustache","escaping","web"],"repository":"https://github.com/hew-lang/ecosystem","edition":"2026","hew":">=0.9.0, <0.10.0","readme":"# hew.template\n\n`hew.template` renders small Mustache-style HTML templates. Double-brace\nplaceholders escape HTML metacharacters; triple-brace placeholders insert\ntrusted, pre-rendered HTML unchanged.\n\nThe checked [render page example](examples/render_page.hew) is below; its\ntest pins the rendered page, so `hew test template` fails if the output\nchanges:\n\n```hew\nimport hew.template;\n\nfn render_page() -> string {\n    let context = \"name\\n<Ada & Co>\\nbody\\n<strong>Welcome</strong>\";\n    template.render(\"<h1>Hello, {{name}}!</h1><main>{{{body}}}</main>\", context)\n}\n\nfn main() {\n    println(render_page());\n}\n\n#[test]\nfn escapes_the_name_and_keeps_the_trusted_body() {\n    assert(render_page() == \"<h1>Hello, &lt;Ada &amp; Co&gt;!</h1><main><strong>Welcome</strong></main>\");\n}\n```\n\nRun it from the ecosystem checkout:\n\n```sh\nhew run --pkg-path . template/examples/render_page.hew\n```\n\nThe program prints:\n\n```html\n<h1>Hello, &lt;Ada &amp; Co&gt;!</h1><main><strong>Welcome</strong></main>\n```\n\nContext is a newline-delimited sequence of key/value pairs. An unpaired key\nhas an empty value, duplicate keys use the last value, and an unknown\nplaceholder renders as empty text. Only LF (`\\n`) separates fields; a CR\n(`\\r`), including the CR in a CRLF pair, remains part of its key or value.\n\nMarker parsing commits to the longest opening marker. `{{{` therefore starts\na raw placeholder and must be closed by `}}}`. If its exact closing marker is\nmissing, the malformed marker and the rest of the template render literally;\nthe renderer does not retry at the second `{`. A valid double-brace marker\nfollowed by an extra `}` renders its escaped value and preserves that extra\nbrace. A malformed raw marker is never reinterpreted as an escaped marker one\nbyte later: a template that opens `{{{` and never closes it renders literally\nrather than silently changing meaning.\n\nA lone `{{` or a lone `}}` has no matching marker and renders literally.\n\nRendering scans the context and template once, uses average constant-time\ncontext lookup, and appends rendered UTF-8 into a growable buffer. Expected\ntime is linear in the context, template, and rendered output sizes. Use raw\ntriple-brace placeholders only for HTML you already trust.\n"},"versions":[{"name":"hew/template","vers":"0.1.0","deps":[],"features":{},"cksum":"sha256:5cfba4b6b637f3ad012d4d5f19d60913c5be666d1bfa2f1c04ff87ad51472f37","sig":"ed25519:a1d2b20db34c41c7b0c2dc24b0db711355bcd4e4240bc1682126f99316059193100a0c495f8d35e2d95d39316a133f1c5fe2f1c18ef47a43ccb6b48e18ba2f09","key_fp":"SHA256:3njv78NJD/NTkV83eJ86yfrXqpu+l652GAjPzB/Grp0","yanked":false,"registry_sig":"ed25519:d8db339cb7f6b251dec3e53a30fc2332de2b50ef913af955d55edf3540dacc5f95c7f90878816a85a4d8768988f1864a57bc9dbe86b2673ae381c1ea28b4fc08","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-03-12T21:11:06.790Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.1.0.tar.zst"},{"name":"hew/template","vers":"0.2.0","deps":[],"features":{},"cksum":"sha256:26b75c610c639c62073dd5ef51ebfd35d36b9abb21aa6713a42f72bea8f65f89","sig":"ed25519:d3ea6ce3dfa53c1c30114e6d961cf2515ec843b342af50b6f424d9ebd941468c4f970af9f4e86ac163ed3078e8bd9b81ec7b683431dadbbb4227e75eabe94e08","key_fp":"SHA256:nzUYL3OflVsrmx8SM+vXLmUdfWPGmB649WfSHkWW09M","yanked":false,"edition":"2026","hew":">=0.6.0-rc1, <0.7.0","registry_sig":"ed25519:fb9cab8b3cdb160ad5f7ff998a06edc29d58346dc06f77bc060cd7093863c556480b02a071f0b2fec0ed0311f89c5b789469d027c344a9d1da0e4b8f5e69cc01","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-08-15T04:28:15.732Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.2.0.tar.zst"},{"name":"hew/template","vers":"0.3.0","deps":[],"features":{},"cksum":"sha256:bbcd8261684bb46297c4f425842d324f3ad264089e35f79cbab21280f4b537d6","sig":"ed25519:93ee7f051c956b3e4bbe283a8d55eb3e07ec1f61643ea72c2af4f57a901f899400da694f14278bf53e215427d319701b03d1224a6743b87afe9707291a16500e","key_fp":"SHA256:jLehs0udkm2NCjnfcFdvc8l8rkRR5tJ++54dk9PpbGk","yanked":false,"edition":"2026","hew":">=0.6.1, <0.7.0","registry_sig":"ed25519:56c6d986f8f713dca300cc89ba38f20300deaf022ea5ca589b7b0443e0d105061de5ee385811790cfb8d919869968770811eac690eeacd97b1230f8b9a3cb402","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-17T05:38:38.629Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.3.0.tar.zst"},{"name":"hew/template","vers":"0.4.0","deps":[],"features":{},"cksum":"sha256:0940f625fc656f87270e76ea6b4b9f25974862c6ba9598600f6870efa7cc616f","sig":"ed25519:be111f398658dc3e88ac020e0ff26d22371b0a896002ec6666bd9063834e562f91dade7e4f2cc0d7808fc919073f5d64879bf90c8eedb16c6eec9bc663911a06","key_fp":"SHA256:xl0hCTnhRoxLob4M6UdsT7Jtjn0a2wyYJf9ObIANTao","yanked":false,"edition":"2026","hew":">=0.6.1, <0.7.0","registry_sig":"ed25519:ea88c207a5c0557f3fb4776a3e0b18348b0bc7b9ccf159133b55564ea4f356460ffac689538901ee4df3a5166faf5ff12cbbccc35fe390a2c99c5f9b65bbbe07","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-21T03:48:00.732Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.4.0.tar.zst"},{"name":"hew/template","vers":"0.4.1","deps":[],"features":{},"cksum":"sha256:2f5b73489615ee3131c0d0aa788df241778cff66007c2cbcad91a10e4aa7911e","sig":"ed25519:3f80d09494db080817a1f8969ca75472434d730d47fb3386919bf3cebcf000766dae74ad2ca9c673ea681a688e1c8d71c11a74967135291d7ea6a275d1c2a40b","key_fp":"SHA256:gk8UzG1JaUDuLgtKkCWyxdIF7vtNvUrDqykgv3ZwQTo","yanked":false,"edition":"2026","hew":">=0.6.1, <0.8.0","registry_sig":"ed25519:418c068b744755b084de70b017053a59460e798a901aa69eacf4aaa2bf0770e78b748d70a30a440b7c82472142cfcbd56987a11276b2d0f5fbe030be1d8d3501","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-22T10:01:38.372Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.4.1.tar.zst"},{"name":"hew/template","vers":"0.5.0","deps":[],"features":{},"cksum":"sha256:c3874cd29338b171b14d17ea3626ce5d326462f8b9bfff94e66e63069dda65d4","sig":"ed25519:7cd084cbed9608f036c000a0b5a1206796bbdb139847202f7e98575ee470b0effb970c97e57a95b5f41f58d73b58b240303db677e75c7f68ef1e9edf7b90390c","key_fp":"SHA256:EGxvQ8Gktjf0VMLt5eW4gxeKAR30l3wnVMa2c/DuSHQ","yanked":false,"edition":"2026","hew":">=0.8.0, <0.9.0","registry_sig":"ed25519:244a4e41e321942c456e85a0615d71d521f06d30d7cbb28b23840baf44c8980c6bd46121eddd19f91ca8f17d6bfd35cdc87343179a6571a130725e060bb6b301","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-24T00:00:13.583Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.5.0.tar.zst"},{"name":"hew/template","vers":"0.6.0","deps":[],"features":{},"cksum":"sha256:610fde6ff76d03264c96bf8789dc16b58f70082af220756963769b1f837d5dd6","sig":"ed25519:42ea79044b3f1a1a2c70744ca9345f11b3524d467810da77783536847ecd3e1a41f4412ee0d09f14aacf0ced1a5a36a7da41d850508a42ade6c7ae40229f220b","key_fp":"SHA256:CB3Ski8183EXzxoy+uSuMpWTxvd/4AlB8CThZu0ZG74","yanked":false,"edition":"2026","hew":">=0.9.0, <0.10.0","registry_sig":"ed25519:fad45e62713d3d6c818213ae299b6f10401d0da2cd2e2195eef481c663fc83cc1012e7516327b36ba7a21c883fe736999e94b51ef2d117bc6ad1900301243f0c","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-24T11:54:18.430Z","dl":"https://cdn.hewpkg.com/tarballs/hew/template/0.6.0.tar.zst"}]}