{"id":15415594,"url":"https://github.com/stebalien/horrorshow-rs","last_synced_at":"2025-05-16T09:05:48.555Z","repository":{"id":31405773,"uuid":"34969054","full_name":"Stebalien/horrorshow-rs","owner":"Stebalien","description":"A macro-based html builder for rust","archived":false,"fork":false,"pushed_at":"2023-09-11T15:33:47.000Z","size":1530,"stargazers_count":332,"open_issues_count":3,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-11T00:05:06.919Z","etag":null,"topics":["html-template","rust","rust-library"],"latest_commit_sha":null,"homepage":"https://docs.rs/horrorshow/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stebalien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-03T01:05:52.000Z","updated_at":"2025-05-10T19:41:45.000Z","dependencies_parsed_at":"2024-06-19T01:48:34.094Z","dependency_job_id":"bb0d7f39-a6be-466a-9665-e820609e3323","html_url":"https://github.com/Stebalien/horrorshow-rs","commit_stats":{"total_commits":217,"total_committers":11,"mean_commits":"19.727272727272727","dds":0.05990783410138245,"last_synced_commit":"368122e22d48f16a2173b131776b267a75d181aa"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stebalien%2Fhorrorshow-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stebalien%2Fhorrorshow-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stebalien%2Fhorrorshow-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stebalien%2Fhorrorshow-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stebalien","download_url":"https://codeload.github.com/Stebalien/horrorshow-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"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":["html-template","rust","rust-library"],"created_at":"2024-10-01T17:08:44.951Z","updated_at":"2025-05-16T09:05:43.544Z","avatar_url":"https://github.com/Stebalien.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horrorshow\n\n[![Documentation](https://docs.rs/mio/badge.svg)](https://docs.rs/horrorshow/)\n[![crates.io](https://img.shields.io/crates/v/horrorshow.svg)](https://crates.io/crates/horrorshow)\n\nA macro-based html templating library, compatible with stable rust (currently requires rust \u003e= 1.48).\n\n## Features\n\nThis crate will degrade gracefully when compiled without `std` (disable the \"std\"\nfeature) and even without `alloc` (disable the \"alloc\" feature).\n\nWhen compiled with `alloc` but without `std`:\n\n* `Template::write_to_io()` is not defined.\n* Templates may only emit errors implementing `ToString` and all such errors are\n  immediately converted to strings.\n\nWhen compiled with just core:\n\n* `RenderBox` is no longer defined (no allocation).\n* The `Template::into_string()` and `Template::write_to_string()` are no longer\n  defined. The only template rendering method available is\n  `Template::write_to_fmt()`.\n* Templates may only emit static `\u0026str` errors, and only the first is recorded.\n\n## Example:\n\n```rust\n#[macro_use]\nextern crate horrorshow;\nuse horrorshow::prelude::*;\nuse horrorshow::helper::doctype;\n\nfn main() {\n    let actual = format!(\"{}\", html! {\n        : doctype::HTML;\n        html {\n            head {\n                title : \"Hello world!\";\n            }\n            body {\n                // attributes\n                h1(id=\"heading\") {\n                    // Insert escaped text\n                    : \"Hello! This is \u003chtml /\u003e\"\n                }\n                p {\n                    // Insert raw text (unescaped)\n                    : Raw(\"Let's \u003ci\u003ecount\u003c/i\u003e to 10!\")\n                }\n                ol(id=\"count\") {\n                    // You can embed for loops, while loops, and if statements.\n                    @ for i in 0..10 {\n                        li(first? = (i == 0)) {\n                            // Format some text.\n                            : format_args!(\"{}\", i+1)\n                        }\n                    }\n                }\n                // You need semi-colons for tags without children.\n                br; br;\n                p {\n                    // You can also embed closures.\n                    |tmpl| {\n                        tmpl \u003c\u003c \"Easy!\";\n                    }\n                }\n            }\n        }\n    });\n\n    let expected = \"\\\n    \u003c!DOCTYPE html\u003e\\\n    \u003chtml\u003e\\\n      \u003chead\u003e\\\n        \u003ctitle\u003eHello world!\u003c/title\u003e\\\n      \u003c/head\u003e\\\n      \u003cbody\u003e\\\n        \u003ch1 id=\\\"heading\\\"\u003eHello! This is \u0026lt;html /\u0026gt;\u003c/h1\u003e\\\n        \u003cp\u003eLet's \u003ci\u003ecount\u003c/i\u003e to 10!\u003c/p\u003e\\\n        \u003col id=\\\"count\\\"\u003e\\\n          \u003cli first\u003e1\u003c/li\u003e\\\n          \u003cli\u003e2\u003c/li\u003e\\\n          \u003cli\u003e3\u003c/li\u003e\\\n          \u003cli\u003e4\u003c/li\u003e\\\n          \u003cli\u003e5\u003c/li\u003e\\\n          \u003cli\u003e6\u003c/li\u003e\\\n          \u003cli\u003e7\u003c/li\u003e\\\n          \u003cli\u003e8\u003c/li\u003e\\\n          \u003cli\u003e9\u003c/li\u003e\\\n          \u003cli\u003e10\u003c/li\u003e\\\n        \u003c/ol\u003e\\\n        \u003cbr\u003e\u003cbr\u003e\\\n        \u003cp\u003eEasy!\u003c/p\u003e\\\n      \u003c/body\u003e\\\n    \u003c/html\u003e\";\n    assert_eq!(expected, actual);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstebalien%2Fhorrorshow-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstebalien%2Fhorrorshow-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstebalien%2Fhorrorshow-rs/lists"}