Ynote Syntax Files
Ynote supports Syntax Highlighting from an Xml File. Anyone can create a Ynote Syntax File using his/her knowledge of Regular Expressions because Syntax Highlighting in Ynote is based on Regular Expressions. Follow this section to learn more about Ynote
Syntax Files.
How do they work ?
When ynote starts, it loads all the files in the Syntaxes\ directory into the list of Syntax Highlighting Schemes. The Files give ynote the following information -
- How to highlight the code
- Which brackets to highlight
- The Comment Prefix of the Syntax
- The File Extensions of the Syntax
- The Code Folding Indications
Structure
The Structure of a YnoteSyntax file is -
- Ynote Syntax Root Node i.e <YnoteSyntax>
- Syntax Node (Specifies information about the file)
- CommentPrefix - The Comment Prefix of the Syntax. eg - //
- Extensions - The File Extensions of the Syntax separated by ' | ' character
- Brackets Node (Brackets Highlight.)
- Left - The Left Bracket Character. eg - '('. (Required)
- Right - The Right Bracket Character eg - ')'. Accompanies Left
- Left2 - The Left Bracket Character 2. eg - '['. (Optional)
- Right2 - The Right Bracket Character 2. eg - ']'. Accompanies Left2
- The Rules Node - The Rules for Syntax Highlighting ( Can be many )
- Type - The Style to be applied on it. eg - Comment, Keyword, Keyword2 etc.
(Required)
- Regex - The Regular Expression when matched will highlight the fragment
- Options - The Regex-Options for the Regular Expression
- Folding Node - Folding Markers (Can be many )
- Start - The Folding Start Marker(Regex). eg-'{'
- End - The Folding End Marker(Regex). eg - '}'
- Options - The Regex Options (Optional)
- The Ynote Syntax End Node </YnoteSyntax>
See the Sample File in the Ynote Samples Repository
here.