Search
Table of ContentsDeveloper's Manual
Before you start... Index Creating templates and skins

## Editors for the Yana Framework

### General introduction

Many editors may make working with the Yana Framework easier. To aid you with translating, developing new plugins, or writing skins, syntax Highlighter and code templates are available for different editors.

The following section is to show you examples, how these tools can facilitate your work.

### Integration in ConTEXT

#### Installation

For editing the configuration files, templates and plugins of the Yana Framework in "ConTEXT", syntax Highlighter and code templates are available ConTEXT is a programmer's editor. You can get it from the internet at http://context.cx. The program is free and offers support for far more than 50 programming languages and file formats. Among them the complete Yana Framework.

For the installation of the highlighter and template files for the Yana Framework, install ConTEXT first. Then open the installation directory of the editor and copy the "ConTEXT Highlighter files" (* chl) to the directory "Highlighters" and "ConTEXT Template files" (* ctpl) to the "Template" directory (see figure). If you have ConTEXT open already, please restart the editor now.

Figure: ConTEXT installation directory

ConTEXT offers the possibility of using the manual of the Yana Framework directly in the editor. To use this feature, do as follows:

1. Open the menu "Options" > "Environment Options"

Figure: Open environment options

2. Switch to the menu "Miscellaneous" and choose the entry "Yana Framework" and / or "Yana Framework Templates" from the list.

3. Click the button "edit".

Figure: Associate documentation

4. Select the file type "all files (*.*)", search your local hard disk for the file "index.html" of this manual and mark this file with your mouse.

5. Click on "Open"

Figure: Choosing file "index.html" as front page

5. Save your changes by clicking "OK".

You can get all the required files at the following web sites:

- ConTEXT Web site
- Highlighter file for configuration files
- Highlighter file for templates
- Code snippets for configuration files
- Code snippets for templates
- Code snippets and auto-completion for PHP

#### Use

##### 1. Example: editing a database schema file

Open a configuration filei (e.g. a database schema at folder yana/config/db/) using ConTEXT and choose the highlighter "Yana Framework".

Figure: Working with database schema files in ConTEXT

##### 2. Example: Editing a template

Open a template file with ConTEXT and choose the highlighter setting "Yana Framework Templates".

Figure: Working with a template file in ConTEXT

##### 3. Example: Using text blocks / code snippets

To insert a code snippets use the shortcut <CTRL> + <j>, or choose "Insert Code from Template" in menu "Format". A list will be displayed. It constists of two parts: left you will find the keyboard shortcuts and on the right a description. Select a code template using your mouse or the cursor keys and press <ENTER> to insert it.

You may narrow the selection, by typing the first character of the template. If only 1 templates fits for insertion, the list will not be shown and the template will be inserted directly.

E.g.: fast creation of a database schema file

1. Open a new file in ConTEXT
2. Select the highlighter "Yana Framework"
3. Enter the shortcut "db" and press <CTRL> + <j> to create the file body
4. Enter "tbl" and press <CTRL> + <j> to create a new table
5. Enter the name of the table (repeat it at the closing tag)
6. In the section "Primary_Key" enter "id" as the name of the primary key
7. Go to the section "CONTENT", enter "id" and press <CTRL> + <j> again to have the primary key column created automatically
8. After the column "id" enter a new line, then enter the text "string" and press <CTRL> + <j> to create a new column of type "string"
9. Name the column (repeat name at closing tag)
10. In the section "Description" you can enter a description for the current column

The result is demonstrated in the following figure.

Figure: Creating a new table the easy way

See the list for more shortcuts.

### Integration in PSPad

#### Installation

For editing the configuration files, templates and plugins of the Yana Framework in "PSPad", syntax Highlighter and code templates are available ConTEXT is an editor for web developers. You can get it from the internet at http://www.pspad.com. The program is free ware.

PSPad can also be used on an USB device without installation.

To install highlighter and template files for the Yana Framework please install PSPad first. Then open the installation directory of the editor and copy the "Highlighter files" (*.ini) to the directory "Syntax" and "Template files" (*.def) to the "Context" directory (see figure). If you have PSPad open already, please restart the editor now.

Figure: PSPad installation directory

To finish the installation you have to activate the new files in PSPad.

1. To do so, open the menu "Settings" > "Highlighter Settings" in PSPad.
2. Click on a free slot (these are marked by the text "not assigned")
3. Go to menu "Specification" (see figure)
4. From the menu "User Highlighters" choose the entry "Yana Framework" and / or "Yana Framework Templates"
5. To activate the highlighter by clicking the checkbox next to the name
6. Please click on "OK"

Figure: Activating the highlighter

You can get all the required files at the following web sites:

- PSPad Web site
- Highlighter file for configuration files
- Highlighter file for templates
- Code snippets for configuration files
- Code snippets for templates
- Code snippets and auto-completion for PHP

#### Use

##### 1. Example: editing a plugin

Open a plugin definition file (plugins/*.config) in PSPad.

To select the highlighter click the button "Change document syntax highlight" (see figure).

Figure: a configuration file for the Yana Framework opened in PSPad, on the right an active code browser

Select the entry "Yana Framework" or (when editing templates choose "Yana Framework Templates") and click "OK".

Figure: Choosing syntax highlighting

##### 2. Example: using text blocks (Clips)

As in ConTEXT you can use prepared blocks of text in PSPad. These are called "Clips" in PSPad and can be viewed by using the keyboard shortcut <CTRL> + <SPACE>.

Use of this feature is identical to that in ConTEXT. A menu will be shown. It constists of two parts: left you will find the keyboard shortcuts and on the right a description. Select a code template using your mouse or the cursor keys and press <ENTER> to insert it.

You may narrow the selection, by typing the first character of the template.

Figure: using "Clips" in PSPad

Before you start... Index Creating templates and skins

Thomas Meyer, www.yanaframework.net