@antora/asciidoc-loader
Advanced tools
Comparing version 2.0.0-rc.3 to 2.0.0
'use strict' | ||
module.exports = Object.freeze({ | ||
$Antora () {}, | ||
EXAMPLES_DIR_TOKEN: 'example$', | ||
PARTIALS_DIR_TOKEN: 'partial$', | ||
}) |
'use strict' | ||
const Opal = global.Opal | ||
const { $Antora } = require('../constants') | ||
const $pageRefCallback = Symbol('callback') | ||
@@ -8,3 +9,3 @@ | ||
const scope = Opal.klass( | ||
Opal.module(null, 'Antora', function $Antora () {}), | ||
Opal.module(null, 'Antora', $Antora), | ||
Opal.module(null, 'Asciidoctor').Converter.Html5Converter, | ||
@@ -11,0 +12,0 @@ 'Html5Converter', |
'use strict' | ||
const Opal = global.Opal | ||
const { $Antora } = require('../constants') | ||
@@ -14,8 +15,3 @@ const DBL_COLON = '::' | ||
const superclass = Opal.module(null, 'Asciidoctor').Extensions.IncludeProcessor | ||
const scope = Opal.klass( | ||
Opal.module(null, 'Antora', function $Antora () {}), | ||
superclass, | ||
'IncludeProcessor', | ||
function () {} | ||
) | ||
const scope = Opal.klass(Opal.module(null, 'Antora', $Antora), superclass, 'IncludeProcessor', function () {}) | ||
@@ -47,5 +43,6 @@ Opal.defn(scope, '$initialize', function initialize (callback) { | ||
reader.pushInclude(includeContents, resolvedFile.file, resolvedFile.path, startLineNum, attrs) | ||
if (resolvedFile.context) { | ||
;(reader.file = new String(reader.file)).context = resolvedFile.context // eslint-disable-line no-new-wrappers | ||
} | ||
;(reader.file = new String(reader.file)).context = resolvedFile.context // eslint-disable-line no-new-wrappers | ||
} else { | ||
log('error', `include target not found: ${target}`, reader) | ||
reader.$unshift(`Unresolved include directive in ${reader.getCursor().file} - include::${target}[]`) | ||
} | ||
@@ -52,0 +49,0 @@ }) |
@@ -26,3 +26,2 @@ 'use strict' | ||
let relative | ||
let placeholder | ||
if (RESOURCE_ID_DETECTOR_RX.test(target)) { | ||
@@ -32,6 +31,3 @@ // NOTE support legacy {partialsdir} and {examplesdir} prefixes (same as resource ID w/ only family and relative) | ||
;[family, relative] = splitOnce(target, '$') | ||
if (relative.charAt() === '/') { | ||
relative = relative.substr(1) | ||
placeholder = true | ||
} | ||
if (relative.charAt() === '/') relative = relative.substr(1) | ||
resolved = catalog.getById({ | ||
@@ -66,10 +62,2 @@ component: ctx.component, | ||
} | ||
} else { | ||
// FIXME use replace next line instead of pushing an include; maybe raise error | ||
// TODO log "Unresolved include" | ||
return { | ||
context: cursor.dir.context, | ||
file: cursor.file, | ||
contents: `+include::${placeholder ? '{' + family + 'sdir}/' + relative : target}[]+`, | ||
} | ||
} | ||
@@ -76,0 +64,0 @@ } |
{ | ||
"name": "@antora/asciidoc-loader", | ||
"version": "2.0.0-rc.3", | ||
"version": "2.0.0", | ||
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
26466
581