If you use files with the extension
katetemplate
, they will be parsed for template
information, macros and a cursor position.
While reading in the file, the parser keeps
lines beginning with the phrase
katetemplate:
and searches them for
template information in the form VARIABLENAME=VALUE. The first line not
starting with katetemplate:
will be taken as the
start of the template contents. VALUE may contain any character but
equal sign (=). Legal variable names are:
Template
This is the template name, displayed in the -> menu.
Group
The group places the template in a submenu of the -> menu.
Name
This is the name that will be set for the
document, and displayed in the file list and title bar. If the
name contains %N
that will be replaced
with a number, increasing if more documents has the same
name.
Highlight
The plug-in will try to set the Highlight for the new document to the value of this variable. The value should be the name, as found in the ->.
Description
A short informative description of the template. This is currently used to set a Whatsthis string for the menu item, but may be used for more purposes in the future.
A string identifying the author, for example
in the form Name <email address>
.
This is currently used to set a Whatsthis string for the menu
item, but may be used for more purposes in the
future.
While parsing the template contents, macros in the form
%{NAME}
or ${NAME}
are
expanded. If you use the $
prefix, the
expanded macro will be treated as a editable variable when a document
is created from the template, whereas if you use
%
it is not, unless expanding failed.
The following macros are expanded:
Expands to the current time in your locale format.
Expands to the current date in short format.
Expands to the current date and time, formatted as a string according to your locale.
The current year as a four digit number.
The full name of the current month, according to your locale.
Expands to the current day of the month.
Expands to the 'hostname' of your computer.
Expands to 'i'.
Expands to your full name, as defined by the owner addressee in your standard KDE addressbook.
Expands to your first name, as defined in the owner addressee in your standard KDE addressbook.
Expands to your last name, as defined in the owner addressee in your standard KDE addressbook.
Expands to your email address, as defined by the owner address in your standard KDE addressbook.
Any macro not in the above list is treated as a editable variable no matter the prefix. If the same variable occurs multiple times in the template, they can be edited at once after creating a document from the template.
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team