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.