Comments

If you are building html or php pages then you can use html or php coments in your content and template files which will also appear in the source code for the built pages. If you are building output files for another language, you should also have no problems using the comment syntax for that language in your content and template files which will appear in the source code for the built output files. The index below is for comments that will be stripped at build-time with Nift.

The syntax for Nift comments should be reasonably easy to remember as it is very close to the comment syntax used in languages like html, php, javascript, css, bash, python, c/c++, etc.. An added benefit is it being easy to turn comments from those languages in to Nift comments and back again.

Raw vs. Parsed: Parsed comments have the comment text parsed with Nift's template language, so for example string definitions would be recognised, whereas raw comments do not have the comment text parsed with Nift's template language.

Special single-line comments are almost the same as raw single-line comments except that in the source code for the built output file the following line is placed on the same line after the text before @!\n. You cannot put two instances of @!\n on the same line, Nift will throw a build error.

[index]

Index

Below is an index of Nift's hard-coded comments which can be called from f++ and n++:

  • !\n (special single-line comment)
  • # (raw single-line comment)
  • #-- (parsed multi-line comment)
  • <#-- (raw multi-line comment)
  • --// (parsed single-line comment)
  • /* (raw multi-line comment)
  • // (raw single-line comment)