Skip to content

Commit

Permalink
docs(readme): add note about configure_extension_registry
Browse files Browse the repository at this point in the history
  • Loading branch information
saneef committed Jul 28, 2023
1 parent a4e13a2 commit 382ea5b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@ module.exports = function (eleventyConfig) {

The `base_dir` of [convert options](https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/) is relative to the document. This can be changed using above [options](#customize-with-options).

##### `extension_registry` (⚠️ deprecated)

From Asciidoctor.js v3.0 onwards, a new registry needs to be created and passed to the `extension_registry` option for each conversion. If you pass `extension_registry`, the extensions will be activated. Use [the `configure_extension_registry`](configure_extension_registry) function instead.

##### `configure_extension_registry`

The `configure_extension_registry` should be a function which accepts a `registry` (instance of `Extensions.Registry`). During each file conversion, the function will be called with a new `registry`. This `registry` instance be used to register extensions.

```js
const eleventyAsciidoc = require("eleventy-plugin-asciidoc");
const myExtension = require("./my-extension.js");

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyAsciidoc, {
configure_extension_registry(registry) {
myExtension.register(registry);
// Or, myExtension(registry) depending on how you
// programmed you extension.
},
});
};
```

Refer to [Asciidoctor.js documentation](https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/) to know more about extensions.

### CSS Styles

The plugin does not include any CSS styles. It is up to you to style the content.
Expand Down

0 comments on commit 382ea5b

Please sign in to comment.