SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 232 | Next

Ola Bini

"Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java"

It handles many of the worst parts about writing content in HTML,
and lets you concentrate on writing, instead of writing angle brackets. RedCloth is the premier
implementation of Textile in Ruby, and it??™s nice to work with generally. A new, faster version,
called SuperRedCloth, is in development, and can also be used with JRuby. The API works
almost exactly the same way, so we??™ll just be using regular RedCloth here. For example, say you
have this text:
h1. Welcome to CoMpoSe
This is a small example of what you can do with something like
*Textile*. Most of what you'd like to do just works, so write everything
like you're used to, and it will be fine.
For example, a list of things could look like this:
* A thing
* Another thing
** Some subthings
** More subthings
* A final thing
CHAPTER 8 ?–  CONTENT RENDERING 151
You can also create tables and other formatting tools with Textile,
but all that information is available in the documentation, which
can be easily found with Google.
You can render this with a Ruby program that looks like this:
require 'rubygems'
require 'redcloth'
puts RedCloth.new(File.read(ARGV[0])).to_html
That would generate this HTML:

Welcome to CoMpoSe


This is a small example of what you can do with something like
Textile.
Most of what you’d like to do just works,
so write everything like you’re used to,
and it will be fine.


For example, a list of things could look like this:



  • A thing

  • Another thing

    • Some subthings

    • More subthings



  • A final thing


You can also create tables and other formatting tools with Textile,
but all that information is available in the documentation, which
can be easily found with Google.


Pages:
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244