|
2 | 2 |
|
3 | 3 | <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
4 | 4 | <!ENTITY app_lic SYSTEM "gpl-2.0.xml">
|
| 5 | + <!ENTITY app_tabdef SYSTEM "tabledef.xml"> |
5 | 6 | ]>
|
6 | 7 |
|
7 | 8 | <article lang="en">
|
|
10 | 11 | <title>NppSnippets, Snippets plug-in for Notepad++</title>
|
11 | 12 | <titleabbrev>NppSnippets</titleabbrev>
|
12 | 13 | <author><firstname>Frank</firstname><surname>Fesevur</surname></author>
|
13 |
| - <pubdate>2013-01-08</pubdate> |
| 14 | + <pubdate>2013-06-27</pubdate> |
14 | 15 | </articleinfo>
|
15 | 16 |
|
16 | 17 | <sect1 id="introduction">
|
|
23 | 24 | <para>The easiest way to install this plugin is by using the Plugin Manager: from the "Plugins" menu, choose the "Plugin Manager" and "Show Plugin Manager". Select the "Snippets" plugin and choose "install" and follow the instructions on the screen.</para>
|
24 | 25 | <para>To manually install the plugin, copy <computeroutput>NppSnippets.dll</computeroutput> to the <computeroutput>plugins</computeroutput> directory and copy <computeroutput>Template.sqlite</computeroutput> to the <computeroutput>plugins/config</computeroutput> directory in the user's "Application Data" directory and name it <computeroutput>NppSnippets.sqlite</computeroutput>. On my Windows 7 machine this directory is <computeroutput>C:\Users\Frank\AppData\Roaming\Notepad++\plugins\config</computeroutput>. Then (re)start Notepad++.</para>
|
25 | 26 | <para>You can place the database in the <computeroutput>plugins/config</computeroutput> directory in the Notepad++ installation directory typically in the "Program Files" directory, but this could result in a read-only database due to file permissions and/or User Account Control (UAC). Therefore it is advised to put it in your "Application Data" directory.</para>
|
26 |
| - <para>You can also specify a custom path (like a shared network path or your Dropbox directory) for your database by manually editing the <computeroutput>NppSnippets.ini</computeroutput> file and adding a <computeroutput>DBFile</computeroutput> entry pointing to the full path name of the database.</para> |
| 27 | + <para>You can also specify a custom path (like a shared network path or your Dropbox directory) for your database by manually editing the <computeroutput>NppSnippets.ini</computeroutput> file and adding a <computeroutput>DBFile</computeroutput> entry pointing to the full path name of the database. The <computeroutput>NppSnippets.ini</computeroutput> is in your "Application Data" directory.</para> |
27 | 28 | <para>When you automatically upgrade through the Plugin Manager your database is not touched. If you are manually upgrading at least replace the existing dll. It is up to you if you override your own database with the template database provided in the archive. If you have not changed existing snippets or added your own, it is recommended to use the database in the archive.</para>
|
28 | 29 | <para>Note that this is a Unicode plug-in, so it doesn't work with an ANSI versions of Notepad++. The <ulink url="http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647">Microsoft Visual C++ 2005 Redistributable Package</ulink> needs to be installed on the computer as well.</para>
|
29 | 30 | </sect1>
|
|
43 | 44 |
|
44 | 45 | <sect1 id="database">
|
45 | 46 | <title>Database</title>
|
46 |
| - <para>NppSnippets uses a <ulink url="http://www.sqlite.org/">SQLite</ulink> database to store the content. In the archive is a file named NppSnippets.sql. With this you can generate a new (almost empty) SQLite database. At least SQLite 3.6.19 is needed because a foreign key constrains are used and the plug-in will need this when the editing the data through the GUI. So be sure not to create the database with an older SQLite management tool that breaks this.</para> |
| 47 | + <para>NppSnippets uses a <ulink url="http://www.sqlite.org/">SQLite</ulink> database named <computeroutput>NppSnippets.sqlite</computeroutput> to store all the content.</para> |
| 48 | + <para>In the archive is a file named <computeroutput>NppSnippets.sql</computeroutput>. With this you can generate a new (almost empty) SQLite database. At least SQLite 3.6.19 is needed because a foreign key constrains are used and the plug-in will need this when editing the data through the GUI. So be sure not to create the database with an older SQLite management tool that breaks this.</para> |
47 | 49 | <para>You should only update, insert or delete records and not modify the structure of the database. That can cause the plug-in (and as a result of that Notepad++ itself) to crash.</para>
|
48 |
| - <para>The database structure is quite simple. There are four tables Library, LibraryLang, Snippets and LangLastUsed. There is a one-to-many relation between Library and LibraryLang, between Library and Snippets and between Library and LangLastUsed. They are all linked to each other with the LibraryID field. It is possible to have multiple libraries per language and one library can be used for many languages.</para> |
49 |
| - <para>For every library at least one record in the LibraryLang and Snippets tables is needed.</para> |
50 |
| - |
51 |
| - <table id="table_library"> |
52 |
| - <title>Table Library</title> |
53 |
| - <tgroup cols="2"> |
54 |
| - <thead> |
55 |
| - <row> |
56 |
| - <entry><para>Field</para></entry> |
57 |
| - <entry><para>Description</para></entry> |
58 |
| - </row> |
59 |
| - </thead> |
60 |
| - <tbody> |
61 |
| - <row> |
62 |
| - <entry><para>LibraryID</para></entry> |
63 |
| - <entry><para>The unique identifier of this library</para></entry> |
64 |
| - </row> |
65 |
| - <row> |
66 |
| - <entry><para>Name</para></entry> |
67 |
| - <entry><para>Name of the library</para></entry> |
68 |
| - </row> |
69 |
| - <row> |
70 |
| - <entry><para>CreatedBy</para></entry> |
71 |
| - <entry><para>Who created this library</para></entry> |
72 |
| - </row> |
73 |
| - <row> |
74 |
| - <entry><para>Comments</para></entry> |
75 |
| - <entry><para>Comments about this library</para></entry> |
76 |
| - </row> |
77 |
| - <row> |
78 |
| - <entry><para>SortBy</para></entry> |
79 |
| - <entry><para>Which fields of Snippets are used to sort 0 = "Name, Sort" 1 = "Sort, Name"</para></entry> |
80 |
| - </row> |
81 |
| - </tbody> |
82 |
| - </tgroup> |
83 |
| - </table> |
84 |
| - |
85 |
| - <table id="table_librarylang"> |
86 |
| - <title>Table LibraryLang</title> |
87 |
| - <tgroup cols="2"> |
88 |
| - <thead> |
89 |
| - <row> |
90 |
| - <entry><para>Field</para></entry> |
91 |
| - <entry><para>Description</para></entry> |
92 |
| - </row> |
93 |
| - </thead> |
94 |
| - <tbody> |
95 |
| - <row> |
96 |
| - <entry><para>LibraryID</para></entry> |
97 |
| - <entry><para>The library this item is part of</para></entry> |
98 |
| - </row> |
99 |
| - <row> |
100 |
| - <entry><para>Lang</para></entry> |
101 |
| - <entry> |
102 |
| - <para>LangType from Notepad_plus_msgs.h. There are two special cases:</para> |
103 |
| - <itemizedlist> |
104 |
| - <listitem><para>Libs with Lang = -1 are shown when there is no library for the current language</para></listitem> |
105 |
| - <listitem><para>Libs with Lang = -2 are shown for every language</para></listitem> |
106 |
| - </itemizedlist> |
107 |
| - </entry> |
108 |
| - </row> |
109 |
| - </tbody> |
110 |
| - </tgroup> |
111 |
| - </table> |
112 |
| - |
113 |
| - <table id="table_snippets"> |
114 |
| - <title>Table Snippets</title> |
115 |
| - <tgroup cols="2"> |
116 |
| - <thead> |
117 |
| - <row> |
118 |
| - <entry><para>Field</para></entry> |
119 |
| - <entry><para>Description</para></entry> |
120 |
| - </row> |
121 |
| - </thead> |
122 |
| - <tbody> |
123 |
| - <row> |
124 |
| - <entry><para>SnippetID</para></entry> |
125 |
| - <entry><para>The unique identifier of this snippet</para></entry> |
126 |
| - </row> |
127 |
| - <row> |
128 |
| - <entry><para>LibraryID</para></entry> |
129 |
| - <entry><para>The library this item is part of</para></entry> |
130 |
| - </row> |
131 |
| - <row> |
132 |
| - <entry><para>Name</para></entry> |
133 |
| - <entry><para>The name of the snippet</para></entry> |
134 |
| - </row> |
135 |
| - <row> |
136 |
| - <entry><para>BeforeSelection</para></entry> |
137 |
| - <entry><para>The text inserted before the current cursor / selection</para></entry> |
138 |
| - </row> |
139 |
| - <row> |
140 |
| - <entry><para>AfterSelection</para></entry> |
141 |
| - <entry><para>The text inserted after the current cursor / selection</para></entry> |
142 |
| - </row> |
143 |
| - <row> |
144 |
| - <entry><para>ReplaceSelection</para></entry> |
145 |
| - <entry><para>Replace a selection or ignore the selection and insert</para></entry> |
146 |
| - </row> |
147 |
| - <row> |
148 |
| - <entry><para>NewDocument</para></entry> |
149 |
| - <entry><para>Create a new document before inserting this snippet?</para></entry> |
150 |
| - </row> |
151 |
| - <row> |
152 |
| - <entry><para>NewDocumentLang</para></entry> |
153 |
| - <entry><para>Change the language of the new document to this language</para></entry> |
154 |
| - </row> |
155 |
| - <row> |
156 |
| - <entry><para>Sort</para></entry> |
157 |
| - <entry><para>Can determine the order of the snipping in the list. Depends on Library(SortBy) how the list is sorted</para></entry> |
158 |
| - </row> |
159 |
| - </tbody> |
160 |
| - </tgroup> |
161 |
| - </table> |
162 |
| - |
163 |
| - <table id="table_langlastused"> |
164 |
| - <title>Table LangLastUsed</title> |
165 |
| - <tgroup cols="2"> |
166 |
| - <thead> |
167 |
| - <row> |
168 |
| - <entry><para>Field</para></entry> |
169 |
| - <entry><para>Description</para></entry> |
170 |
| - </row> |
171 |
| - </thead> |
172 |
| - <tbody> |
173 |
| - <row> |
174 |
| - <entry><para>Lang</para></entry> |
175 |
| - <entry><para>LangType from Notepad_plus_msgs.h</para></entry> |
176 |
| - </row> |
177 |
| - <row> |
178 |
| - <entry><para>LibraryID</para></entry> |
179 |
| - <entry><para>This library is the last one used for this language</para></entry> |
180 |
| - </row> |
181 |
| - </tbody> |
182 |
| - </tgroup> |
183 |
| - </table> |
184 |
| - |
185 |
| - <para>The current schema <computeroutput>user_version</computeroutput> of the database is 3.</para> |
186 |
| - |
| 50 | + <para>The database structure is quite simple. There are four tables <computeroutput>Library</computeroutput>, <computeroutput>LibraryLang</computeroutput>, <computeroutput>Snippets</computeroutput> and <computeroutput>LangLastUsed</computeroutput>. There is a one-to-many relation between Library and LibraryLang, between Library and Snippets and between Library and LangLastUsed. They are all linked to each other with the LibraryID field. It is possible to have multiple libraries per language and one library can be used for many languages. For every library at least one record in the LibraryLang and Snippets tables is needed.</para> |
| 51 | + <para>There is a more detailed description of the fields in the tables in <xref linkend="tabledefs"/>. The current schema <computeroutput>user_version</computeroutput> of the database is 3.</para> |
187 | 52 | </sect1>
|
188 | 53 |
|
189 | 54 | <sect1 id="sqlite">
|
190 | 55 | <title>Why a SQLite database and not plain text files?</title>
|
191 |
| - <para>All the snippets are in one <ulink url="http://www.sqlite.org/">SQLite</ulink> database. SQLite is fast and easy to use. With SQLite most of the file and storage handling is taken care of. This is much more efficient then designing my own (complex) file format and implementing a parser and a writer, although I understand that editing a SQLite database is not as easy to edit for some as editing plain text files. But there is a user interface for editing the snippets.</para> |
| 56 | + <para>All the snippets are stored in one <ulink url="http://www.sqlite.org/">SQLite</ulink> database. SQLite is fast and easy to use. With SQLite most of the file and storage handling is taken care of. This is much more efficient then designing my own (complex) file format and implementing a parser and a writer, although I understand that editing a SQLite database is not as easy to edit for some as editing plain text files. But there is a user interface for editing the snippets.</para> |
192 | 57 | </sect1>
|
193 | 58 |
|
194 | 59 | <sect1 id="libraries">
|
195 | 60 | <title>Provided Snippets Libraries</title>
|
196 | 61 | <para>At this moment the template database is filled with these libraries. If you upgrade from a previous version your databases is not changed. If you want to try any of the new libraries, you must manually import those libraries from the template database.</para>
|
197 | 62 | <informaltable>
|
198 |
| - <!--title>Libraries</title--> |
199 | 63 | <tgroup cols="3">
|
200 | 64 | <thead>
|
201 | 65 | <row>
|
|
285 | 149 | <itemizedlist>
|
286 | 150 | <listitem><para>Real template handling: variables in the snippets</para></listitem>
|
287 | 151 | <listitem><para>Select a text, right-click that selection and add as new snippet.</para></listitem>
|
288 |
| - <listitem><para>If anyone can fix the MinGW compatible makefile, I can eliminate the need for the Visual C++ Redistributable Package.</para></listitem> |
| 152 | + <listitem><para>If anyone can fix the MinGW compatible makefile, I can eliminate the need for the Visual C++ Redistributable Package and provide nightly builds.</para></listitem> |
289 | 153 | <listitem><para>If possible, drag-and-drop from the list to the active document.</para></listitem>
|
290 | 154 | <listitem><para>Add keyboard shortcut keys to a snippet. It seems to be impossible to change shortcut keys on the fly. If anybody know how to get this to work, let me know!</para></listitem>
|
291 | 155 | <listitem><para>Remember the last select snippet from the list. Useful when switching between different languages.</para></listitem>
|
|
329 | 193 | <title>Release history</title>
|
330 | 194 |
|
331 | 195 | <sect2 id="v1_3_0">
|
332 |
| - <title>Version 1.3.0 (xx XXXXX 2013)</title> |
| 196 | + <title>Version 1.3.0 (30 June 2013)</title> |
333 | 197 | <itemizedlist>
|
334 |
| - <listitem><para>Fixed problem with inserting UTF snippets.</para></listitem> |
| 198 | + <listitem><para>Fixed problem with inserting UTF snippets (<ulink url="http://code.google.com/p/nppsnippets/issues/detail?id=3">issue #3</ulink>).</para></listitem> |
335 | 199 | <listitem><para>Fixed wrong title of Import Library dialog.</para></listitem>
|
336 | 200 | <listitem><para>Fixed some potential bugs found when trying to fix GCC compilation.</para></listitem>
|
337 |
| - <listitem><para>Converted the documentation from ODT to DocBook.</para></listitem> |
| 201 | + <listitem><para>Converted the documentation from ODT to DocBook. Because of that an <ulink url="http://www.fesevur.com/docbook/nppsnippets">on-line version</ulink> of the documentation is available as well.</para></listitem> |
338 | 202 | <listitem><para>Upgrade to SQLite version 3.7.17</para></listitem>
|
339 | 203 | </itemizedlist>
|
340 | 204 | </sect2>
|
|
441 | 305 |
|
442 | 306 | </sect1>
|
443 | 307 |
|
| 308 | + &app_tabdef; |
444 | 309 | &app_lic;
|
445 | 310 |
|
446 | 311 | </article>
|
0 commit comments