Asciidoctor Remote Include Processor Extension

An extension for Asciidoctor.js that allows to include remote files in Antora.

This is useful in Antora which does not enable this asciidoctor feature, see discussion here.

1. Install

Install the dependencies:

$ npm install asciidoctor.js asciidoctor-remote-include-processor

2. Usage

2.1. Register as an Asciidoctor extension in the Antora playbook of your website

asciidoc:
  extensions:
  - "@feelpp/asciidoctor-remote-include-extension"

2.2. Include a remote file

In an Antora adoc page, include a remote file


[source,cpp]
----
#include 

int main(int argc, char** argv )
{
  // tag::hello[]
  std::cout << "Hello World!" << std::endl;
  // end::hello[]
}
----

which gives:

#include <iotream>

int main(int argc, char** argv )
{
  // tag::hello[]
  std::cout << "Hello World!" << std::endl;
  // end::hello[]
}

2.3. Include a remote file partially using tags

In Asciidoctor we can include a source file partially using tags, see here. The extension enables this very feature.


[source,cpp]
----
  std::cout << "Hello World!" << std::endl;
----

which gives:

  std::cout << "Hello World!" << std::endl;

3. Acknowledgments

and of course