Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-01-28 11:53:36

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Preference toggle for XHTML/HTML

Since html5 is quite popular now, and we need to keep backwards compatibility with XHTML for existing sites. Maybe a preference toggle to select either output would be the answer. Things like self closing tags can stay as they are still valid in both, so I don’t think there would be too much work involved.

Offline

#2 2012-01-28 14:04:03

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

Re: Preference toggle for XHTML/HTML

philwareham wrote:

Maybe a preference toggle to select either output would be the answer.

Txp itself isn’t such a big task (errr, I don’t think — taghandlers would need combing, as would the tag builder). I reckon the big hurdle is Textile. It’s fairly simple to patch to choose a system at new Textile() instantiation time — and that could then be filtered back to a Txp preference ready to pass in. I’ve demonstrated this is feasible (this week, as it happens). But it’d only be a short-term solution.

I have it on good authority that, longer term, Textile is undergoing some radical changes to help separate the input from output so other modules can be plugged into it, as well as allow plugins to interact with it (I suppose one such ‘plugin’ might well be Txp itself, but I really don’t know the specifics yet so I might be talking rubbish).

Since the Textile project has been spun away from Txp development, and other people are putting ideas into the melting pot for the various ports, it’s really starting to take off. I’d say this is where the focus should be for anyone wanting to get involved.

As far as Txp is concerned, off the top of my head I’m not sure which bits need changing. If self-closing tags and quoted attributes are staying, what needs attention to bring it inline? acronym/abbr? (does the core use that anywhere or it just Textile?) Some of the meta tags? And the rel attribute, maybe? Anyboody have a handle on which bits/tags are not up to spec? That might give us an indication of how big the job is.


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

#3 2012-01-28 15:22:16

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Preference toggle for XHTML/HTML

I’ll have a comb through the code next week and let you know. I also think the remaining inline CSS should be removed.

Offline

#4 2012-01-28 15:44:08

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

Re: Preference toggle for XHTML/HTML

philwareham wrote:

I’ll have a comb through the code next week and let you know. I also think the remaining inline CSS should be removed.

Thanks. And [OT] yeah, inline CSS is long overdue for killing. It’s an enhamperment(?) for plugins too who want to use the core functions and find they come saddled with unwanted style elements (though there are not many left now, thank goodness).

The worst offenders are the /include/txp_* files. Of those, only article, auth, category, css, form, page, and section are clear of inline wrangling. That leaves 12 files that need attention and some decent, general-purpose style rules making. I think the remainder are just in txplib_head.php, txplib_html.php, and txplib_misc.php.

It was beyond my CSS knowledge to do it properly in 4.3.0. Maybe now’s a good time to pool resources and get it out of the interface for good?

Last edited by Bloke (2012-01-30 12:25:01)


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

#5 2012-01-28 15:57:40

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Preference toggle for XHTML/HTML

I can get on that, but how do I pull request code back to the SVN on google code?

Offline

#6 2012-01-28 16:01:22

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

Re: Preference toggle for XHTML/HTML

philwareham wrote:

I can get on that, but how do I pull request code back to the SVN on google code?

*shrug* never done it. Can SVN even do that? Might have to be a classic patch .diff submission?


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

#7 2012-01-30 07:55:50

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Preference toggle for XHTML/HTML

I’ve created issue 132 to track this request.

Offline

#8 2012-01-30 09:08:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Preference toggle for XHTML/HTML

wet wrote:

I’ve created issue 132 to track this request.

this is cool news.

What happens to large(ish) sites whose owners wish to migrate to html5? will there be a script to help with the migration of existing articles? I am thinking of deprecated tags such as acronym but also the closing slash of line breaks.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2012-01-30 09:16:19

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Preference toggle for XHTML/HTML

colak wrote:

will there be a script to help with the migration of existing articles?

Like this?

… the closing slash of line breaks.

<br /> is valid HTML5.

Last edited by wet (2012-01-30 09:16:46)

Offline

#10 2012-01-30 12:12:22

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Preference toggle for XHTML/HTML

Bloke wrote:

The worst offenders are the /include/txp_* files.

I believe none of those renders any output to the public side, and as I don’t think we want the backend to become a HTML5 document, do we?

Offline

#11 2012-01-30 12:24:17

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

Re: Preference toggle for XHTML/HTML

wet wrote:

I believe none of those renders any output to the public side, and as I don’t think we want the backend to become a HTML5 document, do we?

Sorry, the comment was in response to Phil’s comment about inline CSS, not the XHTML/HTML5 pref. Probably should be a separate topic instead of hijacking this one.

Last edited by Bloke (2012-01-30 12:25:46)


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

#12 2012-01-30 16:59:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Preference toggle for XHTML/HTML

wet wrote:

Like this?

yes:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB