textile2x - Convert Textile markup from the command-line


    # Each of these does the exact same thing

    textile2x --input README.textile --output README

    textile2x < README.textile > README

    textile2x --convert README.textile=README


textile2x is a simple script that converts Textile markup to any of the formats supported by the Text-Textile-Plaintext CPAN distribution. Currently, the list of formats includes:

Plain text
Rich-Text Format

One or more inputs can be converted at a time, and not all inputs have to be converted to the same output format. See "OPTIONS".

Depending on the command-line options, input may be redirected from STDIN, and output may be redirected to STDOUT.


The following options are recognized by textile2x:

--format FORMAT

Specifies the default format for conversions. The default conversion format is plaintext. The allowable values are:


The argument to --format is not case-sensitive.

--input FILE

Specify a file to read from. If this option is not present and there are no instances of the --convert option, then standard-input is read.

--output FILE

Specify the file to write to. If this option is not present and there are no instances of the --convert option, then the converted content is written to standard-output.

--convert NAME[=NAME]

This option may appear more than once, to allow multiple conversions done in a single invocation of the tool.

Each name provided is read as Textile content, and converted. If a second name is provided (using = to separate them, no spaces are allowed between the names and the =), it is used as the output destination. If the output file has a suffix, it is used to determine the format of the output:


Output will be plaintext.


Output will be postscript.


Output will be rtf (Rich-Text Format).

If no output name is given, the input name is used. Any suffix it has is removed, and a suffix corresponding to the default format (as specified by the --format option, or defaulting to plaintext) is used.


Displays a short help-message with a summary of the options.


Please report any bugs or feature requests to bug-text-textile-plaintext at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.



This file and the code within are copyright (c) 2009 by Randy J. Ray.

Copying and distribution are permitted under the terms of the Artistic License 2.0 ( or the GNU LGPL 2.1 (


Text::Textile::Plaintext, Text::Textile::PostScript, Text::Textile::RTF


Randy J. Ray <>