~ubuntu-branches/ubuntu/jaunty/geany/jaunty

« back to all changes in this revision

Viewing changes to doc/html/ch03s10.html

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2007-02-25 21:12:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070225211213-jk4d4vxtgji0rj74
Tags: 0.10.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<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.68.1"><link rel="start" href="index.html" title="
2
 
                        Geany 0.8
3
 
                "><link rel="up" href="ch03.html" title="Chapter 3. Usage"><link rel="prev" href="ch03s09.html" title="Filetype definition files"><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="ch03s09.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Usage</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="id2754958"></a>Templates</h2></div></div></div><p>
4
 
                                <span class="application">Geany</span> supports several templates for file headers, multiline
5
 
                                comments (frame comments), function descriptions, a typical ChangeLog entry and a short GPL notice.
6
 
                                To use these templates, just open the Edit menu or open the popup menu by right-clicking in the
7
 
                                editor widget, and choose "Insert Comments" and insert templates as you want.
8
 
                        </p><p>
9
 
                                Some templates (like file header or ChangeLog entry) will always be inserted at the top of the file.
10
 
                        </p><p>
11
 
                                To insert a function description, the cursor must be inside of the function, so that the function
12
 
                                name can be determined automatically. The description will be positioned correctly one line above
13
 
                                the function, just check it out. If the cursor is not inside of a function or the function name cannot
14
 
                                be determined, you cannot insert a function description.
15
 
                        </p><p>
16
 
                                Each template can be customized to your needs. The templates are in the configuration directory, which
17
 
                                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
18
 
                                configuration directory). Just open the desired template with an editor (ideally Geany ;-) ) and edit
19
 
                                the template as your needs.     There are some wildcards which will be automatically replaced by
20
 
                                <span class="application">Geany</span> at startup.
21
 
                        </p><p>
22
 
                                All wildcards must be enclosed by "{" and "}", e.g. {date}.
23
 
                        </p><p>
24
 
                                In the configuration dialog you can find a tab "Templates" (see <a href="ch03s05.html#confdialog_templ" title="Figure 3.5. Template tab in preferences dialog">Figure 3.5, “Template tab in preferences dialog”</a>).
25
 
                                You can define the default values which will be inserted in the templates. You should restart
26
 
                                <span class="application">Geany</span> after making changes, because they are only read at startup.
27
 
                        </p><p>
28
 
                                Since <span class="application">Geany</span> 0.3 there are also templates for creating new files.
29
 
                                They can be found in <code class="filename">~/.geany/</code>, too.
30
 
                                All template files for creating new files begin with
31
 
                                <code class="filename">template.filetype.</code> followed by the filetype.
32
 
                                At creating a new file with a filetype template, the template for the fileheader is automatically prepended.
33
 
                                Please note that the complete behaviour is still under development and will probably be changed in one of
34
 
                                the next releases. Sorry.
35
 
                        </p><p> </p><p>
36
 
                                </p><div class="table"><a name="id2755076"></a><p class="title"><b>Table 3.8. Template wildcards</b></p><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
37
 
                                                                           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),
38
 
                                                                           used in filetype templates</td><td>filetypes, file header, function description, ChangeLog entry</td></tr><tr><td>geanyversion</td><td>The actual Geany version, e.g. "Geany 0.8"</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.
39
 
                                                                           This wildcard will only be replaced in the function
40
 
                                                                           description template.</td><td>function description</td></tr></tbody></table></div><p>
41
 
                                If you need any other wildcards or a special date/time format, please email the author <code class="email">&lt;<a href="mailto:enrico.troeger@uvena.de">enrico.troeger@uvena.de</a>&gt;</code>.
42
 
                        </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.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 definition files </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>