DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:textinsert

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:textinsert [2019-10-04 20:50] Aleksandrplugin:textinsert [2022-08-30 01:16] (current) – compatible Igor 82.64.33.11
Line 1: Line 1:
-====== textinsert Plugin ======+====== TextInsert Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 7: Line 7:
 type       : syntax type       : syntax
 lastupdate : 2019-10-03 lastupdate : 2019-10-03
-compatible : Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun,detritus,"Elenor Of Tsort" ,Greebo+compatible : Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun,detritus,"Elenor Of Tsort" ,Greebo, Hogfather, Igor
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : replace, macro, entities, entity tags       : replace, macro, entities, entity
  
-downloadurl: https://github.com/turnermm/TextInsert/tarball/master+downloadurl: https://github.com/turnermm/TextInsert/zipball/master
 bugtracker : https://github.com/turnermm/TextInsert/issues bugtracker : https://github.com/turnermm/TextInsert/issues
-sourcerepo : https://github.com/turnermm/TextInsert/+sourcerepo : https://github.com/turnermm/TextInsert
 donationurl: http://mturner.org/userfiles/donate.php  donationurl: http://mturner.org/userfiles/donate.php 
 ---- ----
Line 25: Line 25:
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
 +
  
 This plugin provides an administrative panel where you enter macro names and their substitution texts.  These are saved in the meta directory (in ''meta/macros/macros.ser''). In farms, you can choose to have a database for each animal (see: [[#configuration_and_settings]]). You can save individual words, and strings of text, including lengthy paragraphs.  The substitutions accept html, quotation marks and other punctuation.  The macro names can accept spaces, dots, underscores and hyphens.    This plugin provides an administrative panel where you enter macro names and their substitution texts.  These are saved in the meta directory (in ''meta/macros/macros.ser''). In farms, you can choose to have a database for each animal (see: [[#configuration_and_settings]]). You can save individual words, and strings of text, including lengthy paragraphs.  The substitutions accept html, quotation marks and other punctuation.  The macro names can accept spaces, dots, underscores and hyphens.   
Line 33: Line 34:
   All Roads Lead to "Here" except for the ones which don't   All Roads Lead to "Here" except for the ones which don't
  
-The textinsert plugin will allow you to create macros for extended texts. You can create paragraph length texts with HTML markup which have to be repeated, for instance, as instructions at the tops of pages.  If you want the HTML to be rendered as such, then the macro name must have the _HTML suffix: +The textinsert plugin will allow you to create macros for extended texts. You can create paragraph length texts with HTML markup which has to be repeated on multiple pages.  If you want the HTML to be rendered as such, then the macro name must have the _HTML suffix: 
  
   Macro_HTML       Macro_HTML    
  
 **Note**: The underscore is required. **Note**: The underscore is required.
 +==== Basic Syntax ==== 
 +     #@MACRO_NAME@# 
 ==== Macro Inclusions ==== ==== Macro Inclusions ====
  
-Some of the functionality of this plugin at its simplest can be implemented with DokuWiki's own entities facility: [[:entities]]. But for complex substitutions and for control over where and how substitutions are made, textinsert offers a wide variety of solutions and techniques. +Some of the functionality of this plugin at its simplest can be implemented with DokuWiki's own entities facility: [[:entities]]. But for complex substitutions and for control over where and how substitutions are made, Textinsert offers a wide variety of solutions and techniques. 
  
 One advantage of TextInsert comes when dealing with extended blocks of text and with its ability to include other macros inside the primary macro definition. That is, it can accept: One advantage of TextInsert comes when dealing with extended blocks of text and with its ability to include other macros inside the primary macro definition. That is, it can accept:
Line 48: Line 50:
   MACRO_2  a second macro   MACRO_2  a second macro
  
-The result with syntax #@MACRO_1@# is:+The result of using ''#@MACRO_1@#'' is:
   This macro can include a second macro inside it.   This macro can include a second macro inside it.
  
Line 71: Line 73:
 There is a configuration option which governs whether or not standard namespace macros are accepted.  It is set to true by default. There is a configuration option which governs whether or not standard namespace macros are accepted.  It is set to true by default.
  
-=== _ID_: Pseudo Namespace Macro for Sidebars===+=== _ID_ and _NS_: Pseudo Namespace Macros for Sidebars===
  
-When used in a sidebar the standard namespace macro ''ID'' resolves to the id of the sidebar page.  To get the id of the currently displayed page, use instead ''_ID_''.  This macro can also be used for [[#macro_inclusions]]. So, for instance if you wanted to display the result as a wiki link, you could do this:+When used in a sidebar the standard namespace macro ''ID'' resolves to the id of the sidebar page.  To get the id of the currently displayed page, use instead ''_ID_'', of the currently displayed namespace ''_NS_''.  These macros can also be used for [[#macro_inclusions]]. So, for instance if you wanted to display the result as a wiki link, you could do this:
  
 <code html> <code html>
Line 79: Line 81:
 </code> </code>
  
-If you use ''_ID_'' in your sidebar, then you must also insert the ''%%~~NOCACHE~~%%'' macro into the page so that the ID updates with each change of page.   See [[wiki:syntax#control_macros]].    +If you use ''_ID_'' or ''_NS_'' in your sidebar, then you must also insert the ''%%~~NOCACHE~~%%'' macro into the page so that the ID updates with each change of page.   See [[wiki:syntax#control_macros]].    
  
 ==== Example of Multi Paragraph Text Block ==== ==== Example of Multi Paragraph Text Block ====
Line 142: Line 144:
   #@Mountain_Ranges~Alps,Rockies,Andes~@#       #@Mountain_Ranges~Alps,Rockies,Andes~@#    
 **Result:** ''In Europe there are the Alps, in North America the Rockies and in South America the Andes'' **Result:** ''In Europe there are the Alps, in North America the Rockies and in South America the Andes''
 +
 +==== DokuWiki Basic Text Formatting Syntax ====
  
 Parameters may use the [[wiki:syntax#basic_text_formatting| basic text formatting syntax]]: bold,italic, etc.  The one exception is the internal newline.  If you need this you must use ''\n''. Parameters may use the [[wiki:syntax#basic_text_formatting| basic text formatting syntax]]: bold,italic, etc.  The one exception is the internal newline.  If you need this you must use ''\n''.
plugin/textinsert.1570215050.txt.gz · Last modified: 2019-10-04 20:50 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki