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

๐Ÿ‘Œ

๐Ÿ‘Œ

โŒ
The resolved path is /root/file:/root/path/to/file.adoc.

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

file:///root

๐Ÿ‘Œ

๐Ÿ‘Œ

โŒ
The resolved path is /root/file:/root/path/to/file.adoc.

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

๐Ÿ‘Œ

๐Ÿ‘Œ

โŒ
include uri not readable: file:///root/path/to/file.adoc.

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

๐Ÿ‘Œ

๐Ÿ‘Œ

โŒ
include uri not readable: file:///root/path/../path/to/file.adoc.

path/to/file.adoc

โŒ
Unable to get the current directory in a reliable way.

๐Ÿ‘Œ

๐Ÿ‘Œ

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

file:///root/path/to

๐Ÿ‘Œ

๐Ÿ‘Œ

โŒ
include uri not readable: file:///root/path/to/file.adoc.

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

https://raw.com/main

๐Ÿ‘Œ

๐Ÿ‘Œ

๐Ÿ‘Œ

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

๐Ÿ‘Œ

๐Ÿ‘Œ

๐Ÿ‘Œ

file.adoc

https://raw.com/main

๐Ÿ‘Œ

โŒ
SecurityError: Jail is not an absolute path: https://raw.com/main

โŒ
include file not found: {local_pwd}/https:/raw.com/main/file.adoc.

../v1.5.0/file.adoc

https://raw.com/main

๐Ÿ‘Œ

โŒ
SecurityError: Jail is not an absolute path: https://raw.com/main

โŒ
include file not found: {local_pwd}/https:/raw.com/main/file.adoc.

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

๐Ÿ‘Œ

โŒ
The xmlhttprequest module does not expand path and therefore returns a 404.

๐Ÿ‘Œ