--- - A Textile Reference: - Textile is a simple text markup. Simple symbols mark words' emphasis. Blocks of text can be easily tagged as headers, quotes, or lists. A Textile document can then be converted to HTML(Hypertext Markup Language) for viewing on the web. - You can try Textile out on the "Textile home page":http://www.textism.com/tools/textile/. Textile is also available as "RedCloth":http://whytheluckystiff.net/ruby/redcloth/ for Ruby or "PyTextile":http://dealmeida.net/projects/textile for Python. - Also refer to the "*Quick Reference*":javascript:quickRedReference(); for this guide. - h4. Reading the Examples - In each section below, examples are provided to clearly illustrate. In each example, the Textile example is followed by the raw HTML it is translated into, followed by how the HTML appears in the browser. - - Textile example - Converted to HTML - Browser-view - Writing in Textile: - Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph. - !!example "A single paragraph.\n\nFollowed by another." - h4. Using HTML in Textile - You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it's found in a @pre@ or @code@ block. - !!example "I am very serious.\n\n
\n I am very serious.\n" - h4. Line Breaks - Line breaks are converted to HTML breaks. - !!example "I spoke.\nAnd none replied." - Line breaks can be disabled in RedCloth by turning on @fold_lines@. - h4. Entities - Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye. - !!example '"Observe!"' - Double hyphens are replaced with an em-dash. - !!example Observe -- very nice! - Single hyphens are replaced with en-dashes. - !!example Observe - tiny and brief. - Triplets of periods become an ellipsis. - !!example Observe... - The letter 'x' becomes a dimension sign when used alone. - !!example 'Observe: 2 x 2.' - Conversion of trademark and copyright symbols. - !!example 'one(TM), two(R), three(C).' - Quick Block Modifiers: - Blocks of text default to being treated as paragraphs. But modifers can be affixed to the beginning of a block to change its treatment. - h4. Headers - To make an entire paragraph into a Header, place "hn." at its beginning, where _n_ is a number from 1-6. - !!example h1. Header 1 - !!example h2. Header 2 - !!example h3. Header 3 - h4. Block Quotes - To make an entire paragraph into a block quotation, place "bq." before it. - !!example "An old text\n\nbq. A block quotation.\n\nAny old text" - h4. Footnotes - Numeric references within text to footnotes appear between square brackets. - !!example This is covered elsewhere[1]. - To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote's number, followed by a dot and a space. - !!example fn1. Down here, in fact. - Quick Phrase Modifiers: - h4. Structural Emphasis - Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as italics. - !!example I _believe_ every word. - Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as bold. - !!example And then? She *fell*! - Both italics and bold can be forced by doubling the underscores or asterisks. - !!example "I __know__.\nI **really** __know__." - Use double question marks to indicate _citation_. The title of a book, for instance. - !!example "??Cat's Cradle?? by Vonnegut" - Code phrases can be surrounded by at-symbols. - !!example "Convert with @r.to_html@" - To indicate a passage which has been deleted, surround the passage with hypens. - !!example "I'm -sure- not sure." - Pluses around a passage indicate its insertion. - !!example "You are a +pleasant+ child." - To superscript a phrase, surround with carets. - !!example "a ^2^ + b ^2^ = c ^2^" - To subscript, surround with tildes. - !!example "log ~2~ x" - h4. HTML-Specific - Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span. - !!example I'm %unaware% of most soft drinks. - This way, you can apply style settings, as described in the next section to arbitrary phrases. - !!example "I'm %{color:red}unaware%\nof most soft drinks." - Attributes: - Tailoring Textile to suit your needs is quite easy. Attributes allow you to provide CSS(Cascading Style Sheets) information about any phrase. - h4. Block Attributes - A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block. - !!example p(example1). An example - An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class. - !!example p(#big-red). Red here - Class and ID can be combined by placing the class first. - !!example p(example1#big-red2). Red here - Style settings can be provided directly by surrounding them in curly braces. - !!example p{color:blue;margin:30px}. Spacey blue - Language designations can be given between angel brackets. - !!example p[fr]. rouge - h4. Phrase Attributes - All block attributes can be applied to phrases as well by placing them just inside the opening modifier. - !!example "I seriously *{color:red}blushed*\nwhen I _(big)sprouted_ that\ncorn stalk from my\n%[es]cabeza%." - h4. Block Alignments - Text inside blocks can be aligned in four basic ways. - !!example p<. align left - !!example p>. align right - !!example p=. centered - !!example p<>. justified - Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right. - !!example p(. left ident 1em - !!example p((. left ident 2em - !!example p))). right ident 3em - h4. Combining Alignments - Identation may be coupled with alignment. - !!example "h2()>. Bingo." - And, furthermore, coupled with language settings and CSS styles. - !!example "h3()>[no]{color:red}. Bingo" - h4. HTML in Textile - Textile is designed for quickening the simple markups. For more complex formatting, you are encouraged to break out into HTML. - For example, long code blocks belong between @pre@ and @code@ tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents. - !!example |
a.gsub!( /, '' )
- You may also choose to surround sections with @div@ tags to separate your document into sections.
"Instiki":http://www.instiki.org/ uses this technique to float a sidebar to the right.
- !!example |