eleventy-plugin-asciidoc 6.0.0 → 6.1.1
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 +8 -6
- package/index.js +3 -2
- package/lib/eleventy-asciidoc.js +6 -2
- package/package.json +1 -1
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
|
-
#### `
|
|
145
|
+
#### `configure_extension_registry` ⚠️ DEPRECATED
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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?.
|
|
13
|
+
if (converterOptions?.configure_extension_registry !== undefined) {
|
|
14
14
|
console.log(
|
|
15
|
-
`
|
|
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
|
|
package/lib/eleventy-asciidoc.js
CHANGED
|
@@ -68,6 +68,7 @@ const generateGetDataFromInputPath =
|
|
|
68
68
|
const {
|
|
69
69
|
eleventyAttributesPrefix = "eleventy-",
|
|
70
70
|
resolveDocumentTitle = false,
|
|
71
|
+
extension_registry,
|
|
71
72
|
...restOfConverterOptions
|
|
72
73
|
} = converterOptions;
|
|
73
74
|
|
|
@@ -170,8 +171,11 @@ function eleventyAsciidoctor(convertOptions = {}) {
|
|
|
170
171
|
debug(`base_dir: ${base_dir}`);
|
|
171
172
|
debug(`attributes:\n ${JSON.stringify(attributes)}`);
|
|
172
173
|
|
|
173
|
-
let registry;
|
|
174
|
-
if (
|
|
174
|
+
let registry = options.extension_registry;
|
|
175
|
+
if (
|
|
176
|
+
registry === undefined &&
|
|
177
|
+
typeof configure_extension_registry === "function"
|
|
178
|
+
) {
|
|
175
179
|
debug(`Creating an extension registry`);
|
|
176
180
|
registry = Extensions.create();
|
|
177
181
|
configure_extension_registry(registry);
|