Changes between Initial Version and Version 1 of Documentation/Plugins/InsertSnippet


Ignore:
Timestamp:
03/15/18 00:55:38 (18 months ago)
Author:
gogo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Plugins/InsertSnippet

    v1 v1  
     1= Plugin: InsertSnippet  = 
     2 
     3Provide functionality to insert snippets of HTML (or any other text, such as variable substitutions). 
     4 
     5 
     6[wiki:Plugins Back to Plugins] 
     7 
     8== Configuration == 
     9 
     10**See the [wiki:NewbieGuide#ProvideSomeConfiguration NewbieGuide] for how to set configuration values in general, the below configuration options are available for this plugin.** 
     11 
     12 
     13  xinha_config.snippets = '/url/path/to/snippets.js';:: 
     14    The URL path to a javascript file which defines a "snippets" array. 
     15 
     16The snippets file, which is not "JSON" but an eval'd javascript script, must define the array "`snippets`" in which each element is an object with the properties 'id' and 'HTML'. 
     17 
     18=== Example snippets.js file === 
     19 
     20{{{ 
     21 
     22  var snippets = [ 
     23    { id: 'Snippet 1', HTML: '<span>Hello World</span>' }, 
     24    { id: 'Snippet 2', HTML: '{HowNowBrownCow}' } 
     25  ]; 
     26 
     27}}} 
     28 
     29Obviously you can generate this file manually, or dynamically by whatever processes you desire, just specify the path to it in the configuration.