|
Dash Templating System |
|||||||||
|
Home
What's New Products Product Comparisons Features Screen Shots Downloads Updates Order Info Order Online Customer Comments Customers Support Solutions FAQ Papers AJAX JSON Editors Java HTML Perl JSP JavaScript PHP VBScript Velocity XML |
The purpose of Dash is help you reduce duplicate content and code and to automate generation of content and code by building programmable living files. For example, it can be used as a Java preprocessor and also used to generate a template based web site. Dash's internal language is JavaScript and it's syntax is similar to Freemarker, ASP, or PHP. It can be used to generate code for any file type including both client and server side code. This includes dynamic web pages using ASP or PHP. To use Dash, first create a Dash Document using the File/New... menu. In the File New dialog first select a file type, with optional template, and then click on the Dash Document button. Then edit the Dash document. Then to create the target files use one of the commands from the Build menu. In addition to including JavaScript in Dash statements, Dash also includes a 'call' and 'use' command to call a template. This feature makes it easy to use existing HTML based templates for generating a site. For example, the Dash document: <#@include dash.script #> <#@call $.DASH.masterTemplate #> <#@parameter content #> <p>Hello World! Created on <#= new Date() #> by <#= $.DASH.author #>. </p> <#@end #> <#@end #> with masterTemplate written as:
<html>
<head>
</head>
<body>
<#@use content #>
</body>
</html>
generates:
<html>
<head>
</head>
<body>
<p>Hello World!
Created on Sun Nov 13 13:28:17 PST 2005
by John.
</p>
</body>
</html>
In the above example '@use content' references the named content parameter of the '@call' statement. The values $.DASH.masterTemplate and $.DASH.author can be defined in the dash.script using JSON like this:
var DASH =
{
masterTemplate: "path to master template",
author: "John"
};
|
|||||||||
|