Jump to content

Textile v2.4 now available


netcarver
 Share

Recommended Posts

Hello all,

I've just pushed textile 2.4 up to github should anyone wish to try out some of the new features. If you do try it out, please keep me informed of your successes or failures with it. Download instructions are at the end of this post.

What's New?

Quite a lot...

  1. Support for HTML comments.
  2. Support for extended characters in URLs.
  3. Support for Redcloth-style definition lists.
  4. More robust handling of notelists and note definitions.
  5. Support for linebreaks in table cells.
  6. Support for apostrophes following abbr/acronyms.
  7. Support for ordered list continuation/start control.
  8. More robust detection of lists so that even those which are not separated from the previous text are found.
  9. Customisable format for footnote refs and marks and for notelist refs.

And here are some examples of the above to help you get started

1: Support for HTML comments.

Previously having HTML comments embedded in your textile source code could lead to broken output. You should now be able to get well formatted output even if you feed it things such as...

Here is some text with a <!-- Commented out[1] --> block.

<!-- Here is a single <span>line</span> comment block -->

<!-- Here is a whole
multiline
<span>HTML</span>
Comment
-->

bc. <!-- Here is a comment block in a code block. -->

2: Support for extended characters in URLs.

You can now do this...

"Übermensch":https://de.wikipedia.org/wiki/Übermensch

"äöüÄÖÜßçéáóúèàòùÉÁÓÚÈÀÒÙêÊôÔâÂûÛåÅœŒæÆøØëËïÏ with trailing slash":https://en.wikipedia.com/ä/öüÄÖÜßç/éáóúè/àòùÉÁÓÚ/ÈÀÒÙêÊôÔâÂû/ÛåÅœŒæÆøØëËïÏ/

...and get correctly formatted links. However, if your link has non-word characters at the end then you have to use textile's link alias feature to get them correctly recognised and encoded. So for things like...

http://msdn.microsoft.net/en-us/library/cby9kycs(v=vs.80).aspx	 (brackets + multiple periods)

http://ja.wikipedia.org/wiki/福島駅_(大阪府)/	 (brackets)

...you would need to do this...

Contact "Microsoft":myalias1 or check out "福島駅":myalias2.

[myalias1]http://msdn.microsoft.net/en-us/library/cby9kycs(v=vs.80).aspx
[myalias2]http://ja.wikipedia.org/wiki/福島駅_(大阪府)/

3: Support for Redcloth-style definition lists.

Although PHP-textile has supported definition lists for a while, this version adds support for the redcloth definition list syntax. So you can now define lists so...

- coffee := Hot _and_ black
- tea := Also hot, but a little less black
- milk := Nourishing beverage for baby cows.
Cold drink that goes great with cookies. =:

4: More robust handling of notelists and note definitions.

Textile is pretty picky about its notedef and notelist syntax. Prevoiusly both had to be terminated with a period. As users seem to miss these out fairly regularly I've relaxed this and now your notedefs and notelists don't need to end with a .

5: Support for linebreaks in table cells.

You should now have newlines converted into <br /> properly in tables now.

6: Support for apostrophes following abbr/acronyms.

Previously apostrophes following abbr/acronyms were not being encoded correctly, showing up as an open-single-quote mark. These should now work just fine...

NATO(North Atlantic Treaty Organisation)'s pretty big.

The NHS(National Health Service)' charter states...

7: Support for ordered list continuation/start control.

When starting an ordered list you can now specify the start attribute to be applied like so...

#8 Item 8
# Item 9

And if you want to continue a list's numbering from where you previous ordered list finished you can let textile know using the continuation character...

#_ Item 10
# Item 11

8: More robust detection of lists so that even those which are not separated from the previous text are found.

I've relaxed the constraint that lists have to be separated from what comes before them by two newlines. So the following example will still correctly generate a list...

A list of colours.
* Red
* Green
* Blue

9: Customisable format for footnote refs and marks and for notelist refs.

Some languages need a slightly different way of showing footnote references in the main text (or indeed, marking them in the foot itself) so you can now define your own format before you include classTextile.php in your project. Please look at the commit messages here and here for more details.

Getting the file...

