A Humane Web Text Generator
A lightweight markup language that takes (almost) plaintext and converts it into well formed HTML.
The only file that is necessary for the correct operation of Textile is classTextile.php
from the project root directory. However, to use additional features you may need to install other files from the project tree.
For live installations only files and subdirectories from the master
branch should be used. Code from other branches should not be used on live sites.
See the composer wiki page if you use composer to manage the dependencies in your projects.
You’ll need to include the source file and instantiate a parser…
include "classTextile.php"; # adjust paths if needed.
$textile = new Textile();
Then, for input that you control, pass it to TextileThis()
. Like so…
$output = $textile->TextileThis( $trusted_input );
If you are using Textile to format user-supplied input, blog comments for instance, use a TextileRestricted()
call…
$output = $textile->TextileRestricted( $untrusted_input );
From v2.3.2 onward, PHP Textile can target either XHTML or HTML5 output with XHTML being the default for backward compatibility. If you need HTML5 generation, just do…
$textile = new Textile('html5');
…and you’ll get abbr
instead of acronym
and if you use alignment markers on your images you’ll have extra classes placed on them instead of xhtml’s align
attribute.
The textile project welcomes constructive input and bug reports from users. You can contact us in several ways.
- Open an issue on the repository for a feature request or bug.
- If you are on IRC, feel free to drop into #textile on freenode.net (webchat.)
- Use the generic contact form.