JsMrg is built on .NET Core and requires at least version 3.1.
JsMrg simply knows in and out. The magic happens inside the input file. JsMrg analyzes the input file and searches for /**jsmrg (...) */ commands. JsMrg then generates the output file according to the commands within the input file.
Just launch JsMrg with dotnet application.jsmrg.ytils.com.dll <input‑file> <output‑file>.
JsMrg knows two basic commands. include and htmlvar.
Description: Loads the referred file's content and replaces the /** jsmrg (...) */ command inside the file that is operated by JsMrg. |
---|
Usage: /**jsmrg include <file> */ This command does not have any options. |
Description: Loads the referred file's content for being used in string variables. |
---|
Usage: /**jsmrg htmlvar <options> <file> <variable replacements> */ |
Options: |
escdoublequotes Escapes double quotes within the referred HTML file. |
escsinglequotes Escapes single quotes within the referred HTML file. |
lb2space Removes line breaks within the referred HTML and replaces them with a blank space. |
Variable replacements: With JsMrg you can inject JavaScript variables into your htmlVar-variables. Use {{<placeholders>}} within your HTML and add the variables to replace the placeholders at the end of your /**jsmrg (...) */ command. You must use a prefix to specify whether your placeholders are inserted with single or double quotes. |
%d%<variable> for a double quoted variable represented by a placeholder. For example: %d%foo replaces {{foo}} with " + foo + ". A small d for double quotes. |
%s%<variable> for a single quoted variable represented by a placeholder. For example: %s%bar replaces {{bar}} with ' + bar + '. A small s for single quotes. |