eleventy-plugin-asciidoc 1.2.1 → 1.3.2

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
@@ -4,7 +4,7 @@ Eleventy plugin to add support for [AsciiDoc](https://asciidoc.org/). You don't
4
4
 
5
5
  The plugin uses [Asciidoctor.js](https://docs.asciidoctor.org/asciidoctor.js) under the hood.
6
6
 
7
- **Requires Eleventy `1.0.0` or newer.**
7
+ **Requires Eleventy 1.0.0-beta.10, 1.0.0-canary.50 or newer.**
8
8
 
9
9
  ## Features
10
10
 
@@ -42,8 +42,20 @@ const eleventyAsciidoc = require("eleventy-plugin-asciidoc");
42
42
 
43
43
  module.exports = function (eleventyConfig) {
44
44
  eleventyConfig.addPlugin(eleventyAsciidoc, {
45
- showtitle: true /* Default value: true */,
45
+ attributes: {
46
+ showtitle: true /* Default value: undefined */,
47
+ },
46
48
  safe: "unsafe" /* Default value: undefined */,
47
49
  });
48
50
  };
49
51
  ```
52
+
53
+ ### CSS Styles
54
+
55
+ The plugin does not include any CSS styles. It is up to you to style the content.
56
+
57
+ The quick way to style the content is to use the CSS file from Asciidoctor.js. The CSS file is [available on cdnjs](https://cdnjs.com/libraries/asciidoctor.js).
58
+
59
+ ## Enhancements
60
+
61
+ - [Tutorial on adding syntax highlighting](https://saneef.com/tutorials/asciidoc-syntax-highlighting/)
@@ -50,21 +50,20 @@ function eleventyAsciidoctor(convertOptions = {}) {
50
50
  debug("Converter options: ", convertOptions);
51
51
 
52
52
  const options = {
53
- showtitle: true,
54
53
  ...convertOptions,
55
54
  };
56
55
 
57
- const compile = (str) => (data) => {
56
+ const compile = (str, inputPath) => (data) => {
58
57
  if (str) {
59
- // Since `read: false` is set 11ty doesn't read file contents
60
- // so if str has a value, it's a permalink (which can be a string or a function)
58
+ // So if str has a value, it's a permalink (which can be a string or a function)
59
+ debug(`Permalink: ${str}`);
61
60
  return typeof str === "function"
62
61
  ? str(data)
63
62
  : nunjucks.renderString(str, data);
64
63
  }
65
64
 
66
- debug(`Reading ${data.page.inputPath}`);
67
- const { content } = readFileSync(data.page.inputPath);
65
+ debug(`Reading ${inputPath}`);
66
+ const { content } = readFileSync(inputPath);
68
67
 
69
68
  if (content) {
70
69
  debug(`Converting:\n ${content}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-asciidoc",
3
- "version": "1.2.1",
3
+ "version": "1.3.2",
4
4
  "description": "Adds support for AsciiDoc to Eleventy",
5
5
  "main": ".eleventy.js",
6
6
  "repository": {