Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-04-05 10:38:20

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

[textile] section/header complexes

As much as I love Textile, I’m increasingly wanting/needing to use nested HTML 5 elements in articles because there is no way to replicate the same semantical structures with Textile, which is not only unfortunate, but maybe inhibiting authors/editors from doing more with their articles than they may otherwise like to do if it wasn’t so bulky and tedious to do it in the body field. After all, Textile was created to alleviate that process; getting markup out of the way and make it easy to read/write text.

One example we’ve talked about before is the figure complex, which is commonly used now:

<figure>
  <img>
  <figcaption> ... </figcaption>
</figure>

And for those there has been an smd_macro solution, if I recall, though that currently has problems due to the cores current defined use for the caption field in the Images panel. In any case, there’s no Textile way to achieve it either, and I believe Steve has tried in the past.

Another example, just as commonly used in web documents, is an hgroup complex, for example:

<header>
  <hgroup>
    <h1>The H1 string</h1>
    <h2>The H2 string</h2>
  </hgroup>
</header>

But that’s a lot of tags. While it’s easy enough to copy paste them each time and change the needed Hn values and text strings, as needed, it would be nice if Textile could make it look a little better.

It’s probably impossible, but what about something like this:

hgroup\1,2\. The H1 text  | The H2 text

The “hgroup” provides this structure:

<header>
  <hgroup>

  </hgroup>
</header>

And the “\1,2\” defines the two header types to add:

<hgroup>
    <h1>The H1 string</h1>
    <h2>The H2 string</h2>
  </hgroup>

The text strings are separated by a pipe, and parsed into place when rendered, in theory.

Ideally you could define three headers if you wanted too:
hgroup\1,2\3\. The H1 text  | The H2 text | The H3 text
...
<header>
  <hgroup>
    <h1>The H1 string</h1>
    <h2>The H2 string</h2>
    <h3>The H3 string</h3>
  </hgroup>
</header>

Or start the headers at a different level:

hgroup\2\3\. The H2 text  | The H3 text
...
<header>
  <hgroup>
    <h2>The H2 string</h2>
    <h3>The H3 string</h3>
  </hgroup>
</header>

Food for thought.

Last edited by Destry (2015-04-05 11:02:59)

Offline

#2 2015-04-05 10:43:43

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] section/header complexes

Whoops, looks like hgroup was dropped? Ha! I didn’t know that.

Offline

#3 2015-04-05 11:01:06

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] section/header complexes

Reframing the situation to current times, imagine you have a web document (e.g., an ePub, not a web page template) that is composed of sections (think chapters) having their own main heading and subtitle heading (similar to a title/subtitle).

Whether it’s better to use a section or a header, I don’t know, but the same theory could be applied for the Textile problem, right?

So we might have:

section\1,2\. The H1 text | The H2 text
...
header\1,2\. The H1 text | The H2 text

Make sense?

For those like me who need it (because the W3C Working Group pubs are so numerous and hard to keep track of), there is this pubs charter. The current “recommended draft” is the October 2014 pub. And here are the associated flow elements.

Last edited by Destry (2015-04-05 11:16:53)

Offline

Board footer

Powered by FluxBB