[ANN] Radius 0.0.1 -- Powerful Tag-Based Templates

J

John W. Long

I am pleased to announce the immediate release of Radius 0.0.1. This is
very beta right now, but I wanted to release it so that I could begin
getting feedback.

Radius is a small, but powerful tag-based template language for Ruby
inspired by the template languages used in MovableType
<www.movabletype.org> and TextPattern <www.textpattern.com>. It uses
tags similar to HTML, but can be used to generate any form of plain text
(XML, e-mail, etc...).

Download:
http://rubyforge.org/frs/?group_id=1262

Documentation:
http://radius.rubyforge.org

Instalation:
% gem install radius

A small usage example:

class ThreeStoogesContext < Radius::Context
def initialize
@prefix = 'ts'
end
def stooge(attr)
content = ''
["Larry", "Moe", "Curly"].each do |name|
@name = name
content << yield
end
content
end
def name(attr)
@name
end
end

parser = Radius::parser.new(ThreeStoogesContext.new)

template = <<-TEMPLATE
<ul>
<ts:stooge>
<li><ts:name /></li>
</ts:stooge>
</ul>
TEMPLATE

puts parser.parse(template)


This will output:

<ul>

<li>Larry</li>

<li>Moe</li>

<li>Curly</li>

</ul>


Learn more by reading the Quick Start guide:
http://radius.rubyforge.org/files/QUICKSTART.html

Enjoy!
 
N

Nathaniel S. H. Brown

This looks a lot like PHPTAL.

http://phptal.motion-twin.com/

Nice work. Would love to see a .rad extension for Rails at some point :)

-Nb

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathaniel S. H. Brown http://nshb.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top