Textile (markup language)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Textile is a lightweight markup language originally developed by Dean Allen and billed as a "humane web text generator". Textile converts its marked-up text input to valid, well-formed XHTML and also inserts character entity references for apostrophes, opening and closing single and double quotation marks, ellipses and em dashes.

Textile was originally implemented in PHP, but has been translated into other programming languages including Perl, Python, Ruby, ASP, Java and C#.

Textile is distributed under a BSD-style license and is included with, or available as a plugin for, several content-management systems.

Contents

[edit] Textile syntax examples

This is not an exhaustive listing of Textile's syntax. For a list of all available options in Textile 2, see the full syntax reference and a full reference and example list here.

[edit] Emphasized text

_emphasized_ (e.g., italics)
*strongly emphasized* (e.g., boldface)

[edit] Lists

* An item in a bulleted (unordered) list
* Another item in a bulleted list
** Second Level
** Second Level Items
*** Third level
# An item in an enumerated (ordered) list xxxxxxx
# Another item in an enumerated list yyyyyy
## Another level in an enumerated list vvvvvvvv
* This is a bullet
*# this is the start of an enumerated list within a bulleted list
*# this is another item list of an enumerated list within a bulleted list
**# this is another level of an enumerated list within a bulleted list
* This is another bullet

[edit] Tables

A | character must be at the beginning and end of every row.

|_. Header |_. Header |_. Header |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 1 | Cell 2 | Cell 3 |

[edit] Code

Generic example:

@your code here@

Blocks of code:

bc.. puts "This style (notice the double dot) handles blank lines."
puts "This is the second line of code."

puts "This is the fourth."

Or alternatively you can use this syntax for small blocks:

bc. puts "This style (notice the single dot) stops at the first blank line."
puts "This is the second line of code."

This is not code.

[edit] Headings

You must leave a blank line after each heading.

h1(#id). An HTML first-level heading

h2. An HTML second-level heading

h3. An HTML third-level heading

h4. An HTML fourth-level heading

h5. An HTML fifth-level heading

h6. An HTML sixth-level heading

[edit] Blockquotes

bq. This text will be enclosed in an HTML blockquote element.

[edit] Links

"(classname)link text(title tooltip)":link_address

[edit] Email links

 "(classname)link text(title tooltip)":mailto:someone@example.com

[edit] Images

!imageurl(alt text)!

[edit] Formatting help table

This table summarizes the available textile markers

Textile markers
Textile Visual result
*bold text* bold text
_italic text_ italic text
*_bold italic text_* bold italic text
-strikethrough text- strikethrough text
*-bold strikethrough text-* bold strikethrough text
*_-bold italic strikethrough text-_* bold italic strikethrough text
+underlined text+ underlined text
*+bold underlined text+* bold underlined text
_+italic underlined text+_ italic underlined text
*_+bold italic underlined text+_* bold italic underlined text
*_-+bold italic strikethrough underlined text+-_* bold italic strikethrough underlined text
%{font-size:18pt}font size% font size
%{color:red}text in red% text in red
Link to click for the list of colours
# Chapter 1
  1. Chapter 1
* bulleted list
  • bulleted list

* bulleted list

** 2-level

  • bulleted list
    • 2-level

|Table | with two columns |

|and two | rows |

Table with two columns
and two rows
"Link to Wikipedia":http://www.wikipedia.org
Link to Wikipedia
 !http://commons.wikimedia.org/wiki/Special:Filepath/Wikipedia-logo-en.png!
Wikipedia-logo-en.png
Brand ^TM^ Brand TM
Text ~subscript~ Text subscript

[edit] Users

[edit] See also

  • Textpattern, a content-management system, also originally by Dean Allen, which uses Textile.
  • Markdown, a similar lightweight markup language.
  • txt2tags, a similar lightweight markup language.

[edit] External links

Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages