Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-06-29 01:30:06

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: Textile & HTML5

Bloke wrote:

Does anybody have a handle on this from a standards perspective? I’d rather laminate my own head than wade through the W3C’s verbose documentation to find clues; perhaps somebody has already done a comparison somewhere that we can use as a baseline?

The link provided by ax above provides guidelines:
http://www.w3.org/TR/html-polyglot/

In short, as long as you don’t use Processing Instructions (pi’s), you’re good to go.

With some mods in Textile, I have Textpattern spit out valid HTML5 no problems.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#14 2010-06-29 11:58:00

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Textile & HTML5

phiw13 wrote:

Nope, tbody is implied in HTML 4. XHTML (as application/xhtml+xml) is ‘nother story.

Thanks Philippe — obviously I missed that bit of fine print. The element is required, just not the tags. Odd distinction.

Last edited by jsoo (2010-06-29 11:58:14)


Code is topiary

Offline

#15 2010-08-31 14:15:01

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Textile & HTML5

phiw13 schrieb:

OK, here is a patch with the mods I applied to classTextile.php.
This does two things:

  • replace <acronym> with <abbr>

In this german-discussing-thread we have replace <acronym> with <abbr> and a new line for using only <abbr> without title="title".
And we have deleting the line with <acronym>.

If you need, you can find there the code for IE 6, which can’t understand <abbr>.

I’ve add the for Textile-output <abbr> with a lowercase-sign (how: AbC(abbreviation-declaration) = <abbr title="abbreviation-declaration">AbC</abbr>). In the original-code Textile don’t output an <abbr>, if you have a lowercase-sign in the abbreviation. Textile will output only the text without the code <abbr> how <p>AbC(abbreviation-declaration)</p>.

Last edited by lythande (2010-08-31 14:23:25)

Offline

#16 2010-08-31 14:21:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Textile & HTML5

lythande wrote:

we have replace <acronym> with <abbr>

FYI it’s on the radar: note wet’s comment that we’re deferring any such changes to the next major release for backwards compatibility (and, as a side-effect, when HTML 5 is hopefully more mature).

Last edited by Bloke (2010-08-31 14:23:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2010-08-31 14:25:54

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Textile & HTML5

Bloke schrieb:

FYI it’s on the radar: note wet’s comment that we’re deferring any such changes to the next major release for backwards compatibility (and, as a side-effect, when HTML 5 is hopefully more mature).

Sorry, we need it today ;-)
And I’ve working today with this code, so I posting here ;-)

Offline

#18 2010-08-31 14:46:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Textile & HTML5

lythande wrote:

Sorry, we need it today ;-)

Sure, no worries. Just letting people know that if it’s not needed today, it’s being considered for future. BTW, you’ll need to re-mod this when 4.3.0 is released because Textile (the file classTextile.php) will be changing quite a bit.

Last edited by Bloke (2010-08-31 14:46:51)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2010-08-31 16:58:58

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Textile & HTML5

Bloke schrieb:

Sure, no worries. Just letting people know that if it’s not needed today, it’s being considered for future. BTW, you’ll need to re-mod this when 4.3.0 is released because Textile (the file classTextile.php) will be changing quite a bit.

Of course. I will be very happy to get a better Textile :)

Offline

#20 2011-01-23 00:59:47

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

Re: Textile & HTML5

Philippe

I’ve just written a textplug (a textile plugin) here that implements your patch and, although experimental (use it with classTextile.php from this branch), it appears to work very nicely. There is brief documentation here if you care to give it a try. If you do, copying the textplug from the gist into ‘textplugs-enabled’ is the easiest way.

Anyway, this leaves me wondering: is your patch still up-to-date with the HTML5 spec? If not, what would need changing?


Steve

Offline

#21 2011-01-27 00:45:30

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: Textile & HTML5

net-carver wrote:

I’ve just written a textplug (a textile plugin) here that implements your patch and, although experimental (use it with classTextile.php from this branch), it appears to work very nicely. There is brief documentation here if you care to give it a try. If you do, copying the textplug from the gist into ‘textplugs-enabled’ is the easiest way.

I’ll give it a try one when I have some more time.

Anyway, this leaves me wondering: is your patch still up-to-date with the HTML5 spec? If not, what would need changing?

Looking at the list of elements in your patch I would add figcaption (goes with figure) and nav (useful if someone writes long articles and includes an in-page set of links).
Anyway, sections 4.4 and 4.5 of the spec is what you need to keep and eye on.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#22 2011-01-27 02:21:50

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

Re: Textile & HTML5

Philippe

I would add figcaption (goes with figure) and nav (useful if someone writes long articles and includes an in-page set of links).

Done, thank you.


Steve

Offline

#23 2011-01-27 15:02:53

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Textile & HTML5

The issue here is: figcaption is a tag to be used in tandem (ie. nested inside) with figure. Thus, defining it as a Textile block tag won’t help.
But the situation is even “worst”: figcaption HTML element is a block tag too, that is, it can also hold other HTML block elements (like headings, paragraphs, whatever).

Of course, Textile is not to be blamed: Textile isn’t a full replacement for HTML, and real world HTML can get very complex, probably more complex than what Textile could ever handle.
My main concern is that current support for nesting Textile block tags (thus, in the output, nesting HTML block tags) is a bit limited. We have the double-dot (tag..) syntax, but it’s current usage is for avoiding Textile “terminating” a block tag in empty new lines, until it reaches another Textile block tag (tag.). Thus, it’s imposible to nest Textile block tags inside double-dotted block tags, because once you write a Textile block tag, you will be terminating/escaping from the double-dotted block tag.
That would make impossible to use the Textile block tag for many of the new HTML5 elements (mainly: section, hgroup, header, footer, figure, and a few others) which, in common usage, are just wrapping tags for other HTML block elements.

In that regard, there is some related ongoing discussion on Textile’s issues board

That being said, thankfully, netcarver’s finger tips are taking Textile to a new whole level, so I’ve hopes that some more advanced/complex HTML patterns would be eventually doable using a few Textile formulas :).
In that matter, the experimental feature for extending Textile’s via plugins opens a new world of possibilities for creating custom Textile code that fits your end-users needs. Don’t you think?

In the meanwhile, I thing figcaption should become an inline Textile tag, to be used inside figure block.
Not sure which syntax to suggest. Here is just a try:

figure. !imageurl! &the figcaption goes here.&

Last edited by maniqui (2011-01-27 15:06:37)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB