Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[ANN] Radius 0.0.1 -- Powerful Tag-Based Templates
John W. Long
1/22/2006 5:18:00 AM
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/?gro...
Documentation:
http://radius.rub...
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.rub...
/files/QUICKSTART.html
Enjoy!
2 Answers
Nathaniel S. H. Brown
1/22/2006 7:18:00 AM
0
This looks a lot like PHPTAL.
http://phptal.motion...
Nice work. Would love to see a .rad extension for Rails at some point :)
-Nb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathaniel S. H. Brown
http:...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -----Original Message-----
> From: John W. Long [mailto:ng@johnwlong.com]
> Sent: January 21, 2006 9:18 PM
> To: ruby-talk ML
> Subject: [ANN] Radius 0.0.1 -- Powerful Tag-Based Templates
>
> 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/?gro...
>
> Documentation:
>
http://radius.rub...
>
> 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.rub...
/files/QUICKSTART.html
>
> Enjoy!
>
John W. Long
1/22/2006 2:18:00 PM
0
Nathaniel S. H. Brown wrote:
> This looks a lot like PHPTAL.
>
>
http://phptal.motion...
I'm a little partial to the radius syntax. :)
> Nice work. Would love to see a .rad extension for Rails at some point :)
Someone is already working on a plugin for it, so perhaps it won't be
too much longer.
--
John Long
http://wiseheart...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[ANN] Radius 0.0.1 -- Powerful Tag-Based Templates
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password