emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rick Frankel <rick@rickster.com>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [patch][ox-html] Support for level based containers
Date: Tue, 18 Mar 2014 11:05:25 -0400	[thread overview]
Message-ID: <730c32eb8242f98f62e0a79d4c188d34@mail.rickster.com> (raw)
In-Reply-To: <878us82ne3.fsf@gmx.us>

On 2014-03-17 23:31, Rasmus wrote:
> It's a variable that you can set in your project or in your Org file
> or in your init file.  I don't see why div × 3 is better than section
> article div or something else conditional on two variables being
> explicitly set to get fancy HTML5. . .  In any case, I don't have
> strong—if any—preferences on this.

Because using these tags is assigning semantic meaning which may or
may not be valid for the current document. Based on the spec, your use
of =section= seems ok (but could also be used for the other levels),
but your use of =article= is probably wrong in most cases. From
http://www.w3.org/html/wg/drafts/html/master/sections.html#the-article-element:

The article element represents a complete, or self-contained,
composition in a document, page, application, or site and that is,
in principle, independently distributable or reusable, e.g. in
syndication. This could be a forum post, a magazine or newspaper
article, a blog entry, a user-submitted comment, an interactive
widget or gadget, or any other independent item of content.

As to the =section= element, the from the above doc:

The section element represents a generic section of a document or
application. A section, in this context, is a thematic grouping of
content. The theme of each section should be identified, typically
by including a heading (h1-h6 element) as a child of the section
element.

and

A general rule is that the section element is appropriate only if
the element's contents would be listed explicitly in the
document's outline.

So, using this definition, in html5, the wrappers should be =sections=
to the same level as the toc heading level specified for the document,
and =divs= after.[1]

> org-html-text-markup-alist is nice.  What do you want to see in
> addition to the current structure (in patch v2)?
> 
> Somehow I never saw the original thread, only the email cc'ing me
> directly. I went to gmane to find the patch, and obviously grabbed the
> wrong one.
> 
> Could you please send me the (new) patch so that i can review it?
> 
> Here's the Gmane link.  I believe it's different than what you
> reviewed before, but perhaps I'm wrong. . .

No, i got the wrong patch from gmane. This one looks better modulo:

1. The default should stay the same as it is now -- the string "div"
2. Minor typo, but "backward comparability" should be "backwards
compatibility".

But, after reviewing the spec (see above vis. =section= and
=article=), i would submit that a better patch would be to
implement [1] above -- remove the defcustom (i only added to support
using a different default wrapper element in html5), and use =section=
and =div= based on toc level when html5-fancy is true. As far as i can
tell from the spec, =article= would almost never be correct for the
average org doc. Here's a relevant quote from the spec:

Authors are encouraged to use the article element instead of the
section element when it would make sense to syndicate the contents
of the element.

I think the best way to implement this would be letting the user
specify it with the =HTML_CONTAINER= property already implemented. As
this seems very much in keeping with the spec, i will implement this
change when i have some time in the next couple of weeks if i don't
hear any strong arguments against.

As an aside, the complex semantics of the new html5 tags is why we
have been slow in implementing them in ox-html. =div= is by
definition a non-semantic tag meant to be used for grouping and
styling, but the new tags have very specific meanings associated with
them and their mis-use is worse than their non-use.

rick

  reply	other threads:[~2014-03-18 15:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 23:18 [patch][ox-html] Support for level based containers Rasmus
2014-03-16 13:10 ` Nicolas Goaziou
2014-03-17  0:30   ` Rasmus
2014-03-17  2:15   ` Bastien
2014-03-17 17:31     ` Rick Frankel
2014-03-17 22:26       ` Rasmus
2014-03-18  0:33         ` Rick Frankel
2014-03-18  3:31           ` Rasmus
2014-03-18 15:05             ` Rick Frankel [this message]
2014-03-18 19:41               ` Rasmus
2014-03-19 14:24                 ` Rick Frankel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=730c32eb8242f98f62e0a79d4c188d34@mail.rickster.com \
    --to=rick@rickster.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).