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-09-17 20:32] – [Configuration Options] turnermm | plugin:snippets [2023-12-08 10:05] (current) – + Jack Jackrum 148.64.24.63 | ||
---|---|---|---|
Line 6: | Line 6: | ||
email : turnermm02@shaw.ca | email : turnermm02@shaw.ca | ||
type : Action, Syntax | type : Action, Syntax | ||
- | lastupdate : 2017-09-15Â | + | lastupdate : 2022-10-07Â |
- | compatible : 2009-12-25, 2010-11-07, 2011-05-25, Angua, Weatherwax, Binky, Ponder Stibbons, Hrun,detritus, "Elenor | + | compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor |
depends | depends | ||
conflicts | conflicts | ||
- | similar | + | similar |
- | tags : editing, toolbar, shortcut | + | tags : editing, toolbar, shortcut, snippets, macro |
downloadurl: | downloadurl: | ||
bugtracker : https:// | bugtracker : https:// | ||
Line 24: | Line 25: | ||
The snippets plugin makes it possible to create a collection of re-usable texts, or '' | 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. | The plugin adds a new button to the editor toolbar. | ||
- | {{ http://mturner.org/ | + | {{ 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 [[# | The button opens a pop-up window that lists the snippet pages. The list is defined on a standard [[# | ||
- | ** Updatable Snippets ** \\ | + | **Updatable Snippets**\\ |
In the plugin' | In the plugin' | ||
- | |||
- | |||
In addition, this upgrade accepts DokuWiki namespace templates as snippets. | In addition, this upgrade accepts DokuWiki namespace templates as snippets. | ||
Line 36: | Line 35: | ||
===== Installation ===== | ===== Installation ===== | ||
- | Download | + | Search |
- | **IMPORTANT: | + | For the original snippets page with comments and download url, see [[plugin: |
+ | Â | ||
+ | **IMPORTANT: | ||
==== PHP versions prior to 5.3 ==== | ==== PHP versions prior to 5.3 ==== | ||
Line 44: | Line 45: | ||
If you are using a version of PHP prior to 5.3 you will get an error message that looks something like this: | If you are using a version of PHP prior to 5.3 you will get an error message that looks something like this: | ||
unexpected T_FUNCTION in . . ./ | unexpected T_FUNCTION in . . ./ | ||
- | In this case download an alternative package, which supports earlier versions of PHP:\\Â | + | In this case download an alternative package, which supports earlier versions of PHP:Â |
- | https:// | + | \\ https:// |
- | This version is not kept up-to-date. | + | \\ This version is not kept up-to-date. |
==== Internet Explorer ==== | ==== Internet Explorer ==== | ||
+ | |||
An issue with IE 11 has been detected where the snippets' | An issue with IE 11 has been detected where the snippets' | ||
* https:// | * https:// | ||
- | |||
===== Usage ===== | ===== Usage ===== | ||
+ | |||
Create your snippets and then add them as an unordered list of links to the '' | Create your snippets and then add them as an unordered list of links to the '' | ||
< | < | ||
- | * [[snippet_1|]]Â | + | |
- | | + | * [[snippet_2|General Instructions]]Â |
- | | + | * [[snippet_3|Valid Users]] |
</ | </ | ||
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 [[# | 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 [[# | ||
Line 64: | Line 66: | ||
Clicking on the snippets' | Clicking on the snippets' | ||
- | {{ http://mturner.org/ | + | {{ https://i.imgur.com/WBr7rY4.png?640& |
In the left-hand pane of the pop-up is the list of links derived from the '' | In the left-hand pane of the pop-up is the list of links derived from the '' | ||
Line 72: | Line 74: | ||
When the '' | When the '' | ||
- | The header markup looks like this: '' | + | The header markup looks like this: '' |
===== How the updates are processed ===== | ===== 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. | 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: | There are two ways that snippets are updated: | ||
- When a page with a revised snippet is opened for revision, the revised snippet will automatically replace the old version in the editing window. | - When a page with a revised snippet is opened for revision, the revised snippet will automatically replace the old version in the editing window. | ||
- | - When a snippet is revised, a table will appear at the bottom of its page with a listing of the pages that have used the snippet. \\ | + | - When a snippet is revised, a table will appear at the bottom of its page with a listing of the pages that have used the snippet. \\ {{ https://i.imgur.com/fcIrhog.png?450& |
+ | Â | ||
+ | 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. | ||
- | For more details about the snippets plugin internals, see [[plugin: | ||
===== Inserting Comments into Snippets ===== | ===== Inserting Comments into Snippets ===== | ||
Line 94: | Line 102: | ||
</ | </ | ||
</ | </ | ||
- | |||
===== Namespace Templates as Snippets ===== | ===== Namespace Templates as Snippets ===== | ||
Line 101: | Line 108: | ||
Namespace templates can be used as snippets. | Namespace templates can be used as snippets. | ||
- | | + | |
- | - Alternatively, | + | - Alternatively, |
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. | 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 [[# | + | The following is a schematic for entering these snippets into the links on the [[# |
< | < | ||
[[templ_admin|admin data]] | [[templ_admin|admin data]] | ||
Line 124: | Line 131: | ||
- '' | - '' | ||
- '' | - '' | ||
- | - '' | + | - '' |
The dummy pages themselves are not changed. | The dummy pages themselves are not changed. | ||
Line 131: | Line 138: | ||
==== Replacement Patterns ==== | ==== Replacement Patterns ==== | ||
+ | |||
Any replacement patterns that refer to page names, files and Dokuwiki ID's must have their '' | Any replacement patterns that refer to page names, files and Dokuwiki ID's must have their '' | ||
Line 145: | Line 153: | ||
The other replacement patterns remain the same, '' | The other replacement patterns remain the same, '' | ||
- | Â | + | ===== Configuration Options |
- | ==== New Configuration Options ==== | + | |
^ Option | ^ Option | ||
|snippets_page|the wiki page which defines the list of snippet pages used in the snippet manager|'' | |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|'' | |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 | | prettytitles | ||
| userreplace | | userreplace | ||
| skip_unset_macros | | skip_unset_macros | ||
- | | default_macro_string | + | | default_macro_string |
- | |old_revisions| Insert current version of snippet into Old Revisions|'' | + | Â |
- | The important addition here is the '' | + | ===== Notes on Options =====Â |
- | @macro_1, | + | Â |
+ | **userreplace**: When this is set to '' | ||
+ | @macro_1, | ||
When these macros are found in the template, they will be replaced by their replacement values. If a user-defined '' | When these macros are found in the template, they will be replaced by their replacement values. If a user-defined '' | ||
- | | + | |
- | If the '' | + | Â |
+ | **skip_unset_macros**: If this option is set to true, any macros left on the page after processing will be removed. | ||
- | If '' | + | **old_revisions**: This is the default value for determining how to handle snippets when you load an '' |
+ | This is an old revision of the document. It contains one or more snippets which may be outdated. | ||
+ | Replace outdated snippets in this Old Revision? Yes No | ||
- | Â | + | |
- | + | ||
===== Change Log ===== | ===== Change Log ===== | ||
+ | |||
{{rss> | {{rss> | ||
plugin/snippets.1505673143.txt.gz · Last modified: 2017-09-17 20:32 by turnermm