Editing easy texts and code with Scribes

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Templates

Using templates defined in Scribes, you can go one step further. You even have the option of working with variables to customize the text. You can create the basic structure of an HTML or PHP file with templates. Often the same text formulations appear over and over again in the scope of a project, and templates can help.

Scribes templates are not document templates, but material that you call up while working on a file. The program searches through the text for one of the keywords that constitutes this material. To create a template, use the Alt+F12 key combination, which opens the template editor. The application organizes the templates by programming language. Indicate the desired file format (e.g., HTML ) on the left of the window, then click the Add button to create a new building block. Scribes opens a dialog where you enter the abbreviation and description for the template (see Figure 6).

Figure 6: Using templates, you can load documents or text snippets that can contain variables.

The mask provides three fields. In Name , enter the keyword you use in the text to call up the template. Use a short but memorable term for the name, and be sure it can't be mistaken for regular text. To distinguish among various templates more quickly, enter an optional Description .

In the Template field, enter the recurring text. If you want to use placeholders in the template, enclose them in braces and avoid space characters (Listing 3). If you use a placeholder in multiple places, the software replaces it with the same content. If you like the results, just click Save and add additional templates if desired.

Listing 3

Sample Template

Hello ${greeting},
Thanks, ${person), for your e-Mail. Sorry, I only just now got to it.

To use a template, enter the keyword in the text. Scribes recognizes the keyword (provided the file format matches the one created in the template editor) and notifies you in the status bar.

To replace the keyword with the template, press Tab and the cursor immediately lands on the first placeholder for the template. Simply overwrite it by typing. Every template can contain the $(cursor) placeholder that serves to locate the cursor at the desired place in the template. Navigate among placeholders with Tab or Shift+Tab.

At the bottom of the template editor is a link with which you can load additional templates if desired. To select a template for your own work, first open the template editor. Indicate the format to use, then click the Import button, and change to the directory containing the templates. The new template then appears, and you can customize as you wish.

Advanced Settings

If you click the little arrow next to the tool icons, the program provides additional options. With the entries under Trigger Area , you can define where you want the software to display the icon bar and what colors to use to make it as unobtrusive as possible.

The additional options include a command for changing themes. If you would like a different color combination, choose Theme Selector and decide on the template. The selection dialog provides the Themes button for downloading more design templates (that you can also find on this issue's DVD). Unzip these and use the Add command to add each one to the list of active designs.

Other settings relate to various text types. You can change the font and size as you wish. You can also set how many characters to display on a line.

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content