Include directive support matrix

This document describes how the include directive is resolved in the following environments:

  • Browser (XMLHttpRequest IO module)

  • Node.js

  • MRI (Ruby)

Path Base dir Browser Node.js MRI

path/to/file.adoc

file:///root

:ok_hand:

:ok_hand:

:x:
The resolved path is /root/file:/root/path/to/file.adoc.

path/../path/to/file.adoc

file:///root

:ok_hand:

:ok_hand:

:x:
The resolved path is /root/file:/root/path/to/file.adoc.

file:///root/path/to/file.adoc

:ok_hand:

:ok_hand:

:x:
include uri not readable: /root/path/to/file.adoc.

file:///root/path/../path/to/file.adoc

:ok_hand:

:ok_hand:

:x:
include uri not readable: /root/path/../path/to/file.adoc.

path/to/file.adoc

:x:
Unable to get the current directory in a reliable way.

:ok_hand:

:ok_hand:

file:///root/path/to/file.adoc

file:///root/path/to

:ok_hand:

:ok_hand:

:x:
include uri not readable: /root/path/to/file.adoc.

https://raw.com/master/file.adoc

https://raw.com/master

:ok_hand:

:ok_hand:

:ok_hand:

https://raw.com/master/file.adoc

:ok_hand:

:ok_hand:

:ok_hand:

file.adoc

https://raw.com/master

:ok_hand:

:x:
SecurityError: Jail is not an absolute path: raw.com/master

:x:
include file not found: {local_pwd}/https:/raw.com/master/file.adoc.

../v1.5.0/file.adoc

https://raw.com/master

:ok_hand:

:x:
SecurityError: Jail is not an absolute path: raw.com/master

:x:
include file not found: {local_pwd}/https:/raw.com/master/file.adoc.

https://raw.com/master/../v1.5.0/file.adoc

:ok_hand:

:x:
The xmlhttprequest module does not expand path and therefore returns a 404.

:ok_hand: