Thither MT-Textile 2 (beta)
Ok, so Dean has taken the wraps off his version, so I shall do the same. MT-Textile 2 is back in beta. I assure you, there are bugs to be found, so please go git 'em!
The test CGI I've created has been updated to use the new code. It's a great way to play with the syntax prior to unleashing it on your Movable Type installation. The Mantis bug tracker is the preferred way to report any bugs you find.
The beta version of the plugin is available here. But please remember it is a beta release. It may produce "funky" results (OK, let's not start that again).
Here's a rundown of some of the new syntax:
Basic formatting
| Technique | Example |
|---|---|
| Style assignment | p{color:red}. This is a red paragraph. |
| Class assignment | p(first-para). This is the first paragraph. |
| Id assignment | p(#copyright). This is the copyright |
| Class/Id | p(blah#bleh). Class blah, Id bleh. |
| Align right | p>. Align to right |
| Align left | p<. Align left |
| Centered | p=. Align center |
| Justified | p<>. Justified text |
| Language assignment | p[fr]. en Française |
Table Formatting
table{width:400px}=. |\2. This demonstrates a column span. colspan = 2 |-/2. rowspan = 2, vertically centered |
|{background-color:yellow}. This shows you can use styles with table cells. |>. With alignment |
{background-color:#ccc}|_. Header cell, with row-level style assignment. | *Inline formatting* | And you can even
span multiple lines
now. |
produces...
| This demonstrates a column span. colspan = 2 | rowspan = 2, vertically centered | |
| This shows you can use styles with table cells. | With alignment | |
| Header cell, with row-level style assignment. | Inline formatting | And you can even span multiple lines now. |
|---|---|---|
Alignment Characters for Tables
| Character | Alignment |
|---|---|
| > | right |
| < | left |
| = | center |
| - | middle (for vertical alignment) |
| ^ | align top (like 'sup' marker) |
| ~ | align bottom (like 'sub' marker) |
| <> | justified (align to left and right) |
| /n | Rowspan - n=number ('/' reads push downward) |
| \n | Colspan - n=number ('\' reads push forward) |
Footnotes!
Example
This is an example of a footnote[1]. fn1. Here is where the footnote is placed.
producing...
This is an example of a footnote1.
1 Here is where the footnote is placed.
Image Alignments
| Character | Alignment |
|---|---|
| > | right (floats right) |
| < | left (floats left) |
| - | inline text, middle/centered |
| ^ | inline text, align at top |
| ~ | inline text, align at bottom |
Padding
Padding characters are placed with the block markers. Like "p)." or "p(.". You can also repeat and mix them as desired: "p(())." means to pad 2em on both the left and right sides.
| Character | Meaning |
|---|---|
| ( | Pad on left side (1em for each) |
| ) | Pad on right side (1em for each) |
Spans
%this is a span%
and
%(class#id)this span has a CSS class and id%
Putting it all together
Here's an example of how you can do a lot of formatting with a little bit of Textile:
<div style="width:350px" class="center"> table)>. |!/photos/summer2003/DSCN0814.thumb.jpg 75% (Georgia Choate)!| |=. <small>_My wife, Georgia_</small>| Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed sed odio a mauris tincidunt consectetuer. Maecenas libero. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent rhoncus est sit amet augue. Ut non libero. Aliquam mollis eros eu purus. In hac habitasse platea dictumst. Fusce nulla elit, blandit ac, hendrerit quis, sollicitudin eget, enim. Integer sit amet eros ut risus convallis auctor. Duis tortor. Integer imperdiet dignissim neque. </div>
Which produces:
| My wife, Georgia |
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed sed odio a mauris tincidunt consectetuer. Maecenas libero. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent rhoncus est sit amet augue. Ut non libero. Aliquam mollis eros eu purus. In hac habitasse platea dictumst. Fusce nulla elit, blandit ac, hendrerit quis, sollicitudin eget, enim. Integer sit amet eros ut risus convallis auctor. Duis tortor. Integer imperdiet dignissim neque.
And briefly
A quick note to those that wonder why all the fuss. Dean set out to create a kind of shorthand for composing for the web. To be able to write and format your writing with less fuss. Textile is not a replacement for HTML, but complimentary to it. Textile allows you to include HTML and use it's shorthand in the same space. But for most things you write, you can probably avoid hitting those "<" and ">" keys altogether.
So... where can we download the plugin?
Kick ass Brad. I can't wait to "unleash" it!
i can't read your website. The entire left column with content is displaying one word under the other!
This is great! Thanks.
A minor nit/question on syntax: the mixture of round, square and curly brackets?
I guess there is no way to try to standardize on one set. It seems to me one of those tiny little things that people will always be forgetting and screwing up and wasting time with. A small usability thing.
I like the period delimiter. I was trying to get Dean's attention a while back about that old war horse, Digital Standard Runoff (DSR). the troff/nroff tool on VAXs. It was my first text processing tool and it still rings with a lot of conmonsensical consistency and utility. In Runoff, the commands began with a period in column one and were terminated with a semi-colon. It was a very powerful utility and would have been a real boon for generating xHTML, etc.
Great work and thanks for squashing some angle brackets!
I like MT-Textile, and it's great that Dean and you both working on the syntax. So we would have standardised Textile implementations. :)
ed: Yeah, I know. Lotsa punctuation. But each serves a different purpose. The parenthesis for class/id, the brackets for language, the curly braces for doing style attributes. You can't just use one set of delimiters for everything or Textile may not know what you're really trying to do. It also makes it easier for the writer to see what is what.
It seems like the general idea of Textile is to use it for one-time HTML generation only. However, I can see situations where a user might want to go back and edit their document, and if they wrote in in textile they won't want to look at a bunch of machine-generated HTML. So for hep I'm planning to store the original textile document when possible. This means that I need a mimetype to associate with textile documents.
Do you have a mimetype already? If not, any suggestions? text/textile? application/textile? text/vnd.textile?
I like MT-Textile, and it’s great that Dean and you both working on the syntax. So we would have standardised Textile implementations
Urls in blockquotes are not working in the beta.
Also, what if a blockquote has two paragraphs? Currently when using bq. if i put a two line breaks then the bq ends, so if I want two paragrapghs in the bq i have to manually put the tags, or use
When will we get the final version of manual? I'm willing to translate it into Chinese!
Great work! =)
Is format_inline intended to be a public interface? If I have some text that I don't want to be split into paragraphs (ie, the intended contents of a blog article's 'title'), is it legal to call format_inline() on it?
Textile.pm works fine with perl 5.6.0 for me on
my home computer. But my hosting service is
running perl 5.004_04. perl -w Textile.pm gives
me:
/=[a-zA-Z0-9./])
# Match the leading part (proto://hostname, or just hostname)
(/: unmatched () in regexp at Textile.pm line 160.
I'd appreciate any help that would enable me to rewrite all such syntax to work with perl
5.004_04
There doesn't seem to be any way to center an image on a page. You can float either way, but not center.
That said... this rocks! I just discovered Textile yesterday and I think I'm in love.
First, the congratulions. Man, this is real good even for someone who knows XHTML. Second, the problem (lol).
I'm having failures at rebuilding. It gets to "Rebuilding entry: Individual" and doesn't change to "Rebuilding entry: Monthly" as expected.
I deleted every file of the plugin and now MT works fine, just like before. I wish I could tell you my Perl and Apache versions but I'm not so damn good at this.
Any idea?
hey. first of all, thanks for great plugins! I re-wrote the textile plugin a little since I wanted the acronym-tag to be applied to small letters as well as caps.
but, I'm not very into how to rewrite plugins so I wonder if there is a way to get for an example, the acronym-tag, to work with other characters exept a-z, like å, ä and ö. I tried, but didn't succeed. :)