This release is based on Asciidoctor 1.5.7.1 and Opal 0.11.99.dev (e2167f4b).
In this release, we added initial support for GraalVM. If you want to embed Asciidoctor.js in a JVM-based application with GraalVM, please read the dedicated section in the User Manual.
A complete set of API is available to take full advantage of the new logging system introduced in Asciidoctor 1.5.7. Everything you need to know about the new Logging API is described in the User Manual:
- how to use the built-in In-memory Logger,
- how to replace the default Logger,
- how to create a custom Logger,
- how to replace the default Logger formatter
- and much more...
Includes everything from 1.5.7-rc.1 and more!
- Processor could hang when parsing overlapping passthrough in monospaced text (#542) thanks @mojavelinux
- Update to Opal 0.11.1.dev@3c8d93e (#511)
- Produce a GraalVM compatible version of Asciidoctor.js (#559)
- Add a Logger API (#553)
const defaultLogger = asciidoctor.LoggerManager.getLogger();
console.log(defaultLogger.getLevel()); // 2
console.log(defaultLogger.getProgramName()); // asciidoctor
console.log(defaultLogger.getMaxSeverity()); // 2
defaultLogger.setProgramName('asciidoctor.js');
console.log(defaultLogger.getProgramName()); // asciidoctor.js
defaultLogger.setLevel(3);
console.log(defaultLogger.getLevel()); // 3- Add a LoggerManager API (#553)
defaultLogger.setFormatter(asciidoctor.LoggerManager.newFormatter('JsonFormatter', {
call: function (severity, time, programName, message) {
const text = message['text'];
return JSON.stringify({
programName: programName,
message: text,
severity: severity
}) + '\n';
}
});- Add a Logger API (#557)
asciidoctor.LoggerManager.setLogger(asciidoctor.LoggerManager.newLogger('AsyncFileLogger', {
postConstruct: function () {
this.writer = fs.createWriteStream(logFile, {
flags: 'a'
});
},
add: function (severity, _, message) {
const log = this.formatter.call(severity, new Date(), this.progname, message);
this.writer.write(log);
}
}));- Map
AbstractBlock#hasBlocksmethod in API (#534) thanks @mojavelinux
const doc = asciidoctor.load(source);
console.log(doc.hasBlocks());- Map
AbstractBlock#appendmethod in API (#533) thanks @mojavelinux
parent.append(this.createBlock(parent, 'paragraph', 'this was only a test'));- Map
AbstractBlock#numeral,AbstractBlock#getNumeral,AbstractBlock#setNumeralin the API (#548)
const appendix = doc.getBlocks()[0];
console.log(appendix.getNumeral()) // A
appendix.setNumeral('B');
console.log(appendix.getNumeral()); // B- Map
NullLoggerclass (#554) - Improve
createInlinefunction and extension initialization (#555) - Use simpler mechanism to convert from Opal hash to JavaScript object (#537) thanks @mojavelinux
- The User Manual is now published with Antora on Netlify
- Improve the Getting Started section (#513)
- Document each extension points (#519)
- Document how to apply a theme (#520)
- Document how to use the new Logging system introduced in Asciidoctor 1.5.7 (#551)
- Document how to use Asciidoctor.js with GraalVM (#566)
- Switch back to npm and remove yarn.lock (#494)
- Run
npm audit fixto fix security issues (https://github.com/asciidoctor/asciidoctor.js/commit/74c22c1f64efc8370d3c931d236a251b53ae7547) - Replace
asyncmodule withPromisein npm tasks (#560)
Released on: 2018-10-30 Released by: @Mogztter Published by: Travis