Textile

From MobileRead
Jump to: navigation, search

Textile in this wiki refers to a TXT markup language.

Contents

[edit] Overview

Textile is a markup language (like Markdown) for formatting text in a weblog or a content management system (CMS). It has more options than Markdown, but is also somewhat more difficult to read. Therefore, Textile is less widely used, but it is the preferred markup language when advanced formatting, such as complex tables, footnotes, etc. are required. Textile has been around for more than 10 years, and implementations exist for all major CMS, also Textile is supported by Github.

Textile looks a lot like wiki markup and it translates easily to HTML. Textile was originally implemented in PHP, but has been translated into other programming languages including Perl, Python, Ruby, ASP, Java and C#.

[edit] Basic formatting

Basic formatting includes bold or italic text, which is written as:

*bold* or _italic_ text

headlines of different levels, you would write:

h1. A very large headline
h2. A not so large headline
h3. A small headline

Bulleted lists are also easy:

 * Red
 * Green
 * Blue

Links such as Wikipedia are written in this style:

"Wikipedia":http://en.wikipedia.org/

A table is written as:

|_. First Header |_. Second Header |
|Content Cell |Content Cell |
|Content Cell |Content Cell |

[edit] tags

Tags are normally on a line above the text they apply to.

  • p. a paragraph (default)
  • bc. a block of lines of code
  • bq. a quotation block
  • pre. Pre-formatted text
  • div. Divisions (not implemented in PHP Textile)
  • h1. h2. h3. … Headline signatures
  • ###. a comment block
  • notextile. No textile formatting

[edit] Formatting

  • ( Adds 1em of padding to the left for each ‘(’ character.
  • ) Adds 1em of padding to the right for each ‘)’ character.
  • < Aligns to the left (floats to left for tables if combined with the ‘)’ modifier).
  • > Aligns to the right (floats to right for tables if combined with the ‘(’ modifier).
  • = Aligns to center (sets left, right margins to ‘auto’ for tables).
  • < > Justifies text.
  • {style rule} A CSS style rule.
  • [language] A language identifier (for a “lang” attribute).
  • (class) or (#id) or (class#id) For CSS class and id attributes.

The formatting modifiers can be combined. For example in order to right align a paragraph and set it in small type you would write:

p>{font-size:0.8em}. TxStyle is a documentation project for the 
Textile markup language.

[edit] Entities

Some Entities are recognized automatically. The list larger than the samples below.

  • Doublequote and singlequotes are converted to curly quotes.
  • -- is converted to emdash.
  • - by itself is converted to endash.
  • ... is converted to ellipsis
  • (c), (r), and (tm) are converted to copyright, registered, and trademark.

[edit] For more information

Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox