Snippets syntax: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
|next=Man 2 ch08 | |next=Man 2 ch08 | ||
}} | }} | ||
{{toc}} | {{toc}} | ||
The snippets are stored in <tt>~/.bluefish/snippets</tt>. | |||
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: <nowiki><?xml version="1.0"?></nowiki>. | |||
* The document must be included in the container: <nowiki><snippets> <snippets></nowiki> | |||
* Any snippet must be contained in a branch: <nowiki><branch title="example"> </branch></nowiki> | |||
* The branches may contain other branches. | |||
* Each snippet is described in a container: <nowiki><leaf> </leaf></nowiki> | |||
== | == Syntax examples == | ||
There are two types of snippets: '''insert''' and '''snr''', aka '''S'''earch '''N''' '''R'''eplace. | |||
=== Insert snippets === | |||
<ol> | <ol> | ||
# <nowiki><?xml version="1.0"?></nowiki> | # <nowiki><?xml version="1.0"?></nowiki> | ||
Line 23: | Line 31: | ||
# <nowiki></branch></nowiki> | # <nowiki></branch></nowiki> | ||
# <nowiki></snippets></nowiki> | # <nowiki></snippets></nowiki> | ||
=== Search and replace snippets === | |||
</ol> | </ol> |
Revision as of 18:21, 20 March 2010
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
- <?xml version="1.0"?>
- <snippets>
- <branch title="Facebook">
- <leaf type="insert" title="bold"><before><b></before><after></b></after></leaf>
- <leaf type="insert" title="italic"><before><i></before><after></i></after></leaf>
- <leaf type="insert" title="Hyperlink"><before><a href="%0"></before><after></a></after><param name="url"/></leaf>
- <leaf type="insert" title="em-dash"><before>&mdash;</before><after></after></leaf>
- </branch>
- </snippets>
Search and replace snippets