{"id":15016555,"url":"https://github.com/saneef/eleventy-plugin-asciidoc","last_synced_at":"2026-02-27T22:38:31.753Z","repository":{"id":57222319,"uuid":"432454099","full_name":"saneef/eleventy-plugin-asciidoc","owner":"saneef","description":"Eleventy plugin to add support for AsciiDoc.","archived":false,"fork":false,"pushed_at":"2025-02-25T11:50:42.000Z","size":94,"stargazers_count":31,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T09:56:04.988Z","etag":null,"topics":["11ty","11ty-plugin","asciidoc","asciidoctor","eleventy","eleventy-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/saneef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"saneef","ko_fi":"saneef","patreon":"saneef"}},"created_at":"2021-11-27T12:24:00.000Z","updated_at":"2025-03-05T15:12:27.000Z","dependencies_parsed_at":"2025-03-17T16:11:11.533Z","dependency_job_id":"350f5f09-0908-49dd-b94a-ea7d8859ca67","html_url":"https://github.com/saneef/eleventy-plugin-asciidoc","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.12903225806451613","last_synced_commit":"f63a0a639b95a89d8093991d870a53579b03948f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saneef%2Feleventy-plugin-asciidoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saneef%2Feleventy-plugin-asciidoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saneef%2Feleventy-plugin-asciidoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saneef%2Feleventy-plugin-asciidoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saneef","download_url":"https://codeload.github.com/saneef/eleventy-plugin-asciidoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248691552,"owners_count":21146388,"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":["11ty","11ty-plugin","asciidoc","asciidoctor","eleventy","eleventy-plugin"],"created_at":"2024-09-24T19:49:04.306Z","updated_at":"2026-02-27T22:38:26.697Z","avatar_url":"https://github.com/saneef.png","language":"JavaScript","funding_links":["https://github.com/sponsors/saneef","https://ko-fi.com/saneef","https://patreon.com/saneef"],"categories":[],"sub_categories":[],"readme":"# eleventy-plugin-asciidoc\n\nEleventy plugin to add support for [AsciiDoc](https://asciidoc.org/).\nYou don't need to use to shortcodes.\nYou can directly use AsciiDoc files (`.adoc`), just like Markdown (`.md`).\n\nThe plugin uses [Asciidoctor.js](https://docs.asciidoctor.org/asciidoctor.js) under the hood.\n\n**Requires Eleventy 2.0.0-canary.19 or newer.**\n\n## Features\n\n- Supports the default [YAML front matter](https://www.11ty.dev/docs/data-frontmatter/).\n- Supports [AsciiDoc document title](https://docs.asciidoctor.org/asciidoc/latest/document/title/#title-syntax)\n- Other attributes in the AsciiDoc files are made available in templates through `asciidocAttributes`.\n  - Example `:author: Jane Doe` in the `.adoc` file will be available as `asciidocAttributes.author`\n\n## Usage\n\n### Install\n\n```sh\nnpm install eleventy-plugin-asciidoc\n```\n\n### Add to Configuration File\n\nUsually `eleventy.config.js` or `.eleventy.js`:\n\n```js\nconst eleventyAsciidoc = require(\"eleventy-plugin-asciidoc\");\n\nmodule.exports = function (eleventyConfig) {\n  eleventyConfig.addPlugin(eleventyAsciidoc);\n};\n```\n\n## Front Matter\n\nYou can use either [Eleventy style front matter](https://www.11ty.dev/docs/data-frontmatter/#front-matter-formats) or AsciiDoc document attributes to write front matter.\n\nAny AsciiDoc document attributes that are prefixed with `eleventy-` ([configurable](#eleventyAttributesPrefix)) can be used as front matter. _The prefix, `eleventy-`, will be removed from variable names available in the templates._\n\nOnly document-scoped attributes or variables can be used for front matter. Attributes that are written after the document title (`= Document Title`) will not be considered for front matter.\n\n```adoc\n:eleventy-permalink: /hello-world/\n:eleventy-layout: base.njk\n\n= Hello World\n\nHello everyone!\n```\n\nThe above AsciiDoc attribute front matter is the same as YAML based front matter below:\n\n```adoc\n---\npermalink: /hello-world/\nlayout: base.njk\n---\n\n= Hello World\n\nHello everyone!\n```\n\n\u003e [!WARNING]\n\u003e Asciidoctor.js converts all attribute names to lower case letters. Example `:eleventy-aTitle:` will be made available as `atitle` in front matter data (also as `eleventy-atitle` in document attributes).\n\n### Data Cascade\n\nData specified using AsciiDoc style front matter override YAML (or front matter in other Eleventy supported formats).\n\n```adoc\n---\nlayout: layout-a.njk\n---\n:eleventy-layout: layout-b.njk\n\n= Hello World\n\nHello everyone!\n```\n\nIn the above case, front matter data will have `{ layout: layout-b.njk }`.\n\nIn the case of `title`, [the AsciiDoc document title](https://docs.asciidoctor.org/asciidoc/latest/document/title/) (including `title` and `doctitle` attributes) takes precedence over front matter.\n\n## Options\n\nYou can pass options as the second argument in `addPlugin()`.\n\n### Options for this plugin\n\n#### `eleventyAttributesPrefix`\n\nDefault value is `eleventy-`.\n\nThis config can be used to change the prefix string for [AsciiDoc style front matter](#front-matter).\n\n#### `resolveDocumentTitle`\n\nDefault value is `false`.\n\nIf enabled, the title will be resolved from the heading of the first section in the document. Otherwise, the title will be the Level 0 heading.\n\n```adoc\n== A second level heading\n\nThis text is written in AsciiDoc format.\n```\n\nWith `resolveDocumentTitle: true`, the above document will have a title (in page data). `A second level heading`.\n\n### Options for Asciidoctor.js\n\nAll properties other than [the ones specific to the plugin](#options-for-this-plugin) will be passed to Asciidoctor.js.\n\nThese are the [available options](https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/).\n\n```js\nconst eleventyAsciidoc = require(\"eleventy-plugin-asciidoc\");\n\nmodule.exports = function (eleventyConfig) {\n  eleventyConfig.addPlugin(eleventyAsciidoc, {\n    attributes: {\n      showtitle: true /* Default value: undefined */,\n    },\n    safe: \"unsafe\" /* Default value: undefined */,\n  });\n};\n```\n\n#### `base_dir`\n\nThe `base_dir` of [convert options](https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/) is relative to the document.\nThis can be changed using the above [options](#customize-with-options).\n\n#### `attributes.outdir`\n\nBy default, [`attributes.outdir`](https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-ref/#intrinsic-attributes) will be the path to the output directory (`permalink`) of the document.\nThis can be changed using the above [options](#customize-with-options).\n\n#### `extension_registry` (⚠️ deprecated)\n\nThe convert option `extension_registry` **will not work** as intended from Asciidoctor.js v3.0 onwards.\nThe `extension_registry` needs a newly created registry for each conversion.\nUse [the `configure_extension_registry`](#configure_extension_registry) function instead.\n\n#### `configure_extension_registry`\n\nThe `configure_extension_registry` should be a function which accepts a `registry` (instance of `Extensions.Registry`).\nDuring each file conversion, the function will be called with a new `registry`.\nThis `registry` instance can be used to register extensions.\n\n```js\nconst eleventyAsciidoc = require(\"eleventy-plugin-asciidoc\");\nconst myExtension = require(\"./my-extension.js\");\n\nmodule.exports = function (eleventyConfig) {\n  eleventyConfig.addPlugin(eleventyAsciidoc, {\n    configure_extension_registry(registry) {\n      myExtension.register(registry);\n      // Or, myExtension(registry) depending on how\n      // you have programmed your extension.\n    },\n  });\n};\n```\n\nRefer to [Asciidoctor.js documentation](https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/) to know more about extensions.\n\n### CSS Styles\n\nThe plugin does not include any CSS styles. It is up to you to style the content.\n\nThe quickest way to style the content is to use the CSS file from Asciidoctor.js.\nThe CSS file is [available on cdnjs](https://cdnjs.com/libraries/asciidoctor.js).\n\n## Enhancements\n\n- [Tutorial on adding syntax highlighting](https://saneef.com/tutorials/asciidoc-syntax-highlighting/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaneef%2Feleventy-plugin-asciidoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaneef%2Feleventy-plugin-asciidoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaneef%2Feleventy-plugin-asciidoc/lists"}