Include directive support matrix

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

  • Browser (XMLHttpRequest IO module)

  • Node.js

  • Ruby (MRI)

File / Message Base dir Browser Node.js Ruby

path/to/file.adoc

file:///root

👌

👌

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

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

file:///root

👌

👌

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

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

👌

👌

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

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

👌

👌

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

path/to/file.adoc

👌

👌

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

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

file:///root/path/to

👌

👌

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

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

https://raw.com/master

👌

👌

👌

Not applicable

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

👌

👌

👌

Not applicable

file.adoc

https://raw.com/master

👌

Node.js: SecurityError: Jail is not an absolute path: https://raw.com/master
Ruby: include file not found: {local_pwd}/https:/raw.com/master/file.adoc.

../v1.5.0/file.adoc

https://raw.com/master

👌

Node.js: SecurityError: Jail is not an absolute path: https://raw.com/master
Ruby: include file not found: {local_pwd}/https:/raw.com/master/file.adoc.

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

👌

👌

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