diff --git a/.gitignore b/.gitignore index 8ceb908..983114c 100755 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,9 @@ -__* +_* *.suo *.ncb *.user *.opensdf *.sdf -!__Docs !__SQL !__SampleDB [Rr]elease/ diff --git a/__Docs/Makefile b/__Docs/Makefile deleted file mode 100644 index 92a40b1..0000000 --- a/__Docs/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# Build the documentation from the DocBook XML -# - -html: - rm -rf _html - mkdir _html - cp docbook.css _html - cd _html; xmlto --with-dblatex xhtml -m ../config_html.xsl ../ReadMe.xml - -pdf: - xmlto --with-dblatex pdf ReadMe.xml - -clean: - rm -rf _html ReadMe.pdf diff --git a/__Docs/ReadMe.xml b/__Docs/ReadMe.xml deleted file mode 100644 index 61c55c7..0000000 --- a/__Docs/ReadMe.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - -]> - -
- - - NppSnippets, Snippets plug-in for Notepad++ - NppSnippets - FrankFesevur - 2013-06-27 - - - - Introduction - NppSnippets is a plug-in for Notepad++. It adds the possibility to add code snippets to the current document by selecting it from a simple list. - - - - How to install or upgrade - 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. - To manually install the plugin, copy NppSnippets.dll to the plugins directory and copy Template.sqlite to the plugins/config directory in the user's "Application Data" directory and name it NppSnippets.sqlite. On my Windows 7 machine this directory is C:\Users\Frank\AppData\Roaming\Notepad++\plugins\config. Then (re)start Notepad++. - You can place the database in the plugins/config 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. - You can also specify a custom path (like a shared network path or your Dropbox directory) for your database by manually editing the NppSnippets.ini file and adding a DBFile entry pointing to the full path name of the database. The NppSnippets.ini is in your "Application Data" directory. - 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. - Note that this is a Unicode plug-in, so it doesn't work with an ANSI versions of Notepad++. - - - - How to use - To open the Snippets window, click on the "jigsaw" button on the toolbar, or via the menu "Plugins", "Snippets", "Snippets". - The window consists of two parts. A combo-box where you can select the library and underneath it is the list of snippets in the chosen library. To insert a snippet simply double-click on the item in the list and the snippet is inserted at the current cursor position. - When you switch to a document with another language the snippets for that new language are read from the database. - - - - How to add or edit libraries or snippets - To add or edit a snippet, right-click the snippet in the list and edit. To add or edit a library right-click the combo-box where you select the current library. You can also import a library from another database via this context menu. - To add a lot of snippets, I suggest that you look at the section below that describes the database structure and import your data with you favorite SQLite management tool. - - - - Database - NppSnippets uses a SQLite database named NppSnippets.sqlite to store all 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 editing the data through the GUI. So be sure not to create the database with an older SQLite management tool that breaks this. - 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. - 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. For every library at least one record in the LibraryLang and Snippets tables is needed. - There is a more detailed description of the fields in the tables in . The current schema user_version of the database is 3. - - - - Why a SQLite database and not plain text files? - All the snippets are stored in one SQLite 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. - - - §1_libraries; - - - User generated libraries - From version 0.7 it is possible to import libraries from another NppSnippets database. This way redistributing user generated libraries becomes easy. If you have created your own library and think it can be useful for others, send it to me and I will put them on my website. - - - - Frequently Asked Questions - - - - Can I assign a shortcut key to a certain snippet? - - - This is on the wish list, but I don't think it is possible. Shortcut key are assigned to menu items when the plug-ins are loaded. But individual snippets are not menu items. And shortcut keys need to be changeable on when you change the language the key assignments need to change on the fly. Consider Ctrl-B: this could be bold in HTML, but break in a c-styled languages and a begin/end block in Pascal. - But a pointer to a way to implement this is any way, or even better a patch that fixes this is much appreciated. - - - - - - - Wish List - - Real template handling: variables in the snippets - Select a text, right-click that selection and add as new snippet. - If anyone can fix the MinGW compatible makefile, I can eliminate the need for the Visual C++ Redistributable Package and provide nightly builds. - If possible, drag-and-drop from the list to the active document. - Assign keyboard shortcut keys to a snippet. - Remember the last select snippet from the list. Useful when switching between different languages. - Add support for multiple selections. - Easier sorting for non-alphabetic libraries. (move to top, move to bottom, dragging?) - Export one or more library. - Copy a certain snippet to another library. - Properly indent the snippet when inserting. - Options dialog to edit the location of the database. - - - - - Known Issues - - Closing the snippets window with the 'x' does not update toolbar icon and menu item. And as a result of that the state is not remembered properly. I need to find the notification that is send to the window on clicking the 'x'. - When a library is not alphabetic sorted, and you move an item up or down, this is slow. This is because the "Sort"-field of all the snippets of that library need to be updated in the database. - On Windows XP disabling context menu items like the "Move Up" and "Move Down" menu items is not visible. They don't turn gray but they are really disabled. - The icon on the docking tab is inverted for some strange reason. - When there is no write-access to the database, this is not properly handled. - - - - - License - This plug-in is published under the GPL-2 license. See for the full license agreement. You can download the sources of the latest version from https://github.com/ffes/nppsnippets. - - - - How to compile - To compile NppSnippets you need Visual Studio. Project files for VS 2010 and VS 2013 are provided and actively used. To compile with other versions of Visual Studio you can convert an existing project file, but it is not tested. - There is also a MinGW-w64 makefile, using their 32-bit compilers. It can be used from Cygwin and MSys. The makefile compiles the sources and it generates a dll file, however at the moment that dll does not work. Pull requests are welcome! When you compile with MinGW, you need to create an empty file named Makefile.deps. Pull request to fix that are welcome as well. - - - - Contact - The project's web page can be found at http://www.fesevur.com/nppsnippets. The downloads, issue tracker and git repository can be found at https://github.com/ffes/nppsnippets. - If you have problems with, questions about or suggestions for NppSnippets you can contact me at fesevur@gmail.com. - - - §1_history; - &app_tabdef; - &app_lic; - -
diff --git a/__Docs/config_html.xsl b/__Docs/config_html.xsl deleted file mode 100644 index 33a1f65..0000000 --- a/__Docs/config_html.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/__Docs/docbook.css b/__Docs/docbook.css deleted file mode 100644 index 941c066..0000000 --- a/__Docs/docbook.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - font-family: Verdana; -} \ No newline at end of file diff --git a/__Docs/gpl-2.0.xml b/__Docs/gpl-2.0.xml deleted file mode 100644 index 44b6b2e..0000000 --- a/__Docs/gpl-2.0.xml +++ /dev/null @@ -1,304 +0,0 @@ - - - GNU General Public License - Version 2, June 1991 - - 1989, 1991 - Free Software Foundation, Inc. - - - -
Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 - USA -
-
- Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -
- Version 2, June 1991 -
- GNU General Public License -
- Preamble - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public License is - intended to guarantee your freedom to share and change - free software - to make sure the software is free for all its users. - This General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit - to using it. (Some other Free Software Foundation software is covered - by the GNU Library General Public License instead.) You can apply it - to your programs, too. - - When we speak of free software, we are referring to freedom, not price. - Our General Public Licenses are designed to make sure that you have the - freedom to distribute copies of free software (and charge for this - service if you wish), that you receive source code or can get it if you - want it, that you can change the software or use pieces of it in new free - programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid anyone - to deny you these rights or to ask you to surrender the rights. These - restrictions translate to certain responsibilities for you if you distribute - copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether gratis or - for a fee, you must give the recipients all the rights that you have. You - must make sure that they, too, receive or can get the source code. And you - must show them these terms so they know their rights. - - We protect your rights with two steps: - - - copyright the software, and - - - offer you this license which gives you legal permission to copy, - distribute and/or modify the software. - - - - - Also, for each author's protection and ours, we want to make certain that - everyone understands that there is no warranty for this free software. If - the software is modified by someone else and passed on, we want its - recipients to know that what they have is not the original, so that any - problems introduced by others will not reflect on the original authors' - reputations. - - Finally, any free program is threatened constantly by software patents. - We wish to avoid the danger that redistributors of a free program will - individually obtain patent licenses, in effect making the program - proprietary. To prevent this, we have made it clear that any patent must be - licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and modification - follow. -
-
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -
- Section 0 - This License applies to any program or other work which contains a notice - placed by the copyright holder saying it may be distributed under the terms - of this General Public License. The Program, below, refers to any such - program or work, and a - work based on the Program means either - the Program or any derivative work under copyright law: that is to say, a - work containing the Program or a portion of it, either verbatim or with - modifications and/or translated into another language. (Hereinafter, translation - is included without limitation in the term - modification.) Each licensee is addressed as you. - - Activities other than copying, distribution and modification are not covered by - this License; they are outside its scope. The act of running the Program is not - restricted, and the output from the Program is covered only if its contents - constitute a work based on the Program (independent of having been made by running - the Program). Whether that is true depends on what the Program does. -
-
- Section 1 - You may copy and distribute verbatim copies of the Program's source code as you - receive it, in any medium, provided that you conspicuously and appropriately - publish on each copy an appropriate copyright notice and disclaimer of warranty; - keep intact all the notices that refer to this License and to the absence of any - warranty; and give any other recipients of the Program a copy of this License - along with the Program. - - You may charge a fee for the physical act of transferring a copy, and you may at - your option offer warranty protection in exchange for a fee. -
-
- Section 2 - You may modify your copy or copies of the Program or any portion of it, thus - forming a work based on the Program, and copy and distribute such modifications - or work under the terms of - Section 1 above, provided - that you also meet all of these conditions: - - - You must cause the modified files to carry prominent notices stating that - you changed the files and the date of any change. - - - You must cause any work that you distribute or publish, that in whole or - in part contains or is derived from the Program or any part thereof, to be - licensed as a whole at no charge to all third parties under the terms of - this License. - - - If the modified program normally reads commands interactively when run, you - must cause it, when started running for such interactive use in the most - ordinary way, to print or display an announcement including an appropriate - copyright notice and a notice that there is no warranty (or else, saying - that you provide a warranty) and that users may redistribute the program - under these conditions, and telling the user how to view a copy of this - License. (Exception: If the Program itself is interactive but does not - normally print such an announcement, your work based on the Program is not - required to print an announcement.) - - - - - These requirements apply to the modified work as a whole. If identifiable sections - of that work are not derived from the Program, and can be reasonably considered - independent and separate works in themselves, then this License, and its terms, - do not apply to those sections when you distribute them as separate works. But when - you distribute the same sections as part of a whole which is a work based on the - Program, the distribution of the whole must be on the terms of this License, whose - permissions for other licensees extend to the entire whole, and thus to each and - every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or contest your rights - to work written entirely by you; rather, the intent is to exercise the right to control - the distribution of derivative or collective works based on the Program. - - In addition, mere aggregation of another work not based on the Program with the Program - (or with a work based on the Program) on a volume of a storage or distribution medium - does not bring the other work under the scope of this License. -
-
- Section 3 - You may copy and distribute the Program (or a work based on it, under - Section 2 in object code or executable form under the terms of - Sections 1 and - 2 above provided that you also do one of the following: - - - Accompany it with the complete corresponding machine-readable source code, which - must be distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - - Accompany it with a written offer, valid for at least three years, to give any - third party, for a charge no more than your cost of physically performing source - distribution, a complete machine-readable copy of the corresponding source code, - to be distributed under the terms of Sections 1 and 2 above on a medium customarily - used for software interchange; or, - - - Accompany it with the information you received as to the offer to distribute - corresponding source code. (This alternative is allowed only for noncommercial - distribution and only if you received the program in object code or executable form - with such an offer, in accord with Subsection b above.) - - - - - The source code for a work means the preferred form of the work for making modifications - to it. For an executable work, complete source code means all the source code for all modules - it contains, plus any associated interface definition files, plus the scripts used to control - compilation and installation of the executable. However, as a special exception, the source - code distributed need not include anything that is normally distributed (in either source or - binary form) with the major components (compiler, kernel, and so on) of the operating system - on which the executable runs, unless that component itself accompanies the executable. - - If distribution of executable or object code is made by offering access to copy from a - designated place, then offering equivalent access to copy the source code from the same place - counts as distribution of the source code, even though third parties are not compelled to - copy the source along with the object code. -
-
- Section 4 - You may not copy, modify, sublicense, or distribute the Program except as expressly provided - under this License. Any attempt otherwise to copy, modify, sublicense or distribute the - Program is void, and will automatically terminate your rights under this License. However, - parties who have received copies, or rights, from you under this License will not have their - licenses terminated so long as such parties remain in full compliance. -
-
- Section 5 - You are not required to accept this License, since you have not signed it. However, nothing - else grants you permission to modify or distribute the Program or its derivative works. - These actions are prohibited by law if you do not accept this License. Therefore, by modifying - or distributing the Program (or any work based on the Program), you indicate your acceptance - of this License to do so, and all its terms and conditions for copying, distributing or - modifying the Program or works based on it. -
-
- Section 6 - Each time you redistribute the Program (or any work based on the Program), the recipient - automatically receives a license from the original licensor to copy, distribute or modify - the Program subject to these terms and conditions. You may not impose any further restrictions - on the recipients' exercise of the rights granted herein. You are not responsible for enforcing - compliance by third parties to this License. -
-
- Section 7 - If, as a consequence of a court judgment or allegation of patent infringement or for any other - reason (not limited to patent issues), conditions are imposed on you (whether by court order, - agreement or otherwise) that contradict the conditions of this License, they do not excuse you - from the conditions of this License. If you cannot distribute so as to satisfy simultaneously - your obligations under this License and any other pertinent obligations, then as a consequence - you may not distribute the Program at all. For example, if a patent license would not permit - royalty-free redistribution of the Program by all those who receive copies directly or - indirectly through you, then the only way you could satisfy both it and this License would be - to refrain entirely from distribution of the Program. - - If any portion of this section is held invalid or unenforceable under any particular circumstance, - the balance of the section is intended to apply and the section as a whole is intended to apply - in other circumstances. - - It is not the purpose of this section to induce you to infringe any patents or other property - right claims or to contest validity of any such claims; this section has the sole purpose of - protecting the integrity of the free software distribution system, which is implemented by public - license practices. Many people have made generous contributions to the wide range of software - distributed through that system in reliance on consistent application of that system; it is up - to the author/donor to decide if he or she is willing to distribute software through any other - system and a licensee cannot impose that choice. - - This section is intended to make thoroughly clear what is believed to be a consequence of the - rest of this License. -
-
- Section 8 - If the distribution and/or use of the Program is restricted in certain countries either by patents - or by copyrighted interfaces, the original copyright holder who places the Program under this License - may add an explicit geographical distribution limitation excluding those countries, so that - distribution is permitted only in or among countries not thus excluded. In such case, this License - incorporates the limitation as if written in the body of this License. -
-
- Section 9 - The Free Software Foundation may publish revised and/or new versions of the General Public License - from time to time. Such new versions will be similar in spirit to the present version, but may differ - in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the Program specifies a version number of - this License which applies to it and any later version, you have the option of following the terms - and conditions either of that version or of any later version published by the Free Software - Foundation. If the Program does not specify a version number of this License, you may choose any - version ever published by the Free Software Foundation. -
-
- Section 10 - If you wish to incorporate parts of the Program into other free programs whose distribution - conditions are different, write to the author to ask for permission. For software which is copyrighted - by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions - for this. Our decision will be guided by the two goals of preserving the free status of all - derivatives of our free software and of promoting the sharing and reuse of software generally. -
-
- NO WARRANTY Section 11 - BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT - PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR - OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -
-
- Section 12 - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR - ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU - FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE - USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED - INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH - ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - END OF TERMS AND CONDITIONS -
-
-
diff --git a/__Docs/history.xml b/__Docs/history.xml deleted file mode 100644 index 9bf112b..0000000 --- a/__Docs/history.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - Release history - - - Version 1.4.0 (XX XXXXXX 2015) - - Added option to export library for more easy sharing. - Fixed bug 6 at Google Code. When a snippets had an empty first line it could not be saved. - Removed all references to Google Code because that service is retiring. All things that were on Google Code have been moved to GitHub. - Internally use SqliteDB-class to communicate with the database. - Added option ToolbarIcon to ini-file to hide the icon from the toolbar. - Fixed issue that sometimes new libraries and/or new snippets could not be added. - - - - - Version <ulink url="https://github.com/ffes/nppsnippets/releases/tag/v1.3.0">1.3.0</ulink> (June 2013, never officially release) - - Fixed problem with inserting UTF snippets (issue #3). - Fixed wrong title of Import Library dialog. - Fixed some potential bugs found when trying to fix GCC compilation. - Converted the documentation from ODT to DocBook. Because of that an on-line version of the documentation is available as well. - Upgrade to SQLite version 3.8.0.2 - - - - - Version <ulink url="https://github.com/ffes/nppsnippets/releases/tag/v1.2.0">1.2.0</ulink> (8 January 2013) - - There was an inconsistency between the documentation and code about the name of the option to specify your custom path for the database. Use DBFile from now on. For backwards compatibility the DBPath entry will still be recognized. - When a snippets creates a new document and the current document is empty, it reuses the current one and does not start a new. - Added Duplicate snippet function to context menu. - New (simple) templates library. - Upgrade to SQLite version 3.7.15.1 - - - - - Version 1.1.0 (13 December 2011) - - You can now add a new snippet to a library based upon the current selection or based upon the content of the clipboard. Right-click the snippets list to use these items. - Installation has been improved. A template database is provided and when the plug-in tries to find an existing database and it can't find it, it copies this template database to the AppData plugin-config directory. - The About dialog now shows the change-log. - When you upgrade the very first time the change-log for the current version will be shown. - When you didn't select a specific library for a certain language, the automatic selection of the library is improved. The first language specific library is preferred over the first general library. - Resized the edit snippet dialog. - Upgrade to SQLite version 3.7.9 - Moved the download to Google code. This gives me statistics about downloads and an issue tracker. The project's web page stays where it is. - - - - - Version 1.0.0 (6 September 2011) - - The selection or cursor position are now restored after inserting a snippet. - - - - - Version 0.7.1 (28 August 2011) - - Fixed a bug in the dialog to edit the languages for a certain library. This bug could cause a problem that libraries turn invisible, since all the records in LibraryLang table for that library were deleted and no new records were added. - Added a JavaScript - Math library. - - - - - Version 0.7.0 (1 August 2011) - - A user interface for editing the language selection for libraries has been added. You need at least Notepad++ version 5.93 for this feature. - You can import a library from another NppSnippet database. - Start a new document for a certain snippets, and allow that snippet to set the language of that new document. There were already fields in the database for this. It can be very useful to start a new CSS-file or JavaScript-file from HTML, etc. - Added an option DBPath to the ini-file to override the default location of the database. Made this mainly for my own testing, but maybe it is useful for others as well (corporate database). You need to manually edit the ini-file to use this. - Added an icon to the tab of the docking interface. - Upgrade to SQLite version 3.7.7.1 - - - - - Version 0.6.0 (15 June 2011) - - It is now possible to add, edit or delete the snippets and the libraries from within Notepad++. It is not yet possible to edit the languages for a library. - Added a new ANSI-characters library for all languages. - Deleted the useless General library. - Upgrade to SQLite version 3.7.6.3 - - - - - Version 0.5.0 (21 December 2010) - - Upgrade to SQLite version 3.7.4 - The focus is returned to the Scintilla window at start-up and after inserting a snippet. - The plug-in remembers if it is shown. - Added another special language to the table LibraryLang: Lang = -2. Libraries with this language will always be shown for all languages. - The languages last used is now stored in a separate table. The database schema version is 3. With this the libraries with special languages (negative language ID's) can be remembered as last used as well. - Error message when the database can not be opened. - - - - - Version 0.4.0 (8 April 2010) - - The database schema is updated and is now at version 2. The most important difference is that the "language" and "last used" field of the library are now in a separate table, allowing it to be one-to-many. Existing databases will be converted automatically to the new schema. - When there are multiple libraries for a language, changing to another library works and the last used library is remembered. - The plug-in now first tries to find the database in the user's plug-in config directory. On my Windows XP machine that is C:\Documents and Settings\Frank\Application Data\Notepad++\plugins\config. If the database can't be found there it looks in the plugin\config directory in the Notepad++ installation directory, in my case C:\Program Files\Notepad++\plugins\Config. - Small improvements to the About dialog. - There are now 4 HTML libraries, 1 PHP libraries, 1 XML library and 1 (rather useless) General library - - - - - Version 0.3.0 (10 February 2010) - - First alpha version, released under the GPL2 license. - The basics work, no User Interface yet to edit the snippets - - - - - Version 0.1.0 (22 January 2010) - - Internal proof of concept. - - - - diff --git a/__Docs/libraries.xml b/__Docs/libraries.xml deleted file mode 100644 index ec5fa21..0000000 --- a/__Docs/libraries.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - Provided Snippets Libraries - 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. - - - - - Library Name - Languages - By - - - - - ANSI Characters - All - FFes - - - Templates - All - FFes - - - HTML Tags - HTML, PHP, ASP - FFes - - - HTML Characters - HTML, PHP, ASP - FFes - - - Greek Characters - HTML, PHP, ASP - FFes - - - W3C Doctypes - HTML - FFes - - - CSS2 Tags - CSS, HTML - FFes - - - CSS2 Tags & Values - CSS, HTML - FFes - - - JavaScript - Basic - JavaScript, HTML - FFes - - - JavaScript - Date - JavaScript, HTML - FFes - - - JavaScript - Math - JavaScript, HTML - FFes - - - PHP Language - PHP - jvdanilo - - - XML Tags - XML - jvdanilo - - - - - diff --git a/__Docs/license.html b/__Docs/license.html deleted file mode 100755 index 58aaafc..0000000 --- a/__Docs/license.html +++ /dev/null @@ -1,120 +0,0 @@ - - -The GNU General Public License (GPL) - - - - - -

The GNU General Public License (GPL)

- -

Version 2, June 1991

- -

-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -

- -

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

- -

Preamble

- -

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

- -

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

- -

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

- -

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

- -

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

- -

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

- -

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

- -

The precise terms and conditions for copying, distribution and modification follow.

- -

-GNU GENERAL PUBLIC LICENSE
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-

- -

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

- -

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

- -

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

- -

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

- -

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

- -

-

-

- -

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

- -

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

- -

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

- -

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

- -

-

-

- -

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

- -

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

- -

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

- -

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.

- -

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

- -

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

- -

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

- -

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

- -

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

- -

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

- -

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

- -

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

- -

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

- -

NO WARRANTY

- -

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

- -

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

- -

END OF TERMS AND CONDITIONS

- - - diff --git a/__Docs/tabledef.xml b/__Docs/tabledef.xml deleted file mode 100644 index 1f2e318..0000000 --- a/__Docs/tabledef.xml +++ /dev/null @@ -1,133 +0,0 @@ - - Table definitions - - Table Library - - - - Field - Description - - - - - LibraryID - The unique identifier of this library - - - Name - Name of the library - - - CreatedBy - Who created this library - - - Comments - Comments about this library - - - SortBy - Which fields of Snippets are used to sort 0 = "Name, Sort" 1 = "Sort, Name" - - - -
- - Table LibraryLang - - - - Field - Description - - - - - LibraryID - The library this item is part of - - - Lang - - LangType from Notepad_plus_msgs.h. There are two special cases: - - Libs with Lang = -1 are shown when there is no library for the current language - Libs with Lang = -2 are shown for every language - - - - - -
- - Table Snippets - - - - Field - Description - - - - - SnippetID - The unique identifier of this snippet - - - LibraryID - The library this item is part of - - - Name - The name of the snippet - - - BeforeSelection - The text inserted before the current cursor / selection - - - AfterSelection - The text inserted after the current cursor / selection - - - ReplaceSelection - Replace a selection or ignore the selection and insert - - - NewDocument - Create a new document before inserting this snippet? - - - NewDocumentLang - Change the language of the new document to this language - - - Sort - Can determine the order of the snipping in the list. Depends on Library(SortBy) how the list is sorted - - - -
- - Table LangLastUsed - - - - Field - Description - - - - - Lang - LangType from Notepad_plus_msgs.h - - - LibraryID - This library is the last one used for this language - - - -
-
diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..3571347 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR) + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/NppSnippets.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/NppSnippets.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/NppSnippets" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/NppSnippets" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/compile.rst b/docs/compile.rst new file mode 100644 index 0000000..6b7be7e --- /dev/null +++ b/docs/compile.rst @@ -0,0 +1,14 @@ +How to compile +============== + +To compile NppSnippets you can use Visual Studio. Project files for VS 2013 are +provided and actively used. The free version of Visual Studio (so Express or +Community Edition) gets the job done. Obviously the paid versions work as well. +To compile with newer versions of Visual Studio you can convert an existing +project file. + +There is also a `MinGW-w64`_ makefile, using their 32-bit compilers. It can +be used from `Cygwin`_ and MSYS. + +.. _MinGW-w64: http://mingw-w64.org/ +.. _Cygwin: https://www.cygwin.com/ diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..fb8fa16 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,274 @@ +# -*- coding: utf-8 -*- +# +# NppSnippets documentation build configuration file, created by +# sphinx-quickstart on Wed Jun 10 21:36:42 2015. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# Check if we run on RTD or locally +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'NppSnippets' +copyright = '2010-2015, Frank Fesevur' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.3.0' +# The full version, including alpha/beta/rc tags. +release = '1.3.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +today_fmt = '%d %b %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# See if the RTD theme is installed locally +# Based on RTD FAQ and the RTD-theme install instruction +# http://read-the-docs.readthedocs.org/en/latest/faq.html +# https://github.com/snide/sphinx_rtd_theme + +if not on_rtd: + if os.path.exists('_themes/sphinx_rtd_theme'): + html_theme_path = [ '_themes', ] + html_theme = 'sphinx_rtd_theme' + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%d %b %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'NppSnippetsdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'a4paper', + + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + #'preamble': '', + + 'classoptions': ',openany,oneside', + 'babel': '\\usepackage[english]{babel}' +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'NppSnippets.tex', 'NppSnippets Documentation', + 'Frank Fesevur', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'nppsnippets', 'NppSnippets Documentation', + ['Frank Fesevur'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'NppSnippets', 'NppSnippets Documentation', + 'Frank Fesevur', 'NppSnippets', 'A code snippets plugin for Notepad++', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/docs/contact.rst b/docs/contact.rst new file mode 100644 index 0000000..6857832 --- /dev/null +++ b/docs/contact.rst @@ -0,0 +1,12 @@ +.. _contact: + +Contact +======= + +The project's web page can be found at http://www.fesevur.com/nppsnippets. + +The downloads, issue tracker and git repository can be found at +https://github.com/ffes/nppsnippets. + +If you have problems with, questions about or suggestions for +NppSnippets you can contact me at fesevur@gmail.com. diff --git a/docs/database.rst b/docs/database.rst new file mode 100644 index 0000000..5cc6df2 --- /dev/null +++ b/docs/database.rst @@ -0,0 +1,124 @@ +.. _database: + +Database +======== + +NppSnippets uses a `SQLite`_ database named ``NppSnippets.sqlite`` to +store all 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 editing the data through the GUI. So be sure not to +create the database with an older SQLite management tool that breaks +this. + +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. + +The database structure is quite simple. There are four tables +:ref:`table_library`, :ref:`table_library_lang`, :ref:`table_snippets` +and :ref:`table_lang_last_used`. There are one-to-many relations 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. + +The current schema ``user_version`` of the database is 3. + +.. _SQLite: http://www.sqlite.org/ + +Why a SQLite database and not plain text files? +----------------------------------------------- + +All the snippets are stored in one `SQLite`_ 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 :ref:`user interface ` for editing the snippets. + +Table definitions +----------------- + +.. _table_library: + +Library +******* + ++-------------+------------------------------------------------------+ +| Field | Description | ++=============+======================================================+ +| LibraryID | The unique identifier of this library | ++-------------+------------------------------------------------------+ +| Name | Name of the library | ++-------------+------------------------------------------------------+ +| CreatedBy | Who created this library | ++-------------+------------------------------------------------------+ +| Comments | Comments about this library | ++-------------+------------------------------------------------------+ +| SortBy | Which fields of Snippets are used to sort: | +| | 0. "Name, Sort" | +| | 1. "Sort, Name" | ++-------------+------------------------------------------------------+ + +.. _table_library_lang: + +LibraryLang +*********** + ++-------------+-------------------------------------------------------------------+ +| Field | Description | ++=============+===================================================================+ +| LibraryID | The library this item is part of | ++-------------+-------------------------------------------------------------------+ +| Lang | LangType from Notepad\_plus\_msgs.h. There are two special cases: | +| | | +| | - Libs with Lang = -1 are shown when there is no library for | +| | the current language | +| | | +| | - Libs with Lang = -2 are shown for every language | ++-------------+-------------------------------------------------------------------+ + +.. _table_snippets: + +Snippets +******** + ++--------------------+--------------------------------------------------------------+ +| Field | Description | ++====================+==============================================================+ +| SnippetID | The unique identifier of this snippet | ++--------------------+--------------------------------------------------------------+ +| LibraryID | The library this item is part of | ++--------------------+--------------------------------------------------------------+ +| Name | The name of the snippet | ++--------------------+--------------------------------------------------------------+ +| BeforeSelection | The text inserted before the current cursor / selection | ++--------------------+--------------------------------------------------------------+ +| AfterSelection | The text inserted after the current cursor / selection | ++--------------------+--------------------------------------------------------------+ +| ReplaceSelection | Replace a selection or ignore the selection and insert | ++--------------------+--------------------------------------------------------------+ +| NewDocument | Create a new document before inserting this snippet? | ++--------------------+--------------------------------------------------------------+ +| NewDocumentLang | Change the language of the new document to this language | ++--------------------+--------------------------------------------------------------+ +| Sort | Can determine the order of the snipping in the list. Depends | +| | on Library(SortBy) how the list is sorted. | ++--------------------+--------------------------------------------------------------+ + +.. _table_lang_last_used: + +LangLastUsed +************ + ++-------------+-------------------------------------------------------+ +| Field | Description | ++=============+=======================================================+ +| Lang | LangType from Notepad\_plus\_msgs.h | ++-------------+-------------------------------------------------------+ +| LibraryID | This library is the last one used for this language | ++-------------+-------------------------------------------------------+ diff --git a/docs/faq.rst b/docs/faq.rst new file mode 100644 index 0000000..35a3dea --- /dev/null +++ b/docs/faq.rst @@ -0,0 +1,17 @@ +Frequently Asked Questions +========================== + +Can I assign a shortcut key to a certain snippet? +------------------------------------------------- + +This is on the wish list, but I don't think it is possible. +Shortcut key are assigned to menu items when the plug-ins are loaded. +But individual snippets are not menu items. And shortcut keys need to be +dynamic. When you change the library, the key assignments need to change +on the fly. + +Consider ``Ctrl-B``: this could be ``bold`` in HTML, ``break`` in a +c-styled languages and a ``begin``/``end`` block in Pascal. + +But a pointer to a way to implement this is, or even better a pull request +that fixes this is much appreciated. diff --git a/docs/gpl-2.rst b/docs/gpl-2.rst new file mode 100644 index 0000000..48ad7b0 --- /dev/null +++ b/docs/gpl-2.rst @@ -0,0 +1,314 @@ +.. _gpl-2: + +GNU General Public License +========================== + +Preamble +-------- + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software - +to make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Library General +Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this +service if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis +or for a fee, you must give the recipients all the rights that you have. +You must make sure that they, too, receive or can get the source code. +And you must show them these terms so they know their rights. + +We protect your rights with two steps: + +1. copyright the software, and + +2. offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software patents. +We wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent must +be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + +Section 0 +^^^^^^^^^ + +This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under +the terms of this General Public License. The “Program”, below, refers +to any such program or work, and a “work based on the Program” means +either the Program or any derivative work under copyright law: that is +to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. +(Hereinafter, translation is included without limitation in the term +“modification”.) Each licensee is addressed as “you”. + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running +the Program is not restricted, and the output from the Program is +covered only if its contents constitute a work based on the Program +(independent of having been made by running the Program). Whether that +is true depends on what the Program does. + +Section 1 +^^^^^^^^^ + +You may copy and distribute verbatim copies of the Program's source code +as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any other +recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +Section 2 +^^^^^^^^^ + +You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that +you also meet all of these conditions: + +a. You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + +b. You must cause any work that you distribute or publish, that in whole + or in part contains or is derived from the Program or any part + thereof, to be licensed as a whole at no charge to all third parties + under the terms of this License. + +c. If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the most ordinary way, to print or display an announcement + including an appropriate copyright notice and a notice that there is + no warranty (or else, saying that you provide a warranty) and that + users may redistribute the program under these conditions, and + telling the user how to view a copy of this License. (Exception: If + the Program itself is interactive but does not normally print such an + announcement, your work based on the Program is not required to print + an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, and +can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based on +the Program, the distribution of the whole must be on the terms of this +License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of a +storage or distribution medium does not bring the other work under the +scope of this License. + +Section 3 +^^^^^^^^^ + +You may copy and distribute the Program (or a work based on it, under +Section 2 in object code or executable form under the terms of Sections 1 +and 2 above provided that you also do one of the following: + +a. Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 + above on a medium customarily used for software interchange; or, + +b. Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of + physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + +c. Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, in + accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source code +means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to control +compilation and installation of the executable. However, as a special +exception, the source code distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies the +executable. + +If distribution of executable or object code is made by offering access +to copy from a designated place, then offering equivalent access to copy +the source code from the same place counts as distribution of the source +code, even though third parties are not compelled to copy the source +along with the object code. + +Section 4 +^^^^^^^^^ + +You may not copy, modify, sublicense, or distribute the Program except +as expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense or distribute the Program is void, and will +automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in +full compliance. + +Section 5 +^^^^^^^^^ + +You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute +the Program or its derivative works. These actions are prohibited by law +if you do not accept this License. Therefore, by modifying or +distributing the Program (or any work based on the Program), you +indicate your acceptance of this License to do so, and all its terms and +conditions for copying, distributing or modifying the Program or works +based on it. + +Section 6 +^^^^^^^^^ + +Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further restrictions +on the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties to this License. + +Section 7 +^^^^^^^^^ + +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and +any other pertinent obligations, then as a consequence you may not +distribute the Program at all. For example, if a patent license would +not permit royalty-free redistribution of the Program by all those who +receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up to +the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be +a consequence of the rest of this License. + +Section 8 +^^^^^^^^^ + +If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an +explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + +Section 9 +^^^^^^^^^ + +The Free Software Foundation may publish revised and/or new versions of +the General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and “any +later version”, you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a version +number of this License, you may choose any version ever published by the +Free Software Foundation. + +Section 10 +^^^^^^^^^^ + +If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask +for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY Section 11 +^^^^^^^^^^^^^^^^^^^^^^ + +BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH +YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +Section 12 +^^^^^^^^^^ + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR +DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM +(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR +OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS diff --git a/docs/history.rst b/docs/history.rst new file mode 100644 index 0000000..de9bab2 --- /dev/null +++ b/docs/history.rst @@ -0,0 +1,211 @@ +Release history +=============== + +Version 1.4.0 (Yet To Be Released) +---------------------------------- + +- The color of the plug-in match the current Notepad++ theme. + +- Converted the documentation from DocBook to reStructuredText. The + documentation is now hosted at `Read The Docs`_ + +- Added option to export library for easier sharing. + +- Fixed bug 6 at Google Code. When a snippets had an empty first line + it could not be saved. + +- Removed all references to Google Code because that `service is retiring`_. + All things that were on Google Code have been moved to `GitHub`_. + +- Internally use my SqliteDB-class to communicate with the database. + +- Added option ``ToolbarIcon`` to ini-file to hide the icon from the + toolbar. + +- Fixed issue that sometimes new libraries and/or new snippets could + not be added. + +.. _Read The Docs: http://nppsnippets.readthedocs.org +.. _service is retiring: http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html +.. _GitHub: https://github.com/ffes/nppsnippets + + +Version `1.3.0`_ (June 2013) +---------------------------- + +- Fixed problem with inserting UTF snippets (`issue #3`_). + +- Fixed wrong title of Import Library dialog. + +- Fixed some potential bugs found when trying to fix GCC compilation. + +- Converted the documentation from ODT to DocBook. Because of that an + `on-line version`_ of the documentation is available as well. + +- Upgrade to SQLite version 3.8.0.2 + +.. _1.3.0: https://github.com/ffes/nppsnippets/releases/tag/v1.3.0 +.. _issue #3: http://code.google.com/p/nppsnippets/issues/detail?id=3 +.. _on-line version: http://nppsnippets.readthedocs.org + + +Version `1.2.0`_ (8 January 2013) +--------------------------------- + +- There was an inconsistency between the documentation and code about + the name of the option to specify your custom path for the database. + Use ``DBFile`` from now on. For backwards compatibility the ``DBPath`` + entry will still be recognized. + +- When a snippets creates a new document and the current document is + empty, it reuses the current one and does not start a new. + +- Added ``Duplicate`` snippet function to context menu. + +- New (simple) templates library. + +- Upgrade to SQLite version 3.7.15.1 + +.. _1.2.0: https://github.com/ffes/nppsnippets/releases/tag/v1.2.0 + + +Version 1.1.0 (13 December 2011) +-------------------------------- + +- You can now add a new snippet to a library based upon the current + selection or based upon the content of the clipboard. Right-click the + snippets list to use these items. + +- Installation has been improved. A template database is provided and + when the plug-in tries to find an existing database and it can't find + it, it copies this template database to the AppData plugin-config + directory. + +- The About dialog now shows the change-log. + +- When you upgrade the very first time the change-log for the current + version will be shown. + +- When you didn't select a specific library for a certain language, the + automatic selection of the library is improved. The first language + specific library is preferred over the first general library. + +- Resized the edit snippet dialog. + +- Upgrade to SQLite version 3.7.9 + +- Moved the download to `Google code`_. This gives me + statistics about downloads and an issue tracker. The project's `web page`_ + stays where it is. + +.. _Google code: https://code.google.com/p/nppsnippets/ +.. _web page: http://www.fesevur.com/nppsnippets + + +Version 1.0.0 (6 September 2011) +-------------------------------- + +- The selection or cursor position are now restored after inserting a + snippet. + +Version 0.7.1 (28 August 2011) +------------------------------ + +- Fixed a bug in the dialog to edit the languages for a certain + library. This bug could cause a problem that libraries turn + invisible, since all the records in LibraryLang table for that + library were deleted and no new records were added. + +- Added a JavaScript - Math library. + +Version 0.7.0 (1 August 2011) +----------------------------- + +- A user interface for editing the language selection for libraries has + been added. You need at least Notepad++ version 5.93 for this + feature. + +- You can import a library from another NppSnippet database. + +- Start a new document for a certain snippets, and allow that snippet + to set the language of that new document. There were already fields + in the database for this. It can be very useful to start a new + CSS-file or JavaScript-file from HTML, etc. + +- Added an option DBPath to the ini-file to override the default + location of the database. Made this mainly for my own testing, but + maybe it is useful for others as well (corporate database). You need + to manually edit the ini-file to use this. + +- Added an icon to the tab of the docking interface. + +- Upgrade to SQLite version 3.7.7.1 + +Version 0.6.0 (15 June 2011) +---------------------------- + +- It is now possible to add, edit or delete the snippets and the + libraries from within Notepad++. It is not yet possible to edit the + languages for a library. + +- Added a new ANSI-characters library for all languages. + +- Deleted the useless General library. + +- Upgrade to SQLite version 3.7.6.3 + +Version 0.5.0 (21 December 2010) +-------------------------------- + +- Upgrade to SQLite version 3.7.4 + +- The focus is returned to the Scintilla window at start-up and after + inserting a snippet. + +- The plug-in remembers if it is shown. + +- Added another special language to the table LibraryLang: ``Lang = -2``. + Libraries with this language will always be shown for all languages. + +- The languages last used is now stored in a separate table. The + database schema version is 3. With this the libraries with special + languages (negative language ID's) can be remembered as last used as + well. + +- Error message when the database can not be opened. + +Version 0.4.0 (8 April 2010) +---------------------------- + +- The database schema is updated and is now at version 2. The most + important difference is that the "language" and "last used" field of + the library are now in a separate table, allowing it to be + one-to-many. Existing databases will be converted automatically to + the new schema. + +- When there are multiple libraries for a language, changing to another + library works and the last used library is remembered. + +- The plug-in now first tries to find the database in the user's + plug-in config directory. On my Windows XP machine that is + ``C:\\Documents and Settings\\Frank\\Application Data\\Notepad++\\plugins\\config``. + If the database can't be found there it looks in the ``plugin\\config`` directory + in the Notepad++ installation directory, in my case + ``C:\\Program Files\\Notepad++\\plugins\\Config``. + +- Small improvements to the About dialog. + +- There are now 4 HTML libraries, 1 PHP libraries, 1 XML library and 1 + (rather useless) General library. + +Version 0.3.0 (10 February 2010) +-------------------------------- + +- First alpha version, released under the GPL2 license. + +- The basics work, no User Interface yet to edit the snippets. + +Version 0.1.0 (22 January 2010) +------------------------------- + +- Internal proof of concept. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..e9f883f --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,33 @@ +.. NppSnippets documentation master file + +************************************** +Welcome to NppSnippets' documentation! +************************************** + +Contents: + +.. toctree:: + :maxdepth: 2 + + introduction.rst + installation.rst + usage.rst + libraries.rst + database.rst + faq.rst + options.rst + wishlist.rst + known-issues.rst + contact.rst + compile.rst + license.rst + history.rst + gpl-2.rst + +****************** +Indices and tables +****************** + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 0000000..abca38e --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,33 @@ +How to install or upgrade +========================= + +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. + +To manually install the plugin, copy ``NppSnippets.dll`` to the +``plugins`` directory and copy ``Template.sqlite`` to the +``plugins/config`` directory in the user's "Application Data" directory +and name it ``NppSnippets.sqlite``. On my Windows 7 machine this +directory is ``C:\Users\Frank\AppData\Roaming\Notepad++\plugins\config``. +Then (re)start Notepad++. + +You can place the database in the ``plugins/config`` 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 ``AppData`` directory. + +You can also specify a custom path (like a shared network path or your +Dropbox directory) for your database by manually editing the +``NppSnippets.ini`` file and adding a ``DBFile`` entry pointing to the +full path name of the database. The ``NppSnippets.ini`` is normally in +your ``AppData`` directory. + +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. diff --git a/docs/introduction.rst b/docs/introduction.rst new file mode 100644 index 0000000..0ff6566 --- /dev/null +++ b/docs/introduction.rst @@ -0,0 +1,7 @@ +Introduction +============ + +NppSnippets is a plug-in for `Notepad++`_. It adds the possibility to add +code snippets to the current document by selecting it from a simple list. + +.. _Notepad++: https://notepad-plus-plus.org/ diff --git a/docs/known-issues.rst b/docs/known-issues.rst new file mode 100644 index 0000000..b4bddbc --- /dev/null +++ b/docs/known-issues.rst @@ -0,0 +1,19 @@ +Known Issues +============ + +- Closing the snippets window with the ``x`` does not update toolbar icon + and menu item. And as a result of that the state is not remembered + properly. I need to find the notification that is send to the window + on clicking the ``x``. + +- When a library is not alphabetic sorted, and you move an item up or + down, this is slow. This is because the ``Sort``-field of all the + snippets of that library need to be updated in the database. + +- On Windows XP disabling context menu items like the ``Move Up`` and + ``Move Down`` menu items is not visible. They don't turn gray but they + are really disabled. + +- The icon on the docking tab is inverted for some strange reason. + +- When there is no write-access to the database, this is not properly handled. diff --git a/docs/libraries.rst b/docs/libraries.rst new file mode 100644 index 0000000..02b351b --- /dev/null +++ b/docs/libraries.rst @@ -0,0 +1,65 @@ +Libraries and Snippets +====================== + +.. _edit: + +How to add or edit libraries or snippets +---------------------------------------- + +To add or edit a snippet, right-click the snippet in the list and edit. +To add or edit a library right-click the combo-box where you select the +current library. You can also import a library from another database via +this context menu. + +To add a lot of snippets, I suggest that you look at the section +:ref:`database` that describes the database structure and import your +data with your favorite SQLite management tool. + +Provided Snippets Libraries +--------------------------- + +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. + ++----------------------+--------------------+------------+ +| Library Name | Languages | By | ++======================+====================+============+ +| ANSI Characters | All | FFes | ++----------------------+--------------------+------------+ +| Templates | All | FFes | ++----------------------+--------------------+------------+ +| HTML Tags | HTML, PHP, ASP | FFes | ++----------------------+--------------------+------------+ +| HTML Characters | HTML, PHP, ASP | FFes | ++----------------------+--------------------+------------+ +| Greek Characters | HTML, PHP, ASP | FFes | ++----------------------+--------------------+------------+ +| W3C Doctypes | HTML | FFes | ++----------------------+--------------------+------------+ +| CSS2 Tags | CSS, HTML | FFes | ++----------------------+--------------------+------------+ +| CSS2 Tags & Values | CSS, HTML | FFes | ++----------------------+--------------------+------------+ +| JavaScript - Basic | JavaScript, HTML | FFes | ++----------------------+--------------------+------------+ +| JavaScript - Date | JavaScript, HTML | FFes | ++----------------------+--------------------+------------+ +| JavaScript - Math | JavaScript, HTML | FFes | ++----------------------+--------------------+------------+ +| PHP Language | PHP | jvdanilo | ++----------------------+--------------------+------------+ +| XML Tags | XML | jvdanilo | ++----------------------+--------------------+------------+ + +User generated libraries +------------------------ + +From version 0.7 it is possible to import libraries from another +NppSnippets database. This way redistributing user generated libraries +becomes easy. If you have created your own library and think it can be +useful for others, :ref:`send it to me ` and I will put them on +`my website`_. + +.. _my website: http://www.fesevur.com/nppsnippets diff --git a/docs/license.rst b/docs/license.rst new file mode 100644 index 0000000..48438ae --- /dev/null +++ b/docs/license.rst @@ -0,0 +1,6 @@ +License +======= + +This plug-in is published under the GPL-2 license. See :ref:`gpl-2` for the +full license agreement. You can download the sources from +https://github.com/ffes/nppsnippets. diff --git a/docs/options.rst b/docs/options.rst new file mode 100644 index 0000000..27611be --- /dev/null +++ b/docs/options.rst @@ -0,0 +1,28 @@ +.. _options: + +Options +======= + +At the moment there is no user interface to set options. But there +is an ini-file that you can edit manually to do some settings. +This ini-file is normally found in your "Application Data" directory +and is named ``NppSnippets.ini``. On my Windows 10 machine this directory +is ``C:\Users\Frank\AppData\Roaming\Notepad++\plugins\config``. + +These are the default settings: + +.. code:: ini + + [Options] + Show=1 + ToolbarIcon=1 + DBFile= + +When ``Show`` is set to ``0`` the tree will not be shown. + +When ``ToolbarIcon`` is set to ``0`` no icon will be shown on the toolbar. + +``DBFile`` can be used to override the default location of the database +``NppSnippets.sqlite`` by specifying the full path name of the database. +When it is not set the plug-in will look in the same directory as where +``NppSnippets.ini`` is located. diff --git a/docs/usage.rst b/docs/usage.rst new file mode 100644 index 0000000..6fd8fd9 --- /dev/null +++ b/docs/usage.rst @@ -0,0 +1,15 @@ +How to use +========== + +To open the Snippets window, click on the ``jigsaw`` button on the +toolbar, or via the menu ``Plugins``, ``Snippets``, ``Snippets``. + +The window consists of two parts. A combo-box where you can select the +library and underneath it is the list of snippets in the chosen library. +To insert a snippet simply double-click on the item in the list and the +snippet is inserted at the current cursor position. + +When you switch to a document with another language the snippets for +that new language are read from the database. + +To edit a snippet or a library, simply right-click the item. diff --git a/docs/wishlist.rst b/docs/wishlist.rst new file mode 100644 index 0000000..22227bc --- /dev/null +++ b/docs/wishlist.rst @@ -0,0 +1,32 @@ +Wish List +========= + +The wish list is in random order. + +- Real template handling: variables in the snippets + +- Select a text, right-click that selection and add as new snippet. + +- If possible, drag-and-drop from the list to the active document. + +- Assign keyboard shortcut keys to a snippet. + +- Remember the last select snippet from the list. Useful when switching + between different languages. + +- Add support for multiple selections. + +- Easier sorting for non-alphabetic libraries. (move to top, move to + bottom, dragging?) + +- Copy a certain snippet to another library. + +- Properly indent the snippet when inserting. + +- Make the snippets aware of the replace tabs with spaces setting of the + current document. + +- Options dialog to edit the location of the database. + +- Libraries can be hard to find when there is something wrong with the + languages that are set for this library.