eleventy-plugin-asciidoc 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -142,13 +142,11 @@ This can be changed using the above [options](#customize-with-options).
142
142
  By 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.
143
143
  This can be changed using the above [options](#customize-with-options).
144
144
 
145
- #### `extension_registry` (⚠️ deprecated)
145
+ #### `configure_extension_registry` ⚠️ DEPRECATED
146
146
 
147
- The convert option `extension_registry` **will not work** as intended from Asciidoctor.js v3.0 onwards.
148
- The `extension_registry` needs a newly created registry for each conversion.
149
- Use [the `configure_extension_registry`](#configure_extension_registry) function instead.
150
-
151
- #### `configure_extension_registry`
147
+ > [!NOTE]
148
+ > Recommend to use `extension_registry` part of [`convert` options](https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/).
149
+ > From [v6.1.0](https://github.com/saneef/eleventy-plugin-asciidoc/releases/tag/v6.1.0), it works as intended.
152
150
 
153
151
  The `configure_extension_registry` should be a function which accepts a `registry` (instance of `Extensions.Registry`).
154
152
  During each file conversion, the function will be called with a new `registry`.
@@ -171,6 +169,10 @@ module.exports = function (eleventyConfig) {
171
169
 
172
170
  Refer to [Asciidoctor.js documentation](https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/) to know more about extensions.
173
171
 
172
+ If you pass both `extension_registry` and `configure_extension_registry`, `extension_registry` will take precedence.
173
+
174
+ `configure_extension_registry` will be removed in a future release.
175
+
174
176
  ### CSS Styles
175
177
 
176
178
  The plugin does not include any CSS styles. It is up to you to style the content.
package/index.js CHANGED
@@ -10,9 +10,10 @@ import eleventyAsciidoc from "./lib/eleventy-asciidoc.js";
10
10
  * @param {EleventyAsciidocOptions} converterOptions Options for Asciidoctor.converter()
11
11
  */
12
12
  export default function config(eleventyConfig, converterOptions) {
13
- if (converterOptions?.extension_registry !== undefined) {
13
+ if (converterOptions?.configure_extension_registry !== undefined) {
14
14
  console.log(
15
- `WARN: 'extension_registry' doesn't work well with Asciidoctor.js v3+. Use 'configure_extension_registry'.`,
15
+ `[DEPRECATED]: 'configure_extension_registry' is deprecated will be removed in a future release.
16
+ From eleventy-plugin-asciidoc v6.1.0 (with Asciidoctor.js 4.0), the native 'extension_registry' works as intended.`,
16
17
  );
17
18
  }
18
19
 
@@ -170,8 +170,11 @@ function eleventyAsciidoctor(convertOptions = {}) {
170
170
  debug(`base_dir: ${base_dir}`);
171
171
  debug(`attributes:\n ${JSON.stringify(attributes)}`);
172
172
 
173
- let registry;
174
- if (typeof configure_extension_registry === "function") {
173
+ let registry = options.extension_registry;
174
+ if (
175
+ registry === undefined &&
176
+ typeof configure_extension_registry === "function"
177
+ ) {
175
178
  debug(`Creating an extension registry`);
176
179
  registry = Extensions.create();
177
180
  configure_extension_registry(registry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-asciidoc",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Adds support for AsciiDoc to Eleventy",
5
5
  "main": "index.js",
6
6
  "type": "module",