MT-Textile does that???
Things you probably didn't realize you could do with MT-Textile 2:
- Hyperlinks for Amazon, IMDB and Google searches. For example (search term can be placed after the last ':', or will default to the hyperlinked text):
- "James Bond":imdb:Sean+Connery becomes James Bond
- "Tangerine Dream":amazon becomes Tangerine Dream
- "Movable Type":google becomes Movable Type
- ["MT plugins by Brad Choate":google:movable type plugin choate] becomes MT plugins by Brad Choate
- Float images to the left and right; center stuff too:
- !>/images/me.jpg! (floats image to right)
- !</images/me.jpg! (floats image to left)
- p=. !/images/me.jpg! (centers image in a paragraph)
- Use character macros for many international characters and symbols:
- My 2{c|} becomes My 2¢
- Resum{e'} becomes Resumé
- {:)} becomes ☺
- {umbrella} becomes ☂ (these are available if you have the 'charnames' Perl module as part of your Perl installation -- if so, all available unicode character names can be expressed like this to produce that character)
- Write sloppy HTML for an XHTML formatted web site:
- <br> becomes <br />
- <img ...> becomes <img .../>
- <hr> becomes <hr />
- Make your text bigger and smaller using ++double plusses++ and --double minuses--
- Create definition lists using the "dl" block signature:
- dl. term 1:This is the definition.
term 2:another definition
- dl. term 1:This is the definition.
- Combine HTML and Textile together. Textile tries to be pretty smart about HTML that's mixed in with Textile content. If you find some egregious mishandling, please report it to the bug tracker.
- Footnotes
- Indicating a footnote-- add [number] to the end of a word (cannot be preceded by a space to be recognized).
- Placing a footnote paragraph-- use the "fnN." block signature, where "N" is the number for the footnote you're creating.
- Create some pretty fancy tables, complete with style sheet rules, header cells, row and column spanning, alignment and so on.
- Write valid XHTML. I would say that 99% of your weblog posts can be done using pure Textile markup. That is, without the need to write any HTML at all.
- Give things class. CSS class names can be assigned to most anything (of course, it's up to you to write the CSS stylesheet):
- p(first). Paragraph text will add a
class="first"attribute to the paragraph tag. - %(logo)BigCorp% creates a "span" tag with the class "logo".
- p(first). Paragraph text will add a
- You can assign CSS id attributes too:
- p(#copyright). Copyright (c) 2004
- You can even write style rules in there (thank goodness XHTML 2 has decided to preserve this option)
- p{color:red;font-weight:bold}. Stuff I want in red and boldface.
- Define your language. Most things accept a language modifier:
- p[fr]. Je suis tres bien. (makes a paragraph of French text)
- bq[fr]. Je suis tres bien. (makes a blockquote of French text)
- %[fr]Je suis tres bien.% (makes a span with French text)
- Colorize Java, PHP and Perl code (if you also have MT-CodeBeautifier installed):
- bc[java]. public static void main(String[] args) {
System.out.println("Hello, world!");
} - @[php]echo "Hello, world!\n";@
- bc[java]. public static void main(String[] args) {
- Use the
<$MTTextileOptions$>tag to control MT-Textile (this tag would be placed at the top of any MT templates that produce MT-Textile formatted data. You can combine multiple options within one tag):<$MTTextileOptions head_offset="2"$>-- translates "h1." block signatures into<h3>tags instead (and so forth for h2, h3, etc.). This allows you to logically write "h1" as a top-level heading within your entry but have it render as an h3 tag upon publishing to your weblog.<$MTTextileOptions preserve_spaces="1"$>-- causes double-spaces to be changed to the HTML entity for an em-space (&8195;).<$MTTextileOptions trim_spaces="1"$>-- strips extra spaces from the end of each line.<$MTTextileOptions smarty_mode="2"$>-- lets you customize the SmartyPants handling. See the documentation for the SmartyPants for more.<$MTTextileOptions flavor="html/css"$>-- changes the output of Textile-created markup to be HTML 4.01 friendly.
- Write entire entries like this one without using angle brackets. (OK, I had to for the MT tag examples, but you know what I mean.)
Fantastic job! You've essentially covered all the issues I previously had with textile.
Test: ++{umbrella}++ ++{:)}++
However, using textile2 in your comments here sends this out: "MT::App::Comments=HASH(0x805c064) Use of uninitialized value in sprintf at lib/MT/Template/Context.pm line 1187."
Oh, well that appears to be an error with MT itself.
That is sexy. Thank you.
__"If you specify a language modifier for "bc" blocks or for "@…@" strings, it will invoke the Code Beautifier to colorize the code."__
Brad - could you elaborate on how exactly you go about doing that? Where do you specify the language, i'll be so pleased to learn how!
Top stuff mate...this thing is just so bloody powerful now...just gotta learn how to use it all :)
I feel like a guy that has received his first car: I do not know exactly how to use this, but it sure does look exciting!
One minor quibble - I have a site with a query string in the URL for the extended entry (that tells the page to display that extended entry). e.g. http://www.domain.com/article/00001.php?display=full
Footnote links, however, don't link to the full version, so it doesn't work. Any way to add in a "url suffix" kinda thing?
I'm having a little difficulty implementing the "clear" block signature.
I had two images that I needed to insert in the middle of a blog entry, between two paragraphs. I floated the two images left and put a "clear" block signature on the next line, but the following text just floated left alongside the second image. I also noted that all block signatures that came after the "clear" block signature were ignored. After removing the "clear", the block signatures that were previously ignored were formatted correctly.
I would display the exact Textile2 formatting I used, but it's not rendered properly by the comments formatting.
Oops, the previous comment was from me.
I tried the
[excom]http://example.com
"Text to display":excom
but it does not work when using a seperate template, that includes nothing else, than rows of
[shortcut]URI
I added
<$MTInclude module="MyIncludes"$>
as very first line in all my textual templates (index, archives) and MyIncludes contains also this:
<$MTInclude module="MyLinks"$>
This is the file with the row of links in Textile2 format.
It does now work. All the shortcuts are written as text on top of each page.
From the writers guide:
"p A paragraph block.... newlines for XHTML content receive a
"
It would be nice to be able to turn the newline conversion off. For example, when word-wrapped text has been copied into an entry, I don't want automatic line breaks, and it is extremely annoying to remove the newlines.
Otherwise, the plugin is excellent.
Ooops, the entities above were converted back to tags after previewing. The first line should read:
From the writers guide:
"p A paragraph block.... newlines for XHTML content receive a <br />"
Geeky feature request -- is there any chance of getting a special code for ? Something like ??Lord of the Rings?? would be superb.
Brad, is there any way that you can use Textile to create 'jump' links to content elsewhere on the same page? I thought your footnote link feature might do it, but it's a bit of a kludge to use that, if you know what I mean.
Christian;
There should be - I gave Brad the fix to do that.
What you do is use a relative link. First, do the link like this - "see here":#other_note
Then you can create a paragraph that's the target like this:
p(#other_note). Here's the other end of the link.
You should be able to use any block type that takes a CSS ID. You do need to be a little careful to not re-use ID strings between posts that appear on the same page.