| 1 |
XML Snippets Plugin |
| 2 |
=================== |
| 3 |
|
| 4 |
About |
| 5 |
----- |
| 6 |
This plugin extends XML/HTML tag autocompletion provided by Geany. |
| 7 |
It automatically inserts a matching snippet after you type an opening tag. |
| 8 |
|
| 9 |
Usage |
| 10 |
----- |
| 11 |
Enable the plugin in the Plugin Manager and add snippets you need to your |
| 12 |
``snippets.conf``. For example, to get an HTML definition list template |
| 13 |
automatically inserted after you type "<dl>", add the following snippet to |
| 14 |
the ``[HTML]`` section:: |
| 15 |
|
| 16 |
dl=<dl>\n\t<dt>%cursor%</dt>\n\t<dd>%cursor%</dd>\n</dl> |
| 17 |
|
| 18 |
The plugin will automatically catch up snippets supplied with Geany (for |
| 19 |
example, "table"). |
| 20 |
|
| 21 |
Notes: |
| 22 |
|
| 23 |
* The plugin will only use snippets which body starts with a tag, optionally |
| 24 |
preceded by whitespace. This is to prevent erroneus insertion of snippets |
| 25 |
which you may have defined for, e.g., JavaScript. |
| 26 |
* If you typed some attributes within a tag which is then automatically |
| 27 |
completed by the plugin, the attributes will be copied to the first tag |
| 28 |
of the snippet body. If that tag already contains attributes, |
| 29 |
autocompletion will not proceed. |
| 30 |
|
| 31 |
You can use this plugin together with tag autocompletion provided by Geany. |
| 32 |
Tags, for which you defined snippets, will be completed by the plugin; |
| 33 |
Geany will deal with other tags. |
| 34 |
|
| 35 |
Requirements |
| 36 |
------------ |
| 37 |
For compiling the plugin yourself, you will need the GTK (>= 2.8.0) libraries |
| 38 |
and header files. You will also need its dependency libraries and header |
| 39 |
files, such as Pango, Glib and ATK. All these files are available at |
| 40 |
http://www.gtk.org. |
| 41 |
|
| 42 |
And obviously, you will need have Geany installed. |
| 43 |
If you have Geany installed from the sources, you should be ready to go. |
| 44 |
If you used a prepared package e.g. from your distribution you probably need to |
| 45 |
install an additional package, this might be called geany-dev or geany-devel. |
| 46 |
|
| 47 |
Furthermore you need, of course, a C compiler and the Make tool. |
| 48 |
The GNU versions of these tools are recommended. |
| 49 |
|
| 50 |
Installation |
| 51 |
------------ |
| 52 |
Compiling and installing the code is done by the following three commands:: |
| 53 |
|
| 54 |
$ ./configure |
| 55 |
$ make |
| 56 |
$ make install |
| 57 |
|
| 58 |
For more configuration details run:: |
| 59 |
|
| 60 |
$ ./configure --help |
| 61 |
|
| 62 |
If there are any errors during compilation, check your build environment |
| 63 |
and try to find the error, otherwise contact one of the authors. |
| 64 |
|
| 65 |
Running the built-in test suite |
| 66 |
------------------------------- |
| 67 |
This stage is completely optional and does not affect the work of the plugin. |
| 68 |
It is useful for plugin developers so that they are sure the innards of the |
| 69 |
plugin are working as expected. |
| 70 |
|
| 71 |
To run the tests, you have to compile a test executable and run it using the |
| 72 |
commands below. These commands will only work if you are using a Unix |
| 73 |
environment and GCC compiler. Before running the commands, go to the source |
| 74 |
code directory (``xmlsnippets/src``). |
| 75 |
:: |
| 76 |
|
| 77 |
$ gcc -Wall -DTEST -ggdb `pkg-config --cflags --libs glib-2.0` *.c -o xmlsnippets |
| 78 |
$ ./xmlsnippets |
| 79 |
|
| 80 |
The executable will warn you about the tests which failed. Ignore non-warning |
| 81 |
informational messages like those starting with ``** Message:``. |
| 82 |
|
| 83 |
License |
| 84 |
------- |
| 85 |
This plugin is distributed under the terms of the GNU General Public License |
| 86 |
as published by the Free Software Foundation; either version 2 of the |
| 87 |
License, or (at your option) any later version. A copy of this license |
| 88 |
can be found in the file COPYING included with the source code. |
| 89 |
|
| 90 |
Ideas, questions, patches and bug reports |
| 91 |
----------------------------------------- |
| 92 |
Report them to the Geany mailing list (see |
| 93 |
http://www.geany.org/Support/MailingList). |