8aae342458
Deleted all jpg images and replaced them by png images. Updated date in documentation and manpage. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1135 ea778897-0a13-0410-b9d1-a72fbfd435f5
47 lines
6.7 KiB
HTML
47 lines
6.7 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Templates</title><link rel="stylesheet" href="geany.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="Geany 0.10"><link rel="up" href="ch04.html" title="Chapter 4. Configuration files"><link rel="prev" href="ch04s02.html" title="Filetype extensions"><link rel="next" href="apa.html" title="Appendix A. Scintilla keyboard commands"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Templates</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Configuration files</th><td width="20%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797595"></a>Templates</h2></div></div></div><p>
|
||
<span class="application">Geany</span> supports several templates for file headers,
|
||
multiline comments (frame comments), function descriptions, a typical ChangeLog entry
|
||
and a short GPL notice. To use these templates, just open the Edit menu or open the
|
||
popup menu by right-clicking in the editor widget, and choose "Insert Comments" and
|
||
insert templates as you want.
|
||
</p><p>
|
||
Some templates (like file header or ChangeLog entry) will always be inserted at the
|
||
top of the file.
|
||
</p><p>
|
||
To insert a function description, the cursor must be inside of the function, so that
|
||
the function name can be determined automatically. The description will be positioned
|
||
correctly one line above the function, just check it out. If the cursor is not inside
|
||
of a function or the function name cannot be determined, you cannot insert a function
|
||
description.
|
||
</p><p>
|
||
Each template can be customized to your needs. The templates are in the configuration
|
||
directory, which is in <code class="filename">~/.geany/</code> (see <a href="ch03s02.html" title="Command line options">the section called “Command line options”</a>
|
||
for further information about the configuration directory). Just open the desired
|
||
template with an editor (ideally <span class="application">Geany</span> ;-) ) and edit
|
||
the template as your needs. There are some wildcards which will be automatically
|
||
replaced by <span class="application">Geany</span> at startup.
|
||
</p><p>
|
||
All wildcards must be enclosed by "{" and "}", e.g. {date}.
|
||
</p><p>
|
||
In the configuration dialog you can find a tab "Templates"
|
||
(see <a href="ch03s06.html#confdialog_templ" title="Figure 3.10. Template tab in preferences dialog">Figure 3.10, “Template tab in preferences dialog”</a>). You can define the default values which
|
||
will be inserted in the templates. You should restart <span class="application">Geany</span>
|
||
after making changes, because they are only read at startup.
|
||
</p><p>
|
||
Since <span class="application">Geany</span> 0.3 there are also templates for creating new
|
||
files. They can be found in <code class="filename">~/.geany/</code>, too. All template
|
||
files for creating new files begin with <code class="filename">template.filetype.</code>
|
||
followed by the filetype. At creating a new file with a filetype template, the
|
||
template for the fileheader is automatically prepended.
|
||
</p><p> </p><p>
|
||
</p><div class="table"><a name="id2797717"></a><p class="title"><b>Table 4.4. Template wildcards</b></p><div class="table-contents"><table summary="Template wildcards" cellspacing="0" cellpadding="4" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Wildcard</th><th>Description</th><th>Available in following templates</th></tr></thead><tbody><tr><td>developer</td><td>The name of the developer.</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>initial</td><td>The developer's initials, e.g. "ET" for
|
||
Enrico Tröger or "JFD" for John Foobar Doe.</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>mail</td><td>The email address of the developer.</td><td>file header, function description, ChangeLog entry</td></tr><tr><td>company</td><td>The company the developer is working for.</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>year</td><td>The current year in the format: YYYY</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>version</td><td>The initial version of a new file.</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>date</td><td>The current date in the format: YYYY-MM-DD</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>untitled</td><td>The string "untitled" (this will be translated to your locale),
|
||
used in filetype templates</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>geanyversion</td><td>The actual <span class="application">Geany</span> version,
|
||
e.g. "Geany 0.10"
|
||
</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>datetime</td><td>The current date and time in the format: DD.MM.YYYY HH:mm:ss ZZZZ</td><td>file header, function description</td></tr><tr><td>filename</td><td>The filename of the current file. Only available for the file header template.</td><td>file header</td></tr><tr><td>gpl</td><td>This wildcard inserts a short GPL notice.</td><td>file header</td></tr><tr><td>functionname</td><td>The function name of the function at the cursor position.
|
||
This wildcard will only be replaced in the function
|
||
description template.</td><td>function description</td></tr></tbody></table></div></div><p><br class="table-break">
|
||
If you need any other wildcards or a special date/time format, please email the
|
||
author <code class="email"><<a href="mailto:enrico.troeger@uvena.de">enrico.troeger@uvena.de</a>></code>.
|
||
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Filetype extensions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. Scintilla keyboard commands</td></tr></table></div></body></html>
|