eleventy-plugin-asciidoc 2.0.0 → 3.0.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/lib/eleventy-asciidoc.js +7 -4
- package/package.json +12 -12
package/lib/eleventy-asciidoc.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
/* eslint camelcase: ["error", {allow: ["base_dir"]}] */
|
|
3
3
|
|
|
4
|
-
const asciidoctor = require("asciidoctor")
|
|
4
|
+
const asciidoctor = require("@asciidoctor/core");
|
|
5
5
|
const debug = require("debug")("eleventy-plugin-asciidoc");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const matter = require("gray-matter");
|
|
8
8
|
const path = require("path");
|
|
9
9
|
const nunjucks = require("nunjucks");
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
const processor = asciidoctor();
|
|
13
|
+
|
|
14
|
+
/** @typedef {import('asciidoctor').ProcessorOptions} ProcessorOptions */
|
|
12
15
|
/** @typedef {import('gray-matter').GrayMatterFile} GrayMatterFile */
|
|
13
16
|
|
|
14
17
|
/**
|
|
@@ -29,7 +32,7 @@ const readFileSync = (inputPath) => {
|
|
|
29
32
|
*/
|
|
30
33
|
const getData = (inputPath) => {
|
|
31
34
|
const { data, content } = readFileSync(inputPath);
|
|
32
|
-
const doc =
|
|
35
|
+
const doc = processor.load(content);
|
|
33
36
|
const attributes = doc.getAttributes();
|
|
34
37
|
const title = doc.getDocumentTitle();
|
|
35
38
|
debug(`Document title ${title}`);
|
|
@@ -73,7 +76,7 @@ function eleventyAsciidoctor(convertOptions = {}) {
|
|
|
73
76
|
if (content) {
|
|
74
77
|
debug(`Converting:\n ${content}`);
|
|
75
78
|
debug(`base_dir: ${base_dir}`);
|
|
76
|
-
return
|
|
79
|
+
return processor.convert(content, { ...options, base_dir });
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eleventy-plugin-asciidoc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Adds support for AsciiDoc to Eleventy",
|
|
5
5
|
"main": ".eleventy.js",
|
|
6
6
|
"repository": {
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"author": "Saneef Ansari <hello@saneef.com> (https://saneef.com/)",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"asciidoctor": "^
|
|
25
|
+
"asciidoctor": "^3.0.2",
|
|
26
26
|
"debug": "^4.3.4",
|
|
27
27
|
"gray-matter": "^4.0.3",
|
|
28
|
-
"nunjucks": "^3.2.
|
|
28
|
+
"nunjucks": "^3.2.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"ava": "^3.
|
|
32
|
-
"eslint": "^8.
|
|
33
|
-
"eslint-config-prettier": "^8.
|
|
34
|
-
"eslint-config-xo-space": "^0.
|
|
35
|
-
"eslint-plugin-prettier": "^
|
|
36
|
-
"husky": "^8.0.
|
|
37
|
-
"lint-staged": "^13.
|
|
31
|
+
"ava": "^5.3.1",
|
|
32
|
+
"eslint": "^8.44.0",
|
|
33
|
+
"eslint-config-prettier": "^8.8.0",
|
|
34
|
+
"eslint-config-xo-space": "^0.34.0",
|
|
35
|
+
"eslint-plugin-prettier": "^5.0.0-alpha.1",
|
|
36
|
+
"husky": "^8.0.3",
|
|
37
|
+
"lint-staged": "^13.2.3",
|
|
38
38
|
"nyc": "^15.1.0",
|
|
39
|
-
"prettier": "^
|
|
40
|
-
"rimraf": "^
|
|
39
|
+
"prettier": "^3.0.0",
|
|
40
|
+
"rimraf": "^5.0.1"
|
|
41
41
|
},
|
|
42
42
|
"lint-staged": {
|
|
43
43
|
"*.js": "eslint --cache --fix",
|