From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch][ox-html] Support for level based containers Date: Tue, 18 Mar 2014 20:41:07 +0100 Message-ID: <87a9cns3ak.fsf@gmx.us> References: <87ha6z3vbi.fsf@gmx.us> <87vbveqofg.fsf@gmail.com> <87iordk1t5.fsf@bzg.ath.cx> <20140317173158.GB75979@eyeBook> <87d2hk31ij.fsf@gmx.us> <20140318003339.GA92601@eyeBook> <878us82ne3.fsf@gmx.us> <730c32eb8242f98f62e0a79d4c188d34@mail.rickster.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPzt0-0002dl-SL for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 15:41:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPzsu-0007Y3-IY for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 15:41:18 -0400 Received: from mout.gmx.net ([212.227.17.20]:52308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPzsu-0007Xy-89 for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 15:41:12 -0400 In-Reply-To: <730c32eb8242f98f62e0a79d4c188d34@mail.rickster.com> (Rick Frankel's message of "Tue, 18 Mar 2014 11:05:25 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: rick@rickster.com Cc: emacs-orgmode@gnu.org Rick, Rick Frankel writes: > 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 =C3=97 3 is better than secti= on >> article div or something else conditional on two variables being >> explicitly set to get fancy HTML5. . . In any case, I don't have >> strong=E2=80=94if any=E2=80=94preferences 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 =3Dsection=3D seems ok (but could also be used for the other levels), > but your use of =3Darticle=3D is probably wrong in most cases. From > http://www.w3.org/html/wg/drafts/html/master/sections.html#the-article-el= ement: > > 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. OK. Thanks for your through clarification.=20=20 > As to the =3Dsection=3D 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. This happens with the patch (as is does with divs ATM). > 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 =3Dsections=3D > to the same level as the toc heading level specified for the document, > and =3Ddivs=3D after.[1] So you want it to be section until h:N? That should be easy. >> 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" As you prefer. > 2. Minor typo, but "backward comparability" should be "backwards > compatibility". Thanks. > But, after reviewing the spec (see above vis. =3Dsection=3D and > =3Darticle=3D), 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 =3Dsection=3D > and =3Ddiv=3D based on toc level when html5-fancy is true. As far as i can > tell from the spec, =3Darticle=3D would almost never be correct for the > average org doc. Here's a relevant quote from the spec: OK. That certainly makes it easier. But should it not then be a cons or an alist specifying which container to use when the headline level is above or below h:N and deepening on whether html5-fancy is used? > 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. So blogs, technical docs and similar? I can see people using Org such things? Or do W3-people thinkg of something different when they say it is "syndicatable" > I think the best way to implement this would be letting the user > specify it with the =3DHTML_CONTAINER=3D 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. I can change my patch to this behavior if you want. Though I think it's pretty strong to hardcode values, as one would might have reasons to change it in say an ox-publish project. > As an aside, the complex semantics of the new html5 tags is why we > have been slow in implementing them in ox-html. =3Ddiv=3D 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. Good point. Thanks again Rick. =E2=80=94Rasmus --=20 Governments should be afraid of their people