Include the contents of an external manuscript
include
The "include" pragma is used to insert the contents of an external BLUEPHRASE file into the manuscript.
Syntax
The syntax for the include
pragma consists of:
- An exclamation point !
- The keyword include
- A
sourceref
containing the name of the external manuscript to include.
The target may be an absolute path specifying the target from the file system's root, or a relative path, specifying the target using dot notation (.\filename.blue) or dot-dot notation (..\other-dir\filename.blue).
The *type attribute is the MIME-type of the file being included. It is optional. It determines how the included file is parsed and encoded. The possible values are:
MIME-type | Interpreter |
---|---|
application/blue | Parse as BLUEPHRASE and include using the parent document's vocabulary |
application/html+blue | Parse as BLUEPHRASE and include as escaped HTML |
application/svg+blue | Parse as BLUEPHRASE and include as SVG |
application/mathml+blue | Parse as BLUEPHRASE and include as MathML |
application/xml+blue | Parse as BLUEPHRASE and include as XML |
text/plain | Parse as plain text and include as plain text |
text/css | Parse as plain text and include as CSS |
text/javascript | Parse as plain text and include as JavaScript |
text/markup | Parse as plain text and include as unescaped XML/HTML |
If the *type attribute is not specified, the filename extension is used to determine how to parse and encode the file.
Filename extension | Interpreter |
---|---|
blue | Parse as BLUEPHRASE and include using the parent document's vocabulary |
html+blue | Parse as BLUEPHRASE and include as escaped HTML |
svg+blue | Parse as BLUEPHRASE and include as SVG |
mathml+blue | Parse as BLUEPHRASE and include as MathML |
xml+blue | Parse as BLUEPHRASE and include as XML |
txt | Parse as plain text and include as plain text |
text | Parse as plain text and include as plain text |
css | Parse as plain text and include as CSS |
js | Parse as plain text and include as JavaScript |
html | Parse as plain text and include as unescaped HTML |
xml | Parse as plain text and include as unescaped XML |
svg | Parse as plain text and include as unescaped SVG |
mathml | Parse as plain text and include as unescaped MathML |
The *tag attribute is used to specify a wrapper for the included contents. It is optional. When omitted, no wrapper will be added. Typically this attribute is used to wrap a CSS file in a <style> tag or to wrap a JavaScript file in a <script> tag.
Examples
Here is what an include
pragma looks like within the body of a manuscript.