Overview

Syntactik Editor is a standalone application for authoring XML and JSON documents using Syntactik preprocessor language.

Syntactik Editor is implemented as add-in for open source cross platform IDE MonoDevelop.

Installation

See Syntactik Editor installation instructions

Language

Use Syntactik.NET readme as the language reference.

Projects

To create a new Syntactik project use "File/New Solution" menu item.


Then choose type of Syntactik project.


Choose name and path for the created project.

New File

To add a new file use "File/New File" menu item. In the New File dialog, select Syntactik category in the left list box if you want to add a new Syntactik file to your project. You can also add text, XML and HTML files to your Syntactik project if needed.


Project options

The menu Project/<project_name> Options opens Project Options dialog. Among all, the dialog includes options for Source Code Formatting. Here you can create a separate policy for Syntactik projects. For example, you could set up the type of indentation (tabs or spaces) you will use.


Schemas

Syntactik XML projects can include XSD schema files. JSON schema is not supported yet.
To add XSD schema files to the project, open context menu of the Schema folder, and click on "Add Schema".


Find and attach the xsd files using Add Schema dialog.


Editing

Syntax highlighting

Syntactik Editor highlights pair names with different colors depending on which DOM class type the pair represents.

Element  #ab3339
Attribute  #ff0000
Namespace Definition
Scope
 #00c800
Document
Alias Definition
 #0000ff
Alias  #009696
Argument
Parameter
 #00c8c8

The editor also highlights pair values and comments.

Literal value  #5d0095
JSON literal  #ef00ef
Attribute value
URI
 #f57d00
Comment  #c0c0c0

Examples:



Code completion

Press Ctrl+Space to show Code Completion dropdown list.


The Code Completion dropdown list will open automatically when you start typing a name of element, alias, argument




or in the middle of the alias name after you press dot ..


Code completion filters list of the displayed items based on the context. If context is missing then it will display a full list of known completion entities. For example, there is no context in the beginning of the alias definition, so code completion will display the full list of available items.


The completion logic filters the list based on the entered symbols:


Code folding

Code folding helps to edit and navigate large files. Click the folding icons +/- in the beginning of lines to toggle foldings.


Other toggle functions are available in the View/Folding menu.

Path widget

Path widget display path from the current editing DOM item to the root ancestor DOM item. Each item in the path has content menu with "Go to" menu item. Clicking on Go to will cause the cursor to move at the start of the corresponding item.


Interactive errors

Syntactik Editor automatically finds syntactic errors and underline the problem code fragment. Roll the mouse cursor over the undeline to see the description of the error.


Copy/Paste operations

Syntactik Editor has additional copy/paste command on top of the standard ones. They help quickly convert fragments of code from Syntactik to XML/JSON, and vice versa.
Paste Syntactik Fragment command helps to move indented Syntactic code from one place to another without worrying about indent mismatch.

Copy Document as XML/JSON

Use Copy Document as XML/JSON to quickly convert Syntactik document to XML/JSON format. Just place the cursor anywhere inside the document and click on the menu item. Editor will display the message XML/JSON document is copied to clipboard if the convertion succeeded. Otherwise it will display Document can't be converted to valid XML/JSON.


Paste the result XML in any text editor.


Copy Selection as XML/JSON

Use Copy Selection as XML/JSON to quickly convert fragments of Syntactik code to XML/JSON format. Select the fragment you want to convert and click on the menu. Editor will display the message XML/JSON is copied to clipboard if the convertion succeeded. Otherwise it will display Selection can't be converted to valid XML/JSON.


Paste the result XML/JSON in any text editor.


Paste XML/JSON

Use Paste XML/JSON to convert fragments of XML/JSON from the clipboard to Syntactik format. Select the fragment you want to convert and copy it to clipboard.


Put the cursor in the position where you want to insert the converted code. It is important to choose the right indent. Click on Paste XML/JSON menu.


The converted fragment will be inserted in the code. Editor will display the message Syntactik code is generated from XML/JSON in clipboard if the convertion succeeded. Otherwise it will display Text in clipboard is not valid XML/JSON.


Paste Syntactik Fragment

Paste Syntactik Fragment command helps to move indented Syntactic code from one place to another without worrying about indent mismatch. For example, if you want to define an alias based on fragment, you could select and cut the code to the clipboard.


Then put the cursor inside the created Alias Definition and click Paste Syntactik Fragment command. The fragment with the correct indent will be inserted at the position of the cursor.


Note that the orginal fragment had 2 tabs indent and the pasted fragment automatically got 1 tab indent.

Build

Use Build/Build <project_name> F7 command to build the current.


All documents defined in the project will be compiled into the output project folder.


You can change output directory in the Project Options dialog.