Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
syntax:start [2016/03/06 16:23] – [General rules] adminsyntax:start [2018/03/23 12:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Syntax schema definition ====== ====== Syntax schema definition ======
  
-Here you can find basic description of HippoEDIT [[terms:syntax-schema|syntax schema]] structure and navigate to more detailed topics.+Here you can find basic description of HippoEDIT [[terms:syntax-schema|syntax schema]] structure and navigate to more detailed topics.
  
 ===== How long it takes to create new syntax schema ===== ===== How long it takes to create new syntax schema =====
 The time you need to create a new syntax schema depends on the programming language syntax complexity and on the language syntax "uniqueness" The time you need to create a new syntax schema depends on the programming language syntax complexity and on the language syntax "uniqueness"
  
-Normally if the language has C like syntax, you will need less than 1 hour to create the basic skeleton of the new syntax schema. For more complex languages it could take up to 3 hours. Of course the time also depends on how familiar you are with HippoEDIT syntax definition rules. Looking at a similar existing syntax as an example can help. +Normally if the language has C-like syntax, you will need less than 1 hour to create the basic skeleton of the new syntax schema. For more complex languages it could take up to 3 hours. Of coursethe time also depends on how familiar you are with HippoEDIT syntax definition rules. Looking at a similar existing syntax as an example can help. 
  
-If you have an existing syntax schema for UltraEDIT, TextPad or PSPad you can greatly speed up creation by converting the existing schema into HippoEDIT syntax definition schema using [[plugins:syntax-tools|Syntax Tools Plugin]].+If you have an existing syntax schema for UltraEdit, TextPad or PSPad you can greatly speed up creation by converting the existing schema into HippoEDIT syntax definition schema using [[plugins:syntax-tools|Syntax Tools Plugin]].
  
 More advanced syntax configuration as: labels (to get [[view:pane:navigation|function list]] working), [[options:syntax:code-templates|code templates]] and [[tools:start|tools definition]] will take some more time but will give you a chance to work more effectively with source code for which you build the schema.  More advanced syntax configuration as: labels (to get [[view:pane:navigation|function list]] working), [[options:syntax:code-templates|code templates]] and [[tools:start|tools definition]] will take some more time but will give you a chance to work more effectively with source code for which you build the schema. 
Line 22: Line 22:
  
 ==== Syntax attributes ==== ==== Syntax attributes ====
-  * **id** (any string, preferable low case, without spaces and symbol : ) – unique id of the language (obligatory)+  * **id** (any string, preferably low case, without spaces and symbol : ) – unique id of the language (obligatory)
   * **name** (any string) – description of the language that would be used in UI   * **name** (any string) – description of the language that would be used in UI
-  * **inherit** (any id) – name of base (parent) schema. New schema would inherit all settings, styles of parent. Normally you need to inherit from def or def_text or def_source. These schemes contain base definition for styles, without them a lot of functionality would not be available. +  * **inherit** (any id) – name of base (parent) schema. The new scheme would inherit all settings, styles of the parent. Normally you need to inherit from def or def_text or def_source. These schemes contain base definition for styles, without them a lot of functionality would not be available. 
-  * **inhertit_url** (file path, relative or absolute) – name of parent schema file. Used only for navigation between schemas when opened in browser (optional).+  * **inhertit_url** (file path, relative or absolute) – name of parent schema file. Used only for navigation between schemas when opened in the browser (optional). 
 +  * **abstract** (boolean, true/false, the default is false) - if set to true, the syntax will not be used for direct document syntax, but only as a base for some other syntax  
 +  * **version** (string, in form of N.N) - version of the syntax schema 
 +  * **required** (string, in form of N.N) - minimum version of the HippoEDIT to ensure proper syntax highlighting 
 +  * **preferred** (string, in form of N.N) - minimum optimum version of the HippoEDIT to ensure the best level of syntax highlighting 
 +  * **author** (any string) - author of the schema. If not set, //author// from //FileInfo// node is used 
 +  * **email** (any string) - email of the author
  
 After creating the definition files and copying them into {Data} folder, HippoEDIT should load definitions and display them in Available Languages list (//Tools->Options->Available Languages//). After creating the definition files and copying them into {Data} folder, HippoEDIT should load definitions and display them in Available Languages list (//Tools->Options->Available Languages//).
Line 38: Line 44:
 ===== General rules ===== ===== General rules =====
  
-  * There is no specific order of XML tags necessary. But for keywords it's better to keep alphabetic order - this way internal loading is faster.+  * There is no specific order of XML tags necessary. But for keywordsit's better to keep alphabetic order - this way internal loading is faster.
   * All tags and attribute name are CASE SENSITIVE.   * All tags and attribute name are CASE SENSITIVE.
-  * All non English text should be correctly encoded in UTF-8+  * Whole not English text should be correctly encoded in UTF-8
   * You can use comments, comment some parts etc.   * You can use comments, comment some parts etc.
  
 ===== How to Modify an existing syntax schema ===== ===== How to Modify an existing syntax schema =====
-Direct modifications of default syntax schemes is NOT recommended. The reason is, that your modifications may be overwritten by HippoEDIT update (installation on top) and you will need to repeat them once more.  +Direct modifications of default syntax schemes are NOT recommended. The reason is, that your modifications may be overwritten by HippoEDIT update (installation on top) and you will need to repeat them once more.  
-<note tip>HippoEDIT installer creates backups, before overwriting existing version of syntax schema file, coping the old version in file //<name_of_original_file>.old//. So, if you have a luck, you can copy your modifications from it in installed file.</note>+<note tip>HippoEDIT installer creates backups, before overwriting existing version of syntax schema file, copying the old version in file //<name_of_original_file>.old//. So, if you have a luck, you can copy your modifications from it in installed file.</note>
  
-The recommended way for modificationis creating new syntax schema, inheriting from original one, and adding there new styles or overwriting inherited ones, for example. To not have conflicts with detecting of proper syntax on document open (you have two syntax schema definitions reacting on same file mask, due to inheriting) you can disable original syntax in Tools->Options->Syntax Settings (uncheck it in the list).+The recommended way for modification is creating new syntax schema, inheriting from the original one, and adding new styles or overwriting inherited ones, for example. To not have conflicts with the detecting of proper syntax on document open (you have two syntax schema definitions reacting on same file mask, due to inheriting) you can disable original syntax in [[options:syntax:start|Tools->Options->Syntax Settings]] (uncheck it in the list).
  
 Example of syntax schema for HTML, adding new style: Example of syntax schema for HTML, adding new style:
Line 74: Line 80:
   * [[syntax:tooltip|Tooltip text formatting]]   * [[syntax:tooltip|Tooltip text formatting]]
  
-<note tip>The easiest way to start with creating a new syntax schema is to import one of the existing syntax definitions from other editors with help of [[plugins:syntax-tools|Syntax Tools plugin]].</note>+<note tip>The easiest way to start with creating a new syntax scheme is to import one of the existing syntax definitions from other editors with help of [[plugins:syntax-tools|Syntax Tools plugin]].</note>