Skip to content

Instantly share code, notes, and snippets.

@ggrossetie
Created October 29, 2018 18:42
Show Gist options
  • Save ggrossetie/f10f2a8b461d44e4b8f7b2a76aeaf5a2 to your computer and use it in GitHub Desktop.
Save ggrossetie/f10f2a8b461d44e4b8f7b2a76aeaf5a2 to your computer and use it in GitHub Desktop.

This release is based on Asciidoctor 1.5.7.1 and Opal 0.11.99.dev (e2167f4b).

What's new and noteworthy...

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:

Changelog

Includes everything from 1.5.7-rc.1 and more!

Bug fixes

  • Processor could hang when parsing overlapping passthrough in monospaced text (#542) thanks @mojavelinux

Improvements

  • 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#hasBlocks method in API (#534) thanks @mojavelinux
const doc = asciidoctor.load(source);
console.log(doc.hasBlocks());
  • Map AbstractBlock#append method in API (#533) thanks @mojavelinux
parent.append(this.createBlock(parent, 'paragraph', 'this was only a test'));
  • Map AbstractBlock#numeral, AbstractBlock#getNumeral, AbstractBlock#setNumeral in the API (#548)
 const appendix = doc.getBlocks()[0];
console.log(appendix.getNumeral()) // A

appendix.setNumeral('B');
console.log(appendix.getNumeral()); // B
  • Map NullLogger class (#554)
  • Improve createInline function and extension initialization (#555)
  • Use simpler mechanism to convert from Opal hash to JavaScript object (#537) thanks @mojavelinux

📖 API documentation

Infrastructure

  • 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 fix to fix security issues (https://github.com/asciidoctor/asciidoctor.js/commit/74c22c1f64efc8370d3c931d236a251b53ae7547)
  • Replace async module with Promise in npm tasks (#560)

Release Meta

Released on: 2018-10-30 Released by: @Mogztter Published by: Travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment