Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2574 Bytes
1 | = Radius -- Powerful Tag-Based Templates |
2 | |
3 | Radius is a powerful tag-based template language for Ruby inspired by the |
4 | template languages used in MovableType[http://www.movabletype.org] and |
5 | TextPattern[http://www.textpattern.com]. It uses tags similar to XML, but can |
6 | be used to generate any form of plain text (HTML, e-mail, etc...). |
7 | |
8 | |
9 | == Usage |
10 | |
11 | With Radius, it is extremely easy to create custom tags and parse them. Here's a small |
12 | example: |
13 | |
14 | require 'radius' |
15 | |
16 | # Define tags on a context that will be available to a template: |
17 | context = Radius::Context.new do |c| |
18 | c.define_tag 'hello' do |
19 | 'Hello world' |
20 | end |
21 | c.define_tag 'repeat' do |tag| |
22 | number = (tag.attr['times'] || '1').to_i |
23 | result = '' |
24 | number.times { result << tag.expand } |
25 | result |
26 | end |
27 | end |
28 | |
29 | # Create a parser to parse tags that begin with 'r:' |
30 | parser = Radius::Parser.new(context, :tag_prefix => 'r') |
31 | |
32 | # Parse tags and output the result |
33 | puts parser.parse(%{A small example:\n<r:repeat times="3">* <r:hello />!\n</r:repeat>}) |
34 | |
35 | Output: |
36 | |
37 | A small example: |
38 | * Hello world! |
39 | * Hello world! |
40 | * Hello world! |
41 | |
42 | |
43 | == Quick Start |
44 | |
45 | Read the QUICKSTART file to get up and running with Radius. |
46 | |
47 | |
48 | = Requirements |
49 | |
50 | Radius does not have any external requirements for using the library in your |
51 | own programs. |
52 | |
53 | Ragel is required to create the ruby parser from the Ragel specification, |
54 | and both Ragel and Graphviz are required to draw the state graph for the |
55 | parser. |
56 | |
57 | |
58 | == Installation |
59 | |
60 | It is recommended that you install Radius using the RubyGems packaging system: |
61 | |
62 | % gem install --remote radius |
63 | |
64 | You can also install Radius by copying lib/radius.rb into the Ruby load path. |
65 | |
66 | |
67 | == License |
68 | |
69 | Radius is released under the MIT license and is copyright (c) 2006-2010 |
70 | John W. Long. A copy of the MIT license can be found in the LICENSE file. |
71 | |
72 | |
73 | == Roadmap |
74 | |
75 | This is a prioritized roadmap for future releases: |
76 | |
77 | 1. Clean up the current code base. [Done] |
78 | |
79 | 2. Add support for multi-level contexts: tags should be able to be |
80 | defined to only be valid within other sets of tags. [Done] |
81 | |
82 | 3. Create a simple DSL for defining contexts. [Done] |
83 | |
84 | 4. Optimize for speed, modify scan.rl to emit C. |
85 | |
86 | |
87 | == Development |
88 | |
89 | The latest version of Radius can be found on RubyForge: |
90 | |
91 | http://rubyforge.org/projects/radius |
92 | |
93 | Experimental and development versions of Radius can be found on Github: |
94 | |
95 | http://github.com/jlong/radius |
96 | |
97 | If you are interested in helping with the development of Radius, feel free to |
98 | fork the project on GitHub and send me a pull request. |
99 | |
100 | |
101 | John Long :: |
102 | http://wiseheartdesign.com |