require "ragex.rb" require "ragexex.rb" File.open("index.html", "w") do |indexhtml| r = Ragex.new(indexhtml) r.html { head { title { "ragex - Ruby Adaptive GEnerator for Xhtml" } meta({'http-equiv'=>"content-type"}, "text/html; charset=ISO-8859-1") link "stylesheet", "style.css", "text/css" meta "author", "Peter Thoman" } body { div("main") { div("header") { img("img/logo.jpg", "ragex logo") ' Wipes away the cruft of XHTML' } h1 { "General Information" } p { h2 { "What is ragex?" } acronym("Ruby Adaptive GEnerator for Xhtml"){"Ragex"} t" is a " a("http://www.ruby-lang.org"){"ruby"} t" library for generating valid XHTML. It offers two (mixable) styles: Block-based (preferred) and stateful. Most XHTML tags are supported currently (v#{Ragex::RAGEX_VERSION}), and new ones can be added very easily." br t"This page was generated using ragex. The source file can be found " a("#getit"){"here."} br t"View some small examples " a("#examples"){"here."} br t"If you have any comments or suggestions please contact me at: " a("mailto:peter@metaclassofnil.com"){"peter@metaclassofnil.com"} } p { h2 { "Design goals" } ul { li { 'Follow the "Principle of least code" - both in the library and in the interface' } li { 'Produce valid, readable XHTML' } li { em { '"There is more than one way to do it"' } } li { 'Use the same identifiers as XHTML at all times' } li { 'Strongly prefer CSS based layout - no support for obsolete HTML attribs' } } } p { h2 { "User quotes" } ul { li { em {'Ragex is fun to work with, does just about everything I need in a xhtml generator, without much fuzz :D'} } } } a(:name=>"getit") {} h1 { "Get it" } p { t"Ragex is just one file (ragex.rb) with no dependencies." br t"Additionally, there's ragexex.rb with some additional stuff which needs the 'syntax' gem." ul { li { a("ragex.rb"){"ragex.rb"} "- The library" } li { a("ragexex.rb"){"ragexex.rb"} "- Extended ragex" } li { a("ragex_test.rb"){"ragex_test.rb"} "- Contains some examples" } li { a("ragex_hp.rb"){"ragex_hp.rb"} "- The source code for this site" } } } a(:name=>"examples") {} h1 { "Examples" } p { h2 { "Hello World" } pre("codebox") { ruby(IO.read("example1.ex")) } } p { h2 { "Alternative style" } p { "Use only if you can't use block style for some reason ;)" } pre("codebox") { ruby(IO.read("example2.ex")) } } p { h2 { "Forms" } p { "Could still be easier, probably in future ragexex versions." } pre("codebox") { ruby(IO.read("example3.ex")) } } p { h2 { "Other stuff" } pre("codebox") { ruby(IO.read("example4.ex")) } } h1 { "Links" } p { t"Here are some related (or not) links:" ul { li { a("http://metaclassofnil.com"){"metaclassofnil.com"} "- Zen" } } } } } } end