If you do want to try it out and have an existing installation of PW or Textpattern which use textile then you can follow these steps to get the release candidate installed...

  1. Backup your existing classTextile.php file.
  2. Click here to access the new, raw, classTextile.php
  3. Save this over your existing file.
Edited by netcarver
  • Like 4
Link to comment
Share on other sites

Great! I will test this as soon as I can.

5: Support for linebreaks in table cells.

This would have been so useful to me some months ago...

Link to comment
Share on other sites

They say there are no dumb questions, only dumb answers, I hope I'm not about to break that rule...

@Steve, thanks for this, I love Textile.

I arrived here as I wanted to add some content with a definition list and it looks like native/not-too-hacked-about TinyMCE can't do this.

Here comes a possibly dumb question: can I use Textile formatting inside a normal TinyMCE textarea and hence get DLs?

Ah. Found the answer:

Please note

Don't use this in combination with other text formatters like Markdown. Don't use with TinyMCE (there would be no point). This module may be used with any version of ProcessWire: 2.0, 2.1 or 2.2+.

  • Like 1
Link to comment
Share on other sites

FWIW, I'm working on a new TLD home for textile now (at last!). I'm no designer, but I hope it will be useful to folks.

I like it!

The kernings from the logo need some love :)

Link to comment
Share on other sites

The kernings from the logo need some love :)

Yes, they sure do. Actually I'm trying to do this now with some spans in the h1 title. I can get it looking way better in FF or in Chromium -- but I'm having trouble getting it looking good in both. Is there any way to target different letter-spacings based on the browser?

Link to comment
Share on other sites

FWIW, I'm working on a new TLD home for textile now (at last!). I'm no designer, but I hope it will be useful to folks.

Excellent Steve!

I've not seen those .js's from diogo, I'll check them out. This http://fittextjs.com/ also may be an option, I've seen it mentioned a few times but not used it.

You could indeed use an image of course, it would cool to find a font that is well rendered across main browsers and ideally not need .js to do it, or do it with a .js helping hand if needed, rather than an image, just because real text is lovely when you're not forced to do image replacement.

Link to comment
Share on other sites

Thanks for all the replies folks.

I was hoping not to use an image -- but that's probably easier than spending hours trying to get the kerning looking good across different browsers, or learning a new set of JS. On balance I'll try an image covering the h1.

Link to comment
Share on other sites

The mere fact you're doing this Steve is commendable and excellent, so suggesting any extra effort seems churlish. So ignore this churlish-sounding suggestion! :D The one thing I'd say is, with CSS turned off (just plain browser and HTML), I assume the kerning is AOK, across browsers. If so then perhaps consider using an alternate font (assuming there's no other CSS or JS that is the cause). Some of the free fonts from Google are great (sorry, you likely know this and/or use them now), this site is a nice showcase http://hellohappy.or...tiful-web-type/.

Or use an image ;)

Link to comment
Share on other sites

In this case, I still think is more elegant an image than a bunch of spans in the markup. Even more elegant would be an SVG, but that's still not viable because of IE...

Link to comment
Share on other sites

In this case, I still think is more elegant an image than a bunch of spans in the markup. Even more elegant would be an SVG, but that's still not viable because of IE...

in IE it's VML. One would use the excellent raphaëljs library to do it cross-browser. http://raphaeljs.com/

Link to comment
Share on other sites

Soma, I don't think raphaël can fix SVG when used like this

<img src="logo.svg" />

(netcarver, sorry for the off topic conversation)

Plain like this, not of course. But you could convert (http://readysetraphael.com/ or Illustrator) the .svg to SVG text string and load that. Of course the overhead just for a logo would be immense.

An image, no need to get fancy with css and scripts. :)

Link to comment
Share on other sites

But you could convert (http://readysetraphael.com/ or Illustrator

Ok, good to know.

Is this any better?

Much better! But it still needs some spacing in the last half of the word. I'm seeing it like this: T-e-x-til-e... try to turn it into T-e-x-t-i-l-e instead. Sorry, with these things, Graphic Designers tend to get picky :)

Link to comment
Share on other sites

It's much better. Hope you had some fun playing the kerning game :)

edit: a good way of adjusting kerning is to semi close your eyes while looking at the word, and see if the white spaces are balanced.

Link to comment
Share on other sites

 Share

×
×
  • Create New...