plugin:snippets
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:snippets [2017-11-26 10:18] – [snippets plugin] 116.107.93.57 | plugin:snippets [2023-12-08 10:05] (current) – + Jack Jackrum 148.64.24.63 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Snippets Plugin ====== ---- plugin ---- description: | + | ====== Snippets Plugin ======Â |
+ | Â | ||
+ | ---- plugin ----Â | ||
+ | description: | ||
+ | author | ||
+ | email : turnermm02@shaw.ca | ||
+ | type | ||
+ | lastupdate : 2022-10-07Â | ||
+ | compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags | ||
+ | Â | ||
+ | downloadurl: | ||
+ | bugtracker : https:// | ||
+ | sourcerepo : https:// | ||
+ | donationurl: | ||
+ | ----Â | ||
+ | Â | ||
+ | This is an upgrade to the original snippets plugin. It was created by Michael Klier and later updated by Dominik Eckelmann, who brought the javascript into conformity with jQuery and made some css improvements. | ||
+ | Â | ||
+ | ===== Description =====Â | ||
+ | Â | ||
+ | The snippets plugin makes it possible to create a collection of re-usable texts, or '' | ||
+ | The plugin adds a new button to the editor toolbar. | ||
+ | {{ https://i.imgur.com/gJoyby4.png? | ||
+ | The button opens a pop-up window that lists the snippet pages. The list is defined on a standard [[# | ||
+ | Â | ||
+ | **Updatable Snippets**\\ | ||
+ | In the plugin' | ||
+ | Â | ||
+ | In addition, this upgrade accepts DokuWiki namespace templates as snippets. | ||
+ | Â | ||
+ | ===== Installation =====Â | ||
+ | Â | ||
+ | Search | ||
+ | Â | ||
+ | For the original snippets page with comments and download url, see [[plugin: | ||
+ | Â | ||
+ | **IMPORTANT: | ||
+ | Â | ||
+ | ==== PHP versions prior to 5.3 ====Â | ||
+ | Â | ||
+ | If you are using a version of PHP prior to 5.3 you will get an error message that looks something like this:Â | ||
+ | | ||
+ | In this case download an alternative package, which supports earlier versions of PHP:Â | ||
+ | \\ https:// | ||
+ | \\ This version is not kept up-to-date. | ||
+ | Â | ||
+ | ==== Internet Explorer ====Â | ||
+ | Â | ||
+ | An issue with IE 11 has been detected where the snippets' | ||
+ | | ||
+ | Â | ||
+ | ===== Usage =====Â | ||
+ | Â | ||
+ | Create your snippets and then add them as an unordered list of links to the '' | ||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | However, if your snippet is derived from a namespace template, then you must use a special form of link which is described below in the section on using [[# | ||
+ | Â | ||
+ | Clicking on the snippets' | ||
+ | Â | ||
+ | {{ https://i.imgur.com/WBr7rY4.png?640& | ||
+ | Â | ||
+ | In the left-hand pane of the pop-up is the list of links derived from the '' | ||
+ | Â | ||
+ | If you don't want this insertion to be updatable, uncheck the " | ||
+ | Â | ||
+ | When the '' | ||
+ | Â | ||
+ | The header markup looks like this: '' | ||
+ | Â | ||
+ | ===== How the updates are processed =====Â | ||
+ | Â | ||
+ | The plugin keeps a database that records the associations between snippets and the pages where they are embedded; in addition the meta file for each page containing snippets keeps a record of each snippet and its timestamp. | ||
+ | Â | ||
+ | There are two ways that snippets are updated:Â | ||
+ | | ||
+ | | ||
+ | Â | ||
+ | For more details about the snippets plugin internals, see [[plugin: | ||
+ | Â | ||
+ | ==== Admin: Metadata Clean-Up Tool ====Â | ||
+ | Â | ||
+ | On the Administration Page, there is a tool which enables you to reconcile any differences between the information in the database and the content on the wiki pages. | ||
+ | Â | ||
+ | ===== Inserting Comments into Snippets =====Â | ||
+ | Â | ||
+ | You can use the following syntax inside your snippets to provide additional comments which will get stripped out when you insert the snippet into the page you are editing. | ||
+ | Â | ||
+ | < | ||
+ | < | ||
+ | Additional comments, i.e. you have to provide the following information: | ||
+ | Â | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | Â | ||
+ | ===== Namespace Templates as Snippets =====Â | ||
+ | Â | ||
+ | ==== Creating Links to Namespace Templates ====Â | ||
+ | Â | ||
+ | Namespace templates can be used as snippets. | ||
+ | | ||
+ | | ||
+ | Â | ||
+ | In both cases the dummy file is used as the link in the snippets listing and when the link is clicked, the snippet is inserted into your page. There is one circumstance in which the contents of a dummy page is not ignored. | ||
+ | Â | ||
+ | The following is a schematic for entering these snippets into the links on the [[# | ||
+ | < | ||
+ | [[templ_admin|admin data]]Â | ||
+ | [[templ: | ||
+ | [[distro_templ: | ||
+ | [[: | ||
+ | </ | ||
+ | For '' | ||
+ | < | ||
+ | admin data | ||
+ | policies | ||
+ | distro data | ||
+ | personal data | ||
+ | </ | ||
+ | Â | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Â | ||
+ | The dummy pages themselves are not changed. | ||
+ | Â | ||
+ | These snippets are not updatable. The '' | ||
+ | Â | ||
+ | ==== Replacement Patterns ====Â | ||
+ | Â | ||
+ | Any replacement patterns that refer to page names, files and Dokuwiki ID's must have their '' | ||
+ | Â | ||
+ | |@ID@|#ID#|Â | ||
+ | |@NS@|#NS#|Â | ||
+ | |@FILE@|# | ||
+ | |@!FILE@|# | ||
+ | |@!FILE!@|# | ||
+ | |@PAGE@|# | ||
+ | |@!PAGE@|# | ||
+ | |@!!PAGE@|# | ||
+ | |@!PAGE!@|# | ||
+ | Â | ||
+ | The other replacement patterns remain the same, '' | ||
+ | Â | ||
+ | ===== Configuration Options =====Â | ||
+ | Â | ||
+ | ^ Option | ||
+ | |snippets_page|the wiki page which defines the list of snippet pages used in the snippet manager|'' | ||
+ | |snips_updatable|if true, snippets are automatically updatable, otherwise updatable at the user's discretion|'' | ||
+ | |old_revisions| Insert current version of snippet into Old Revisions|'' | ||
+ | ^ Template Options | ||
+ | | prettytitles | ||
+ | | userreplace | ||
+ | | skip_unset_macros | ||
+ | | default_macro_string | ||
+ | Â | ||
+ | ===== Notes on Options =====Â | ||
+ | Â | ||
+ | **userreplace**: | ||
+ | | ||
+ | When these macros are found in the template, they will be replaced by their replacement values. If a user-defined '' | ||
+ | | ||
+ | Â | ||
+ | **skip_unset_macros**: | ||
+ | Â | ||
+ | **old_revisions**: | ||
+ | | ||
+ | | ||
+ | Â | ||
+ | Â | ||
+ | ===== Change Log =====Â | ||
+ | Â | ||
+ | {{rss> | ||
+ | Â | ||
+ | ===== Discussion =====Â | ||
+ | Â | ||
+ | https:// |
plugin/snippets.1511687920.txt.gz · Last modified: 2017-11-26 10:18 by 116.107.93.57