Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-12 22:34:59

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

[textile] Textile v2.5.0 released

Hello folks,

I just pushed v2.5.0 of textile to the repository. Here’s the changelog if you are interested in what has happened in this version. But be warned: v2.5.0 is not a drop-in upgrade for the current version you have in your TxP installs. A lot changed behind the scenes and one of those changes will need a small adjustment on the TxP side to make the two work properly together again (and, yes, I have been in contact with gocom about this and he assures me it’s no big deal.)

Edit. updated outdated links -Gocom

Last edited by Gocom (2014-04-16 08:57:16)


Steve

Offline

#2 2012-12-12 23:43:14

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Textile v2.5.0 released

I’ve opened issue report 338 for tracking Textile 2.5’s integration to Textpattern, and started integration by adding a bare bone TextpatternTextile interface. This will be the class any Textpattern developer should use to interact with Textile in Textpattern.

I’ve run to some PHP warnings with Textile 2.5 tho. Will be reporting stuff shortly on GitHub.

Offline

#3 2012-12-13 00:00:22

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Textile v2.5.0 released

Just realized the warnings are because Textile uses error suppression as a ‘validation’ feature. Do we have any change of still getting file existence validation and such on 2.5.x? Might be asking too much tho.

I suspect that is one of the aspects you will be adding in new Textile 3 branch and dropping any suppression dependencies?

Last edited by Gocom (2012-12-13 00:05:39)

Offline

#4 2012-12-13 01:25:31

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Textile v2.5.0 released

Textile 2.5.0 is part of Textpattern 4.6.0-dev as of r5025.

To use Textile starting from 4.6.0-dev call Textpattern_Textile_Parser class instead of the old Textile. In addition to keeping b/c, Textpattern_Textile_Parser configures Textile for use in a Textpattern. In default configuration it picks your settings from Textpattern’s Preferences and uses those for forming the markup.

Using the class is as simple as ever:

$textile = new Textpattern_Textile_Parser();
return $textile->textileThis('Some *example* content.');

The above generates either HTML5 or XHTML based on Textpattern settings, but this default configuration can be overridden if needed. By default all optional arguments are set as NULL, but can be set to something else, including the doctype:

$textile = new Textpattern_Textile_Parser('xhtml');
return $textile->textileThis('Some *example* content.');

Would force a XHTML mode.

Edit. altered class name that was changed in r5035.

Last edited by Gocom (2012-12-13 13:45:58)

Offline

#5 2012-12-13 06:57:34

chipotle
New Member
Registered: 2012-12-06
Posts: 3

Re: [textile] Textile v2.5.0 released

Quick question. I know there was talk somewhere ‘round these parts about adding the ability to handle HTML5’s new block elements in a Textile-ish fashion, i.e., something like

aside. This is something snarky in the sidebar

This doesn’t look like it’s landed as part of Textile 2.5.0; are there thoughts of building this in? Or is there a Textile plugin system that would do this? I’d prefer to be able to use aside and aside(class) than use p(class) for article sidebars if I can manage it. (I suspect what I’m working on might not launch until TXP 4.6 has an official release, at least assuming that happens within the next few months.)

Offline

#6 2012-12-13 11:17:26

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile v2.5.0 released

@Gocom

Looks good. :)

@Chipotle

HTML5 block elements are not part of the v2.5.0 release. If you want to extend a local copy with the aside element (and other block level elements) you should be able to do it by extending the unrestricted mode btag array…

$this->btag = array('bq', 'p', 'bc', 'notextile', 'pre', 'h[1-6]', 'fn\d+', '###', 'aside');

…and adding it to the hasRawText() method…

$r = trim(preg_replace('@<(p|blockquote|div|form|table|ul|ol|dl|pre|aside|h\d)[^>]*?'.chr(62).'.*</\1>@s', '', trim($text)));

I will be doing some more work soon on a plugin system (which I’m calling textplugs) for the 2.6 release of textile. After that I’ll be looking at extending the HTML5 support (amongst other things.)


Steve

Offline

#7 2012-12-13 13:49:00

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Textile v2.5.0 released

r5035 changes the wrapper class name from ‘TextpatternTextile’ to ‘Textpattern_Textile_Parser’. This is to allow the use of the new PSR-0 autoloader introduced in r5032.

Offline

#8 2012-12-13 18:01:16

chipotle
New Member
Registered: 2012-12-06
Posts: 3

Re: [textile] Textile v2.5.0 released

@net-carver: Thanks. I noticed those functions in a quick scan of the code and thought they looked suspiciously like Where Block Elements Should Go. I admit that in the intervening years since I last used Textpattern I have become a big fan of Markdown—IIRC, I even replaced Textile with Markdown in my TXP installation way back then after running into an issue with the way Textile handled em dashes—so it’s been interesting relearning it. (The issue was that that phrase that’s set off with em dashes in that last sentence would have been struck out!)

It’s also neat that it sounds like Textpattern is moving toward PSR compliance.

Offline

#9 2012-12-22 11:08:04

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] Textile v2.5.0 released

steve, did you added this fix into new release?

Offline

#10 2012-12-23 12:32:59

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile v2.5.0 released

@Gallex

No, it isn’t in v2.5.0 but I’ve raised issue #97 on the issue-tracker so it should stay on my radar now.


Steve

Offline

#11 2013-01-01 19:18:13

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile v2.5.0 released

@Gallex

Done in v2.5.1


Steve

Offline

#12 2013-01-02 21:54:04

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: [textile] Textile v2.5.0 released

With Textile 2.5.0 and 2.5.1, I get the section titles wrapped in <p> ... </p> tags when a new section is created with the Textpattern’s admin interface. These <p> ... </p> tags are then stored in the section title field of the mysql database and are visibel in the Section tab. Consequently, writing <txp:section title="1" /> would output something like:

&lt;p&gt;Section Title&lt;/p&gt;

or

<p>Section Title</p>

when not parsed with Textile. After changing back to the classTextile.php file that comes with Textpattern 4.5.4, normal behavior with creating sections is resumed.

Edit: Made it more clear that the problem is the generation of unwanted <p> ... </p> tags with the new version of Textile.

Last edited by ax (2013-01-03 00:27:13)

Offline

Board footer

Powered by FluxBB