{"id":23473406,"url":"https://github.com/cryogen-project/cryogen-asciidoc","last_synced_at":"2025-09-09T21:27:15.962Z","repository":{"id":25835524,"uuid":"29274945","full_name":"cryogen-project/cryogen-asciidoc","owner":"cryogen-project","description":"AsciiDoc module for Cryogen","archived":false,"fork":false,"pushed_at":"2023-11-22T12:42:27.000Z","size":32,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-15T22:07:55.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryogen-project.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-15T01:35:15.000Z","updated_at":"2024-04-19T18:49:08.000Z","dependencies_parsed_at":"2024-12-24T17:37:20.064Z","dependency_job_id":null,"html_url":"https://github.com/cryogen-project/cryogen-asciidoc","commit_stats":{"total_commits":27,"total_committers":9,"mean_commits":3.0,"dds":0.7407407407407407,"last_synced_commit":"3ee7282083c6eef3539c1f09834704fd85650ff1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cryogen-project/cryogen-asciidoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryogen-project%2Fcryogen-asciidoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryogen-project%2Fcryogen-asciidoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryogen-project%2Fcryogen-asciidoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryogen-project%2Fcryogen-asciidoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryogen-project","download_url":"https://codeload.github.com/cryogen-project/cryogen-asciidoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryogen-project%2Fcryogen-asciidoc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143941,"owners_count":23883069,"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-12-24T17:27:05.571Z","updated_at":"2025-07-31T17:08:13.478Z","avatar_url":"https://github.com/cryogen-project.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cryogen-asciidoc\n\n[![Clojars Project](http://clojars.org/cryogen-asciidoc/latest-version.svg)](http://clojars.org/cryogen-asciidoc)\n\nA Clojure library to provide AsciiDoc rendering to the cryogen-core compiler\n\n## Usage\n\nAdd the latest `cryogen-asciidoc` dependency to the `project.clj` of your generated Cryogen blog.\n\n## Configuration\n\nYou can set [AsciidoctorJ Options][1] in Cryogen's `config.edn` or in the page's metadata under the key\n `:asciidoctor` (with either string or keyword keys). Options from the two will be deep-merged\n (with the page taking precedence when there is a conflict) and passed directly to\nAsciidoctorJ's `.convert` method. The most interesting option is `:attributes` that enables\nyou to set [AsciiDoctor attributes](https://asciidoctor.org/docs/user-manual/#attributes)\nvia [the API](https://asciidoctor.org/docs/user-manual/#attribute-assignment-precedence).\n \n Examples:\n\n```clojure\n;; config.edn\n{:site-title  \"AsciiDoctor test\"\n ;...\n :asciidoctor {:attributes {\"icons\" \"font\"}}}\n```\n\n```clojure\n;; my-ppost.asc\n{:title \"My awesome post\"\n :asciidoctor {:attributes {\"abbr-imho\" \"\u003cabbr title='in my humble opinion'\u003eIMHO\u003c/abbr\u003e\"}}\n ...}\n\nI would, {abbr-imho}, not ...\n```\n\nNotice that you need to add additional resources to your site for some of\nthe attributes to have the desired effect. For example for `:icons: font`\nyou likely need to add some parts [asciidoctor.css](https://github.com/darshandsoni/asciidoctor-skins/blob/gh-pages/css/asciidoctor.css)\nor a [variant of it](https://github.com/darshandsoni/asciidoctor-skins/tree/gh-pages/css)\n(but it will crash with your Cryogen theme so you might want to extract / create a [minimal subset of your own](https://github.com/holyjak/blog.jakubholy.net/blob/d0dd499becf001687c8fb0143c10955a924f43aa/themes/lotus/css/asciidoctor-custom-subset.css))\nand [FontAwesome](https://github.com/darshandsoni/asciidoctor-skins/blob/71ce8dcd401600985dcce7b78d5b5d8b20a0a52d/index.html#L13).\n\n[1]: https://github.com/asciidoctor/asciidoctorj/blob/master/asciidoctorj-api/src/main/java/org/asciidoctor/Options.java\n\n### Extensions\n\nYou can register custom [Asciidoctor extensions](https://asciidoctor.org/docs/user-manual/#extensions). Currently, only block and inline macros are supported.\n\nFor block/inline macros: create a function taking `[^BaseProcessor this ^ContentNode parent ^String target attributes]`\nand using the factory methods in [BaseProcessor](https://github.com/asciidoctor/asciidoctorj/blob/master/asciidoctorj-api/src/main/java/org/asciidoctor/extension/BaseProcessor.java)\nto create a new node. See the [AsciidoctorJ extension examples](https://github.com/asciidoctor/asciidoctorj/blob/master/docs/integrator-guide.adoc#writing-an-extension).\n\nBy default, you function will be registered as both an inline and block macro so you can invoke it with either `mymacro:` or `mymacro::`.\nIf you explicitely only want to allow one of these, you can set the `:extension/types` metadata to a set of supported types\n(`:inline` or/and `:block`).\n\nYou register your extensions in the Cryogen `config.edn` under `:asciidoctor :extensions`, which is a map from the macro name\nto the fully qualified symbol representing the function.\n\n#### Example - GitHub issue link macro\n\n```clojure\n;; config.edn\n{:site-title  \"AsciiDoctor test\"\n ;...\n :asciidoctor {:extensions {\"gh\" my.ns/gh}}}\n```\n\n```clojure\n(ns my.ns)\n(defn ^{:extension/types #{:inline}} gh\n  \"Example macro that makes `gh:3[holyjak/myrepo]` into a link to https://github.com/holyjak/myrepo/issues/3\"\n  [^BaseProcessor this ^ContentNode parent ^String target attributes]\n  (let [repo (get attributes \"1\" \"\") ; positional attributes get keys such as \"1\", \"2\", ...\n        href (str \"https://github.com/\" repo \"/issues/\" target)\n        opts (doto (java.util.HashMap.) ; BEWARE: Must be mutable\n               (.putAll {\"type\" \":link\"\n                         \"target\" href}))]\n    (.createPhraseNode this parent \"anchor\" target\n                       {}\n                       opts)))\n```\n\n#### Example - abbreviation macro\n\nWith the following macro (inspired by asciidoctor/asciidoctor#252), properly register in a similar manner as above, you can write\n\n```asciidoc\nNow I am talking about abbr:AOP[\"Aspect-Oriented Programming\"], an important topic.\n```\n\nto get\n\n```html\nNow I am talking about \u003cabbr title=\"Aspect-Oriented Programming\"\u003eAOP\u003c/abbr\u003e, ...\n```\n\nThe macro:\n\n```clojure\n(defn abbr [^BaseProcessor this ^ContentNode parent ^String target attributes]\n  (let [attrs (HashMap. {})\n        opts  (HashMap. {\"subs\" []})]\n    (.createPhraseNode\n      this parent \"quoted\"\n      (str \"\u003cabbr title=\\\"\" (get attributes \"1\" \"N/A\") \"\\\"\u003e\" target \"\u003c/abbr\u003e\")\n      attrs opts)))\n```\n\n## License\n\nCopyright © 2015 Dmitri Sotnikov \u003cyogthos@gmail.com\u003e\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryogen-project%2Fcryogen-asciidoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryogen-project%2Fcryogen-asciidoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryogen-project%2Fcryogen-asciidoc/lists"}