RBML 0.1.3b

About RBML

RBML is a markup language used to generate dynamic web-content. It is embedded among HTML and analyzed by the RBML Template Processing Engine (TPE).

Updates

The TPE now supports the 'rebinclude tag!  One can include other .rbml or .html file by simply specifying
the filename in the tag.  Note that this is a unary tag:

  <rebinclude "testinc.rbml"/>

The TPE now supports unary tags! Before, one had to specify a closing tag, even if there was nothing between the opening and closing tag.  For example, the old model required the following syntax:

  <rebset loginname "Bob"></rebset>

Whereas, you can now use the more familiar standard SGML syntax of:

  <rebset loginname "Bob"/>

Supported Tags

Tag Description
<rebscript> </rebscript> Anything between the begin and end tags is considered to be raw REBOL code and will be treated as such.
Example:
  <rebscript>
    my-date: now/date
    print my-date
  </rebscript>
<rebout> </rebout> Anything between the begin and end tags will be parsed for variable delimited with ~'s and evaluated inline.
Example:
  <rebout>
    <table>
      <tr>
        <td>~loginname~</td>
        <td>~logintime~</td>
      </tr>
    </table>
  </rebout>
<rebloop count #> </rebloop> Anything between the begin and end tags is performed in the standard REBOL looping fashion, repeating the specified numbers of times by 'count'
Example:
  <rebscript>
    my-index: 1
  </rebscript>
  <rebloop count 10>
    my-index: my-index + 1
    print ["Can't I just have " my-index " more, please?<br>"]
  </rebscript>
<rebinclude 'file/>

This tag provides the developer the ability to include other templates or snippets.  The filename is specified within the begin tag.
Example:

  <rebinclude "testinc.rbml"/>
<rebset 'word any-type!/> Actually an empty tag set, where functionality is provided in the opening tag. The word (variable) specified is assigned the provided value.
Example:
  <rebset loginname "Bob"/>
OR
<rebset loginname "Bob"></rebset>


Future Tags

Tag Description
<rebquery> </rebquery> Text between the begin and end tags should be a valid SQL statement to be sent to the database server. Connection parameters will be part of the open tag, and result set will be stored into a seperate REBOL structure.
Example:
  <rebquery datasource 127.0.0.1 dbname "logindb" auth "bob:eep">
    select * from tblLogin
  </rebquery>


Setup

The project is currently being developed on a Windows server and as such the instructions will be geared towards Windows, but differences for *NIX should be obvious to anyone comfortable with *NIX.

Assuming the following setup for Rebol and Apache/Win32:
  c:\rebol\rebol.exe
  c:\program files\apache group\apache\

First, just pop the "rbml.r" file into the cgi-bin directory of the apache installation like so:

  c:\program files\apache group\apache\cgi-bin\rbml.r

Then, put your RBML template files into the htdocs directory like so:

  c:\program files\apache group\apache\htdocs\test.rbml
  c:\program files\apache group\apache\htdocs\testinc.rbml

Add the following lines to your httpd.conf in the "apache\conf" directory:

  Action rbml /cgi-bin/rbml.r
  AddHandler rbml .rbml 

Start or restart the apache service and hit http://localhost/test.rbml (Voila!)
Feel free to contact me with comments, questions or suggestions.

Files

Item File
Source for the TPE:    rbml.r
Sample of RBML template:    test.rbml
Sample include template:    testinc.rbml



Copyright 2001 Schuhr.Com