Nift - input
Contents
Syntax
The syntax for inject/input calls is:
f++
:
input{options}(string)
inject{options}(string)
n++
:
@input{options}(string)
@inject{options}(string)
Description
The inject/input function is for injecting/inputting the output from parsing another file, it takes a single string parameter specifying the file to parse.
Note: Nift will not let you create an input loop, for example you cannot have @input(page.template) inside page.template, or any of the files that page.template injects, or any of the files that they inject, and so on.
Options
The following options are available for inject/input calls:
| option | description |
|---|---|
| f++ | inject output of specified file parsed with f++ |
| n++ | inject output of specified file parsed with n++ |
| raw | inject specified file as raw text |
| if-exists | inject specified file only if it exists (normally throws an error otherwise) |
| !i | do not indent |
| option | description |
f++ example
Example of input being used with f++:
<html>
<head>
@input("template/head.content")
</head>
<body>
@content
</body>
</html>
n++ example
Example of input being used with n++:
<html>
<head>
@input("template/head.content")
</head>
<body>
@content
</body>
</html>