Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CodeSmith Basic Syntax - Use comments


May 25, 2021 CodeSmith


Table of contents


Basic syntax - Use comments

Comments can be added to the template, defined by the slt;%-and-%-gt; blocks, and comments can have multiple lines. Like what:

<%--
Name: TestHarness.cst
Description: Generates a standard test harness for an object
--%>

If you use a C#, VB.Net, or JavaScripts script in a code template, you can use comments for the language you are using, such as // or /commented /in the C?

If you need to use comments in an output file, write them directly to the template, just like anything else you want to output, and copy them directly to the output file when you generate them. Such as:

<%@ CodeTemplate Language="C#" TargetLanguage="VB">
' This class generated by CodeSmith Generator