Snippets syntax

From Bluefish Wiki
Revision as of 19:21, 20 March 2010 by Fal7i (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
 

The snippets are stored in ~/.bluefish/snippets. It is an XML file, like import and export snippets files.

  • The import file must have a valid XML syntax.
  • The document must include the header: <?xml version="1.0"?>.
  • The document must be included in the container: <snippets> <snippets>
  • Any snippet must be contained in a branch: <branch title="example"> </branch>
  • The branches may contain other branches.
  • Each snippet is described in a container: <leaf> </leaf>

Syntax examples

There are two types of snippets: insert and snr, aka Search N Replace.

Insert snippets

    1. <?xml version="1.0"?>
    2. <snippets>
    3. <branch title="Facebook">
    4. <leaf type="insert" title="bold"><before>&lt;b&gt;</before><after>&lt;/b&gt;</after></leaf>
    5. <leaf type="insert" title="italic"><before>&lt;i&gt;</before><after>&lt;/i&gt;</after></leaf>
    6. <leaf type="insert" title="Hyperlink"><before>&lt;a href="%0"&gt;</before><after>&lt;/a&gt;</after><param name="url"/></leaf>
    7. <leaf type="insert" title="em-dash"><before>&amp;mdash;</before><after></after></leaf>
    8. </branch>
    9. </snippets>

    Search and replace snippets