{"id":28492113,"url":"https://github.com/jjl/thyroid","last_synced_at":"2025-12-12T01:17:25.802Z","repository":{"id":62433067,"uuid":"96527582","full_name":"jjl/thyroid","owner":"jjl","description":"HTML5 templating made differently insane","archived":false,"fork":false,"pushed_at":"2017-07-18T18:12:35.000Z","size":34,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-21T15:33:30.589Z","etag":null,"topics":["clojure","html5","templating","thymeleaf","thyroid"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/jjl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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":"2017-07-07T10:22:44.000Z","updated_at":"2019-10-22T09:19:02.000Z","dependencies_parsed_at":"2022-11-01T21:01:31.490Z","dependency_job_id":null,"html_url":"https://github.com/jjl/thyroid","commit_stats":null,"previous_names":["irresponsible/thyroid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jjl/thyroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjl%2Fthyroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjl%2Fthyroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjl%2Fthyroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjl%2Fthyroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjl","download_url":"https://codeload.github.com/jjl/thyroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjl%2Fthyroid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27673723,"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","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","html5","templating","thymeleaf","thyroid"],"created_at":"2025-06-08T08:09:34.771Z","updated_at":"2025-12-12T01:17:25.796Z","avatar_url":"https://github.com/jjl.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"The irresponsible clojure guild presents...\n\n# Thyroid\n\n[![Clojars Project](https://img.shields.io/clojars/v/irresponsible/thyroid.svg)](https://clojars.org/irresponsible/thyroid)\n[![Jitpack](https://jitpack.io/v/irresponsible/thyroid.svg)](https://jitpack.io/#irresponsible/thyroid)\n[![Build Status](https://travis-ci.org/irresponsible/thyroid.svg?branch=master)](https://travis-ci.org/irresponsible/thyroid)\n\nHTML5 templating made differently insane.\n\n## Usage\n\n```clojure\n(require '[irresponsible.thyroid :as t])\n\n(def resolver (t/template-resolver \n                {:type :file\n                 :prefix \"resources/templates/\"\n                 :suffix \".html\"\n                 :cache? false}))\n\n(def engine (t/make-engine {:resolvers [resolver]}))\n\n;; Render data to a string\n(t/render engine \"hello.html\" {\"title\" \"Hello World!\"})\n```\n\nThe template file is defined as\n\n```html\n\u003c!-- resources/templates/hello.html --\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle th:text=\"${title}\"\u003eNo title set\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch1 th:text=\"${title}\"\u003efake title\u003c/h1\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Template resolvers\n\nYou can define your own template resolvers like this\n\n```clojure\n(import '(org.thymeleaf.templateresolver ITemplateResolver))\n\n(defmethod t/template-resolver ::custom\n  [options]\n  (reify ITemplateResolver\n    (getName [this] (:name options))\n    (getOrder [this] (:order options))\n    (resolveTemplate [this conf owner-template template resolution-attrs]\n      ...)))\n```\n\n### Dialects\n\nAdding dialects is a more involved process, this example is a copy of that\npresented by the thymeleaf [\"Say Hello! Extending Thymeleaf in 5 minutes\" guide][1].\n\nEach dialect expects a handler that returns a set of processors that will be\ncalled when the dialect is being rendered.\n\n[1]: http://www.thymeleaf.org/doc/articles/sayhelloextendingthymeleaf5minutes.html\n\n```clojure\n(import '(org.unbescape.html.HtmlEscape))\n\n(defn say-hello-processor\n  [prefix]\n  (t/process-by-attrs\n    {:prefix prefix\n     :attr-name \"sayto\"\n     :handler (fn [ctx tag attr-name attr-val struct-handler]\n                (.setBody struct-handler \n                  (str \"Hello, \" (HtmlEscape/escapeHtml attr-val) \"!\")))))\n\n(def my-dialect \n  (t/dialect \n    {:name \"Hello Dialect\" \n     :prefix \"hello\" \n     :handler (fn [prefix] \n                #{(say-hello-processor prefix)})}))\n                \n;; Render string template\n(def engine (t/make-engine \n              {:resolvers [(thyroid/template-resolver {:type :string})]}))\n(t/render engine \"\u003cp hello:sayto=\"World\"\u003eHi ya!\u003c/p\u003e\") \n```\n\nThe above example will render `\u003cp\u003eHello, World!\u003c/p\u003e`\n\n## Contributors\n\n* [James Laver](https://github.com/jjl)\n* [Antonis Kalou](https://github.com/kalouantonis)\n* [Kent Fredric](https://github.com/kentfredric)\n\n## Copyright and License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjl%2Fthyroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjl%2Fthyroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjl%2Fthyroid/lists"}