@antora/asciidoc-loader
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -17,3 +17,3 @@ 'use strict' | ||
function createConverter (asciidoctor, callbacks) { | ||
const converter = getConverterFactory(asciidoctor).$create('html5') | ||
const converter = createBaseHtmlConverter(asciidoctor) | ||
converter.$extend(ConverterExtension) | ||
@@ -24,6 +24,6 @@ converter.$on_page_ref(callbacks.onPageRef) | ||
function getConverterFactory (asciidoctor) { | ||
return asciidoctor.$$const.Converter.$$const.Factory.$default(false) | ||
function createBaseHtmlConverter (asciidoctor) { | ||
return asciidoctor.Converter.Factory.getDefault(false).create('html5') | ||
} | ||
module.exports = createConverter |
@@ -21,4 +21,3 @@ 'use strict' | ||
const registry = asciidoctor.Extensions.create() | ||
// FIXME includeProcessor API does not accept an instance; use low-level API for now | ||
registry.$include_processor(IncludeProcessor.$new(callbacks.onInclude)) | ||
registry.includeProcessor(IncludeProcessor.$new(callbacks.onInclude)) | ||
return registry | ||
@@ -25,0 +24,0 @@ } |
@@ -21,3 +21,3 @@ 'use strict' | ||
Opal.defn(scope, '$process', function (doc, reader, target, attrs) { | ||
const resolvedFile = this[$callback](doc, target, doc.reader.getCursor()) | ||
const resolvedFile = this[$callback](doc, target, doc.getReader().getCursor()) | ||
if (resolvedFile) { | ||
@@ -24,0 +24,0 @@ let contents = resolvedFile.contents |
@@ -137,8 +137,4 @@ 'use strict' | ||
function isExtensionRegistered (ext, registry) { | ||
return ( | ||
registry.groups && | ||
global.Opal.hash(registry.groups) | ||
.$values() | ||
.includes(ext) | ||
) | ||
// FIXME drop check for groups property after upgrading to Asciidoctor.js 1.5.6 | ||
return registry.groups && Object.values(registry.getGroups()).includes(ext) | ||
} | ||
@@ -145,0 +141,0 @@ |
@@ -22,2 +22,3 @@ 'use strict' | ||
const attributes = target.charAt() === '#' ? undefined : Opal.hash({ role: 'page' }) | ||
// FIXME switch to node.getParent() after upgrading to Asciidoctor.js 1.5.6 | ||
node = Inline.$new(node.parent, 'anchor', content, Opal.hash({ type: 'link', target, attributes })) | ||
@@ -24,0 +25,0 @@ } |
{ | ||
"name": "@antora/asciidoc-loader", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.", | ||
@@ -9,3 +9,4 @@ "license": "MPL-2.0", | ||
"Dan Allen <dan@opendevise.com>", | ||
"Sarah White <sarah@opendevise.com>" | ||
"Sarah White <sarah@opendevise.com>", | ||
"Guillaume Grossetie <g.grossetie@gmail.com>" | ||
], | ||
@@ -19,3 +20,3 @@ "homepage": "https://antora.org", | ||
"dependencies": { | ||
"asciidoctor.js": "^1.5.6-preview.5" | ||
"asciidoctor.js": "^1.5.6-rc.1" | ||
}, | ||
@@ -22,0 +23,0 @@ "engines": { |
22620
497
Updatedasciidoctor.js@^1.5.6-rc.1