Tutorial
Customizing Template Files
This tutorial will show you how to customize a template file so it will be more useful
and better meet your needs.
To illustrate the concept.we will assume that you want to customize the generic template
for web files - template.html.
1. Open the desired template file in MultiEd:
By default, templates are stored in the MultiEd directory.
Click on the open button .
Navigate to the MultiEd directory (normally C:\MultiEd) and select "template.html" It will look
like what is shown on the right:
|
|
| 2. For the time being ignore the items inside of { }.
|
3. Customize the template: We will customize the template as follows:
- Change the colors of the document to they have a yellow font on a blue background.
- Add a created date at the end of the body.
- Change the comment to reflect the above changes.
The revised template is shown on the right.
|
|
4. Save the template: There are three options for saving the revised template:
- Replace the existing template. You can just use the save button
Save the customized file with a new name keeping the original. Use the "File | Save As ..."
menu item. The name should begin with "template" and have the same file type.
- If you are using a shared computer whose files are read-only: You will need to follow
the previous option but this time pick a directory where you have write priveleges.
5. You can use the new template just like any other template. If you used option "c" above, you will
need to browse to the appropriate directory and select the file.
Special macro instructions in template files.
MultiEd treats templates as macros and they contain macro instructions. MultiEd help contains
information about macros. We will just explain a few of the macro instructions commonly found
in templates.
But first we must explain that macros normally treat the pairs { }, < >, ( ), and [ ] as meta characters
with special meanings. MultiEd macros are basically keyboard macros. Ignoring a few special
instructions, text in templates and macros tell MultiEd what keys would need to be pressed. That includes
pressing some special keys on the keyboard.
{ } - These enclose special macro instructions or treat a character as a literal.
< > - These mean press and release the Control button.
( ) - These mean press and release the Shift button but they are normally not needed because
MultiEd processes capital letters automatically.
[ ] - These mean press and release the Alt button.
Some macro instructions
- {literal on}
- Meta characters are common in templates. {literal on} is commonly used to
tell MultiEd to treat
all characters literally ignoring the special meaning of meta characters.
- {literal off}
- Stop treating meta characters literally and use them for macro instructions.
- {comment text}
- The text is a comment for the sake of humans and is ignored by MultiEd.
- {autoindent off}
- Turn off MultiEd's autoindent feature so that text is not automatically indented by
the same amount as the previous line in addition to any new indentation on the
current line.
- {autoindent on}
- Turn MultiEd's autoindent feature back on. Of course, literal must be off before it
is recognized.
- {bs}
- Press the backspace key.
- {read filename}
- Start reading the specified file treating it as a macro. After finishing the file, return to the
current template.
- {date}
- This is replaced by the current date but only when literal is off. Hence, it is common to
see the sequence.:
{literal off}{date}{literal on}
- %name%
- This is always replaced by the name of the file being written (even when literal is on).
- %multieddir%
- This is always replaced by the path to the directory containing the MultiEd files.
Revised Feb. 2, 2006