Skip to content

Allow asciidoctor extensions when processing nav files

Łukasz Czajczyk requested to merge lukasz.czajczyk/antora:nav-extensions into main

Make use of extensions in navigation optional. This way people can decide if they want to risk it or not. After the change the code can easily be enabled using plugin syntax:

module.exports.register = function ({ config }) {
  this.on("contextStarted", () => {
    const delegate = this.getFunctions().buildNavigation
    this.replaceFunctions({
      buildNavigation(contentCatalog, siteAsciiDocConfig) {
        return delegate.call(this, contentCatalog, siteAsciiDocConfig, true)
      },
    });
  });
};

Without the change, one has to copy entire module just to change this one line locally.

Resolves #592

Edited by Łukasz Czajczyk

Merge request reports