### 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
  1. A first item
  2. A second item
  3. A third
``` -------------------------------- ### Bulleted Lists: Basic Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Creates an unordered (bulleted) list. Each list item starts with '*'. ```textile * A first item * A second item * A third ``` ```html ``` -------------------------------- ### Creating Simple Tables with Textile Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Demonstrates the syntax for creating simple tables in Textile. Columns are separated by pipes, and rows are on separate lines. Styles can be applied using curly braces. ```textile |a|simple|table|row| |And|Another|table|row| ``` -------------------------------- ### Basic RedCloth Usage Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Demonstrates the basic usage of RedCloth by initializing it with a Textile string and converting it to HTML. Ensure you `require 'redcloth'` first. ```ruby require 'redcloth' text = "This is *my* text." RedCloth.new(text).to_html ``` -------------------------------- ### Basic Paragraphs and Line Breaks Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Demonstrates how Textile handles paragraphs separated by blank lines and how single line breaks are converted to HTML breaks. ```Textile A single paragraph. Followed by another. ``` ```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 <I searched Google.

``` -------------------------------- ### Block Alignment: Justified Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Justifies block content. Use 'p<>.' for justified alignment. ```textile p<>. justified ``` ```html

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 ``` ```html

centered

``` -------------------------------- ### 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. ``` ```html

Bingo.

``` -------------------------------- ### Combined Alignment, Indentation, and Language/Style Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Combines alignment, indentation, language attribute, and CSS styles. 'h3()>["no"]{color:red}.' applies these attributes. ```textile h3()>["no"]{color:red}. Bingo ``` ```html

Bingo

``` -------------------------------- ### Styling Tables in Textile Source: https://github.com/jgarber/redcloth/blob/master/README.rdoc Shows how to apply CSS styles to tables and cells in Textile. Styles are defined within curly braces preceding the table or row definition. ```textile table{border:1px solid black}. {background:#ddd;color:red}. |a|red|row| ``` -------------------------------- ### Indentation: Left 1em Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Indents block content 1em to the left. Use 'p(.' for left indentation. ```textile p(. left ident 1em ``` ```html

left 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. ``` ```HTML

I 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. ``` ```HTML

Observe – 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 ``` ```html

right 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 ``` ```html

left 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 ``` ```html

align 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 ``` ```HTML

Header 1

``` -------------------------------- ### Header 2 Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Defines a block of text as a level 2 HTML header using 'h2.' prefix. ```Textile h2. Header 2 ``` ```HTML

Header 2

``` -------------------------------- ### Indentation: Right 3em Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Indents block content 3em to the right. Use 'p))).' for 3em right indentation. ```textile p))). right ident 3em ``` ```html

right 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 ``` ```html
  1. Fuel could be:
    1. Coal
    2. Gasoline
    3. Electricity
  2. Humans need only:
    1. Water
    2. Protein
``` -------------------------------- ### Ellipsis Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Demonstrates how triplets of periods are converted into an ellipsis character. ```Textile Observe... ``` ```HTML

Observe…

``` -------------------------------- ### 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). ``` ```HTML

one™, 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! ``` ```HTML

Observe— 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

Header 3

``` -------------------------------- ### Embedding HTML: Pre and Code Tags Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Embeds preformatted code within 'pre' and 'code' tags. Textile processors ignore indented code within these tags. ```textile

  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 ``` ```html ``` -------------------------------- ### Embedding HTML: Div Tag for Sidebar Source: https://github.com/jgarber/redcloth/blob/master/doc/textile_reference.html Uses a 'div' tag with 'float:right' style to create a sidebar. This separates main content from sidebar content. ```textile
h3. Sidebar "GitHub":http://github.com/ "Ruby":http://ruby-lang.org/
The main text of the page goes here and will stay to the left of the sidebar. ``` ```html

Sidebar

GitHub Ruby

The 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.