### Install RedCloth Gem Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Install the RedCloth gem using RubyGems. This is the standard method for adding the library to your Ruby environment. ```bash gem install RedCloth ``` -------------------------------- ### Numeric Lists: Basic Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Creates an ordered (numbered) list. Each list item starts with '#'. ```textile # A first item # A second item # A third ``` ```html
A single paragraph.
Followed by another.
``` -------------------------------- ### Multi-line Textile to HTML Conversion Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Shows how to process multi-line Textile content using a heredoc with RedCloth. The output is then printed to the console. ```ruby require 'redcloth' doc = RedCloth.new <justified
``` -------------------------------- ### Filtering HTML with RedCloth Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Illustrates how to filter potentially unsafe HTML tags, such as script tags, when converting Textile to HTML using RedCloth. This is done by passing an options array to the RedCloth constructor. ```ruby RedCloth.new("", [:filter_html]).to_html ``` -------------------------------- ### Block Alignment: Center Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Centers block content. Use 'p=.' for center alignment. ```textile p=. centered ``` ```htmlcentered
``` -------------------------------- ### Combined Alignment and Indentation Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Combines indentation and alignment. 'h2()>' applies left/right padding and right alignment. ```textile h2()>. Bingo. ``` ```htmlleft ident 1em
``` -------------------------------- ### Line Breaks Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Illustrates how Textile converts explicit line breaks into HTML break tags. ```Textile I spoke. And none replied. ``` ```HTMLI spoke. And none replied.
``` -------------------------------- ### En-Dash Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Illustrates the conversion of single hyphens into en-dashes. ```Textile Observe - tiny and brief. ``` ```HTMLObserve – tiny and brief.
``` -------------------------------- ### Block Alignment: Right Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Aligns block content to the right. Use 'p>.' for right alignment. ```textile p>. align right ``` ```htmlright align
``` -------------------------------- ### Indentation: Left 2em Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Indents block content 2em to the left. Use 'p((.' for 2em left indentation. ```textile p((. left ident 2em ``` ```htmlleft ident 2em
``` -------------------------------- ### Curly Quotes Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Demonstrates the conversion of single and double quotes to typographic curly quotes. ```Textile "Observe!" ``` ```HTML“ Observe!”
``` -------------------------------- ### Block Alignment: Left Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Aligns block content to the left. Use 'p<.' for left alignment. ```textile p<. align left ``` ```htmlalign left
``` -------------------------------- ### Header 1 Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Defines a block of text as a level 1 HTML header using 'h1.' prefix. ```Textile h1. Header 1 ``` ```HTMLright ident 3em
``` -------------------------------- ### Apply Table-Wide Attributes Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Apply attributes to an entire table by placing them on a separate line before the first row, followed by a period. This sets table-level styling. ```textile table{border:1px solid black}. |This|is|a|row| |This|is|a|row| ``` -------------------------------- ### Numeric Lists: Nested Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Creates nested ordered lists. Increase the number of '#' symbols for deeper nesting levels. ```textile # Fuel could be: ## Coal ## Gasoline ## Electricity # Humans need only: ## Water ## Protein ``` ```htmlObserve…
``` -------------------------------- ### Symbol Conversion Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Illustrates the conversion of trademark, registered, and copyright symbols. ```Textile one(TM), two(R), three(C). ``` ```HTMLone™, two®, three©.
``` -------------------------------- ### Em-Dash Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Shows how double hyphens are converted into em-dashes. ```Textile Observe -- very nice! ``` ```HTMLObserve— very nice!
``` -------------------------------- ### Header 3 Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Defines a block of text as a level 3 HTML header using 'h3.' prefix. ```Textile h3. Header 3 ``` ```HTML
a.gsub!( /, '' )
```
```html
a.gsub!( /</,
'' )
```
--------------------------------
### HTML within Textile
Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html
Shows how HTML tags are handled within Textile, noting that they are escaped only within 'pre' or 'code' blocks.
```Textile
I am very serious.
I am very serious.``` ```HTML
I am very serious.
I am < b> very</b> serious.``` -------------------------------- ### Dimension Sign Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Shows how the letter 'x' used alone is converted into a dimension sign. ```Textile Observe: 2 x 2. ``` ```HTML
Observe: 2× 2.
``` -------------------------------- ### Bulleted Lists: Nested Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Creates nested unordered lists. Increase the number of '*' symbols for deeper nesting levels. ```textile * Fuel could be: ** Coal ** Gasoline ** Electricity * Humans need only: ** Water ** Protein ``` ```htmlThe main text of the page goes here and will stay to the left of the sidebar.
``` -------------------------------- ### Apply Row-Specific Attributes Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Apply attributes to a single row by preceding it with the attribute definition, using the 'table' modifier, and a period. This allows for targeted row styling. ```textile |This|is|a|row| {background:#ddd}. |This|is|grey|row| ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.