{"id":15010310,"url":"https://github.com/panthevm/clj-fast-html","last_synced_at":"2025-04-09T18:33:45.021Z","repository":{"id":243719788,"uuid":"813284346","full_name":"Panthevm/clj-fast-html","owner":"Panthevm","description":"Clojure library designed for fast and efficient HTML generation","archived":false,"fork":false,"pushed_at":"2024-06-11T18:49:23.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T20:37:11.667Z","etag":null,"topics":["clojure","html"],"latest_commit_sha":null,"homepage":"https://clojars.org/io.github.panthevm/clj-fast-html","language":"Clojure","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/Panthevm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2024-06-10T20:28:10.000Z","updated_at":"2024-06-12T11:39:33.000Z","dependencies_parsed_at":"2025-02-15T12:41:49.872Z","dependency_job_id":null,"html_url":"https://github.com/Panthevm/clj-fast-html","commit_stats":null,"previous_names":["panthevm/clj-fast-html"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panthevm%2Fclj-fast-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panthevm%2Fclj-fast-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panthevm%2Fclj-fast-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panthevm%2Fclj-fast-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Panthevm","download_url":"https://codeload.github.com/Panthevm/clj-fast-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088170,"owners_count":21045660,"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":["clojure","html"],"created_at":"2024-09-24T19:33:30.028Z","updated_at":"2025-04-09T18:33:45.000Z","avatar_url":"https://github.com/Panthevm.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-fast-html\nclj-fast-html is a Clojure library designed for fast and efficient HTML generation.\n\n# Usage\nYou can find the latest version on Clojars:\n\n[![Clojars Project](http://clojars.org/io.github.panthevm/clj-fast-html/latest-version.svg)](https://clojars.org/io.github.panthevm/clj-fast-html) \u003cbr\u003e\n\n## Example:\nHere is an example of how to use clj-fast-html to generate an HTML string:\n``` clj\n(clj-fast-html.core/to-html-string\n [[:html/raw \"\u003c!DOCTYPE html\u003e\"]\n  [:html\n   [:head\n    [:title \"Title\"]]\n   [:body\n    [:h1#id.class1.class2 \"Header\"]\n    [:p {:style {:color \"red\"}} \"text\"]\n    [:p {:class [\"class3\" \"class4\"]} \"text\"]\n    [:p {:class \"class3 class4\"} \"text\"]\n    [:dialog {:open true} \"text\"]\n    [:span {:href (clj-fast-html.core/escape \"' onmouseover='alert(1)\")}]\n    [:span (clj-fast-html.core/escape \"\u003cp onmouseover='alert(1)'\u003e\u003c/p\u003e\")]\n    (mapv\n     (fn [x]\n       [:span x])\n     [1 2 3 4])]]])\n```\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eTitle\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1 id=\"id\" class=\"class1 class2\"\u003eHeader\u003c/h1\u003e\n    \u003cp style=\"color:red\"\u003etext\u003c/p\u003e\n    \u003cp class=\"class3 class4\"\u003etext\u003c/p\u003e\n    \u003cp class=\"class3 class4\"\u003etext\u003c/p\u003e\n    \u003cdialog open\u003etext\u003c/dialog\u003e\n    \u003cspan href=\"\u0026#39; onmouseover=\u0026#39;alert(1)\"\u003e\u003c/span\u003e\n    \u003cspan\u003e\u0026lt;p onmouseover=\u0026#39;alert(1)\u0026#39;\u0026gt;\u0026lt;/p\u0026gt;\u003c/span\u003e\n    \u003cspan\u003e1\u003c/span\u003e\n    \u003cspan\u003e2\u003c/span\u003e\n    \u003cspan\u003e3\u003c/span\u003e\n    \u003cspan\u003e4\u003c/span\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n# Benchmark\nThe performance of clj-fast-html is benchmarked against other popular HTML generation libraries. Below are the benchmark results for generating the [Clojure home page](https://clojure.org/)\n\n#### Single Thread\n| Library                | Average (ns)     | %        |\n|------------------------|------------------|----------|\n| clj-fast-html (latest) | 39434.940 ns/op  | 0%       |\n| Hiccup (2.0.0-RC3)     | 306147.614 ns/op | 676.34%  |\n| Hiccup (2.0.0-RC1)     | 666406.325 ns/op | 1589.89% |\n\n#### Multithread\n| Library                | Average (μs)     | %        |\n|------------------------|------------------|----------|\n| clj-fast-html (latest) | 176.198   μs/op  | 0%       |\n| Hiccup (2.0.0-RC3)     | 1332.627  μs/op  | 656.32%  |\n| Hiccup (2.0.0-RC1)     | 2041.248  μs/op  | 1058.5%  |\n\nTo run the benchmark yourself, use the following command:\n``` bash\nmake bench\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanthevm%2Fclj-fast-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanthevm%2Fclj-fast-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanthevm%2Fclj-fast-html/lists"}