From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Fran=C3=A7ois_Pinard?= Subject: Attributes on HTML tables? Date: Sat, 06 Apr 2013 22:55:25 -0400 Message-ID: <86bo9rnj6q.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOflU-0006mp-4j for emacs-orgmode@gnu.org; Sat, 06 Apr 2013 22:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOflP-0000kU-1A for emacs-orgmode@gnu.org; Sat, 06 Apr 2013 22:55:32 -0400 Received: from 206-248-137-202.dsl.teksavvy.com ([206.248.137.202]:64470 helo=mercure.bureau.ubity.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOflO-0000kK-RQ for emacs-orgmode@gnu.org; Sat, 06 Apr 2013 22:55:26 -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: emacs-orgmode@gnu.org Hi, Org people. I took a few hours today to move the Org generation for a few of my Web pages to the new exporter, and after a bit of debugging to understand how some changes were meant, got the impression that it mainly works! I'll have to wander around when I'll find some more free time, looking at the generated pages, to check that everything is OK. There is one little thing that does not seem to work, but I do not remember if it worked with the old exporter. The Org manual says: 12.5.5 Tables ------------- =20=20=20 Org mode tables are exported to HTML using the table tag defined in `org-html-table-tag'. The default setting makes tables without cell borders and frame. If you would like to change this for individual tables, place something like the following before the table: =20=20=20 #+CAPTION: This is a table with lines around and between cells #+ATTR_HTML: border=3D"2" rules=3D"all" frame=3D"border" Captions work indeed, but I do not see that attributes are transported on the generated element. It seems to be always produced with the exact value of org-html-table-tag. Fran=C3=A7ois From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Attributes on HTML tables? Date: Sun, 07 Apr 2013 08:27:13 +0200 Message-ID: <87ppy66eke.fsf@bzg.ath.cx> References: <86bo9rnj6q.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOj4R-0008Um-BH for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 02:27:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOj4N-0002WZ-FC for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 02:27:19 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:64834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOj4N-0002WU-9B for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 02:27:15 -0400 Received: by mail-wg0-f45.google.com with SMTP id x12so4815769wgg.0 for ; Sat, 06 Apr 2013 23:27:14 -0700 (PDT) In-Reply-To: <86bo9rnj6q.fsf@iro.umontreal.ca> (=?iso-8859-1?Q?=22Fran=E7o?= =?iso-8859-1?Q?is?= Pinard"'s message of "Sat, 06 Apr 2013 22:55: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: =?iso-8859-1?Q?Fran=E7ois?= Pinard Cc: emacs-orgmode@gnu.org Hi François, François Pinard writes: > #+CAPTION: This is a table with lines around and between cells > #+ATTR_HTML: border="2" rules="all" frame="border" You need to use :options now: #+CAPTION: This is a table with lines around and between cells #+ATTR_HTML: :options border="2" rules="all" frame="border" We are in the process of documenting this. -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Sun, 07 Apr 2013 16:42:04 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOqlR-0006SB-Tb for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 10:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOqlJ-0002Zk-CH for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 10:40:13 -0400 In-reply-to: <87ppy66eke.fsf@bzg.ath.cx> 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: Bastien Cc: =?utf-8?Q?Fran=C3=A7ois_Pinard?= , emacs-orgmode@gnu.org Bastien writes: > You need to use :options now: > > #+CAPTION: This is a table with lines around and between cells > #+ATTR_HTML: :options border="2" rules="all" frame="border" Oddly, this doesn't work for me at the moment. I'm running release_8.0-pre-344-g882454, pulled this morning. (It /could/ be just me; I seem to have some unresolved installation issues.) When I export, both the defaults /and/ the "options" are applied, resulting in duplicated attributes, like this:
and on Firefox, at least, the values defined the second time are ignored. The documentation currently up on Worg (http://orgmode.org/worg/org-8.0.html#sec-8-3), which seems to say we should now use plists for HTML attributes. But that currently doesn't work for me either. Sorry if you've heard this before, but this doesn't make sense to me as a new syntax: #+ATTR_HTML: :options attribute="value" It's not just more verbose than the old way, it's redundant to say both "attr" and "options", since all it does is set attributes. Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Attributes on HTML tables? Date: Sun, 07 Apr 2013 20:46:29 +0200 Message-ID: <878v4uxjp6.fsf@gmail.com> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOubx-0007fi-7c for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 14:46:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOubr-0000n5-2W for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 14:46:41 -0400 In-Reply-To: (Christian Moe's message of "Sun, 07 Apr 2013 16:42:04 +0200") 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: Christian Moe Cc: Bastien , =?utf-8?Q?Fran=C3=A7ois?= Pinard , emacs-orgmode@gnu.org Hello, Christian Moe writes: > Bastien writes: >> You need to use :options now: >> >> #+CAPTION: This is a table with lines around and between cells >> #+ATTR_HTML: :options border="2" rules="all" frame="border" > > Oddly, this doesn't work for me at the moment. I'm running > release_8.0-pre-344-g882454, pulled this morning. (It /could/ be just > me; I seem to have some unresolved installation issues.) > > When I export, both the defaults /and/ the "options" are applied, > resulting in duplicated attributes, like this: > >
frame="hsides" border="2" rules="all" frame="border"> This is a bug. > The documentation currently up on Worg > (http://orgmode.org/worg/org-8.0.html#sec-8-3), which seems to say we > should now use plists for HTML attributes. But that currently doesn't > work for me either. > > Sorry if you've heard this before, but this doesn't make sense to me as > a new syntax: > > #+ATTR_HTML: :options attribute="value" > > It's not just more verbose than the old way, it's redundant to say both > "attr" and "options", since all it does is set attributes. Actually, that's not the spirit. The idea is to define some widely used attributes that will be written directly like: #+attr_html: :border 0 :width 400 Then, :options attribute is used as a bucket for every other attribute, since we cannot support all of them. Unfortunately, no attribute is current recognized in table HTML transcoder. It needs to be improved. If Someone provides a list of such attributes, I can implement it. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Attributes on HTML tables? Date: Sun, 07 Apr 2013 22:48:48 +0200 Message-ID: <87mwtavzgv.fsf@gmail.com> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOwWE-0005CG-4M for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 16:48:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOwWD-0008KZ-Ay for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 16:48:54 -0400 In-Reply-To: (Christian Moe's message of "Sun, 07 Apr 2013 22:39:28 +0200") 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: Christian Moe Cc: Bastien , =?utf-8?Q?Fran=C3=A7ois?= Pinard , emacs-orgmode@gnu.org Christian Moe writes: > But what is it that nees to be supported, and why couldn't you just pass > through *whatever* :attribute value pair the user puts in attr_html? Does every possible attribute follow attribute="value" pattern? Aren't there single keywords? If they are that regular, we can indeed walk the plist like a list and change (:key1 val1 :key2 val2 ...) into key1="val1" key2="val2" If there are irregular keywords, the export back-end needs to know about them. Also, if attributes are provided, I assume defaults should be ignored altogether. Or do we need to create the union between default values and provided attributes? Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Sun, 07 Apr 2013 22:39:28 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOwLD-0002yu-Jj for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 16:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOwLA-0004qu-HI for emacs-orgmode@gnu.org; Sun, 07 Apr 2013 16:37:31 -0400 In-reply-to: <878v4uxjp6.fsf@gmail.com> 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: Nicolas Goaziou Cc: Bastien , =?utf-8?Q?Fran=C3=A7ois_Pinard?= , emacs-orgmode@gnu.org Nicolas Goaziou writes: >> When I export, both the defaults /and/ the "options" are applied, >> resulting in duplicated attributes, like this: >> >>
> frame="hsides" border="2" rules="all" frame="border"> > > This is a bug. Ah, good (from my perspective, anyway, I was getting concerned about my setup). > The idea is to define some widely used > attributes that will be written directly like: > > #+attr_html: :border 0 :width 400 > > Then, :options attribute is used as a bucket for every other attribute, > since we cannot support all of them. I'm sorry, you've probably explained this many times before and I should go read the archives. But what is it that nees to be supported, and why couldn't you just pass through *whatever* :attribute value pair the user puts in attr_html? I really like the switch to plist style, but I think the combination with :options and literal syntax is confusing. > Unfortunately, no attribute is current recognized in table HTML > transcoder. It needs to be improved. > > If Someone provides a list of such attributes, I can implement it. I'd be happy to, but I need to understand the above. On what basis should attributes be selected for either plist style or the :options bucket, and what does the exporter need to know about them in order to support them? Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Mon, 08 Apr 2013 23:09:09 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPJHW-0002V2-RO for emacs-orgmode@gnu.org; Mon, 08 Apr 2013 17:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPJHO-000476-Fg for emacs-orgmode@gnu.org; Mon, 08 Apr 2013 17:07:14 -0400 In-reply-to: <87mwtavzgv.fsf@gmail.com> 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: Nicolas Goaziou Cc: Bastien , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Does every possible attribute follow attribute="value" pattern? Aren't > there single keywords? In XHTML it does, and there aren't. In HTML you can use some "minimized" attributes, but in XHTML they have their own names as values, e.g. nowrap="nowrap". > If they are that regular, we can indeed walk the > plist like a list and change > > (:key1 val1 :key2 val2 ...) > > into > > key1="val1" key2="val2" ...and let the user worry about getting them right. That's my suggestion, FWIW. > If there are irregular keywords, the export back-end needs to know about > them. XML doesn't do `irregular'. :) XHTML is also fussy about quoting attribute values, and about escaping special characters as HTML entities, including the ampersand (&), and including inside attribute values. I'm guessing the exporter already does the right thing here. Since values may legitimately contain double quotes, one thing the back-end *does* need to know about is to put those in single quotes: :title This is a "pop-up" text title='This is a "pop-up" text' > Also, if attributes are provided, I assume defaults should be ignored > altogether. Or do we need to create the union between default values and > provided attributes? If I understand the question correctly, I think the union is the correct answer, with provided attributes overwriting defaults for the same attributes. In the example we started with, the defaults would create
If the user specifies #+attr_html: :border 2 :rules all :frame border :title My table I would expect the result
You may want a second opinion on all this -- I'm no (X)HTML guru and I've never written an exporter. But it seems to me the pure plist form would less confusing to the user than a split syntax, and easier to maintain, as well. Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Fran=C3=A7ois_Pinard?= Subject: Re: Attributes on HTML tables? Date: Wed, 10 Apr 2013 13:44:06 -0400 Message-ID: <86fvyy1dsp.fsf@iro.umontreal.ca> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPz49-00088n-NE for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 13:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPz48-0004Gj-Bu for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 13:44:13 -0400 Received: from bureau.ubity.com ([64.254.249.42]:35889 helo=mercure.bureau.ubity.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPz48-0004E6-7j for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 13:44:12 -0400 In-Reply-To: (Christian Moe's message of "Mon, 08 Apr 2013 23:09:09 +0200") 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: emacs-orgmode@gnu.org Christian Moe writes: > XHTML is also fussy about quoting attribute values, and about escaping > special characters as HTML entities, including the ampersand (&), and > including inside attribute values. I'm guessing the exporter already > does the right thing here. Org can of course take care of XTHML fussiness, there is likely no problem there. While on this subject! :-) Could Org allow the output of HTML5 rather than XHTML, under the control of some option? I've read that some frameworks really expect HTML5 to work properly, such an option might ease inter-operation between exported Org and such frameworks. Fran=C3=A7ois From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Attributes on HTML tables? Date: Wed, 10 Apr 2013 21:37:59 +0200 Message-ID: <87haje41ns.fsf@gmail.com> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ0qM-0007w5-5e for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 15:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ0qK-0000De-FL for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 15:38:06 -0400 In-Reply-To: (Christian Moe's message of "Mon, 08 Apr 2013 23:09:09 +0200") 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: Christian Moe Cc: Bastien , emacs-orgmode@gnu.org Hello, Christian Moe writes: > If I understand the question correctly, I think the union is the correct > answer, with provided attributes overwriting defaults for the same > attributes. > > In the example we started with, the defaults would create > >
frame="hsides"> > > If the user specifies > > #+attr_html: :border 2 :rules all :frame border :title My table > > I would expect the result > >
frame="border" title="My table"> Thank you for all the information. I have pushed a patch along these lines. Caveat: `org-html-table-tag' is now named `org-html-table-default-attributes' and expect a plist as its value. Also, a nil value will remove the property from the attributes. Could you test it and confirm this is now behaving in a desirable way? Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Thu, 11 Apr 2013 10:28:17 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <87haje41ns.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQCpb-0004V4-Di for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 04:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQCpa-0003zv-7w for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 04:26:07 -0400 In-reply-to: <87haje41ns.fsf@gmail.com> 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: Nicolas Goaziou Cc: Bastien , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Caveat: `org-html-table-tag' is now named > `org-html-table-default-attributes' and expect a plist as its value. > Also, a nil value will remove the property from the attributes. > > Could you test it and confirm this is now behaving in a desirable way? Hi, I've run some tests and confirm it works as I'd like it to. Thanks, I really like this and I hope others like the plist syntax as well. Late thought, sorry: If we can have this plist syntax as a general rule, perhaps we should nevertheless keep the :options tag just as a fallback, to ease the transition for users with a lot of legacy attr_html lines? It's easier and less catastrophe-prone to do a quick search/replace from : ^#\+attr_html: to : #+attr_html: :options than it is to automatically replace verbatim attribute code with plists, especially if there are all sorts of html irregularities in there. Yours, Christian PS. Though if everything is nice and conforming to xhtml, one should be able to batch convert files from verbatim html attributes to plist syntax with something like the following -- USE AT OWN RISK, NO WARRANTY IMPLIED: : perl -i.bak -pe 's/([a-z]+)=([\"\'])(.*?)\2/:\1 \2/g if /^#\+attr_html/i' *.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Attributes on HTML tables? Date: Thu, 11 Apr 2013 12:55:10 +0200 Message-ID: <87hajds5f5.fsf@gmail.com> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <87haje41ns.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQFA9-0005kv-8J for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 06:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQF9w-0002hI-5a for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 06:55:29 -0400 In-Reply-To: (Christian Moe's message of "Thu, 11 Apr 2013 10:28:17 +0200") 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: Christian Moe Cc: Bastien , emacs-orgmode@gnu.org Hello, Christian Moe writes: > Nicolas Goaziou writes: >> Caveat: `org-html-table-tag' is now named >> `org-html-table-default-attributes' and expect a plist as its value. >> Also, a nil value will remove the property from the attributes. >> >> Could you test it and confirm this is now behaving in a desirable way? > > I've run some tests and confirm it works as I'd like it to. Thanks, I > really like this and I hope others like the plist syntax as well. Great. Thank you again. > Late thought, sorry: If we can have this plist syntax as a general rule, > perhaps we should nevertheless keep the :options tag just as a fallback, > to ease the transition for users with a lot of legacy attr_html lines? > It's easier and less catastrophe-prone to do a quick search/replace from > > : ^#\+attr_html: > > to > > : #+attr_html: :options > > than it is to automatically replace verbatim attribute code with plists, > especially if there are all sorts of html irregularities in there. I prefer not to mix the two methods as it would be fragile (e.g. what happens if an attribute is defined both outside and inside the :options keyword?). > PS. Though if everything is nice and conforming to xhtml, one should be > able to batch convert files from verbatim html attributes to plist syntax with > something like the following -- USE AT OWN RISK, NO WARRANTY IMPLIED: > > : perl -i.bak -pe 's/([a-z]+)=([\"\'])(.*?)\2/:\1 \2/g if /^#\+attr_html/i' *.org Would you mind adding it to Worg section about the migration to Org 8.0? It would be quite useful. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Thu, 11 Apr 2013 14:14:33 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <87haje41ns.fsf@gmail.com> <87hajds5f5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQGMb-0006VU-9l for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 08:12:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQGMW-0003uP-Hy for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 08:12:25 -0400 In-reply-to: <87hajds5f5.fsf@gmail.com> 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: Nicolas Goaziou Cc: Bastien , emacs-orgmode@gnu.org Nicolas Goaziou writes: > I prefer not to mix the two methods as it would be fragile (e.g. what > happens if an attribute is defined both outside and inside the :options > keyword?). Perhaps not much. As I reported (the reason :options wasn't working), in Firefox the second definition of the attribute is simply quietly ignored. But if you prefer to keep it clean, I'm fine with that. >> to batch convert files from verbatim html attributes to plist syntax with >> something like the following -- USE AT OWN RISK, NO WARRANTY IMPLIED: >> >> : perl -i.bak -pe 's/([a-z]+)=([\"\'])(.*?)\2/:\1 \2/g if >> /^#\+attr_html/i' *.org Oops, in that message I accidentally copy-pasted a WRONG version. Hopefully didn't work at all, or it would mess things up. Sorry. This seems to work well: : perl -i.bak -pe "s/([a-z]+)=(\"|')(.*?)\2/:\1 \3/g if /^#\+attr_html/i" filename.org > Would you mind adding it to Worg section about the migration to > Org 8.0? It would be quite useful. Will do. Yours, Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Attributes on HTML tables? Date: Thu, 11 Apr 2013 17:34:12 +0200 Message-ID: <87bo9lrsi3.fsf@bzg.ath.cx> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <87haje41ns.fsf@gmail.com> <87hajds5f5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQJVx-0004p4-S9 for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 11:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQJVt-00072Y-AB for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 11:34:17 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:37979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQJVt-00072R-4M for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 11:34:13 -0400 Received: by mail-wi0-f178.google.com with SMTP id ez12so693763wid.11 for ; Thu, 11 Apr 2013 08:34:12 -0700 (PDT) In-Reply-To: <87hajds5f5.fsf@gmail.com> (Nicolas Goaziou's message of "Thu, 11 Apr 2013 12:55:10 +0200") 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Christian Moe Hi, Nicolas Goaziou writes: >> than it is to automatically replace verbatim attribute code with plists, >> especially if there are all sorts of html irregularities in there. > > I prefer not to mix the two methods as it would be fragile (e.g. what > happens if an attribute is defined both outside and inside the :options > keyword?). Sorry, catching up in this thread -- my understanding was that :options was *always* available as a fallback, even with other attributes set before it. Am I wrong? If an attribute is both outside and inside the :options keywords, the outside version should take over. -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Attributes on HTML tables? Date: Thu, 11 Apr 2013 19:29:37 +0200 Message-ID: <87vc7tq8la.fsf@gmail.com> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <87haje41ns.fsf@gmail.com> <87hajds5f5.fsf@gmail.com> <87bo9lrsi3.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQLJh-00071i-F0 for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 13:29:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQLJg-0006EX-1q for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 13:29:45 -0400 In-Reply-To: <87bo9lrsi3.fsf@bzg.ath.cx> (Bastien's message of "Thu, 11 Apr 2013 17:34:12 +0200") 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: Bastien Cc: emacs-orgmode@gnu.org, Christian Moe Hello, Bastien writes: > Nicolas Goaziou writes: > >>> than it is to automatically replace verbatim attribute code with plists, >>> especially if there are all sorts of html irregularities in there. >> >> I prefer not to mix the two methods as it would be fragile (e.g. what >> happens if an attribute is defined both outside and inside the :options >> keyword?). > > Sorry, catching up in this thread -- my understanding was that > :options was *always* available as a fallback, even with other > attributes set before it. Am I wrong? :options is more or less required in LaTeX export. Other keywords may go in different locations (optional arguments, mandatory arguments) so the back-end has to understand the keywords provided. It also means there will always be keywords it won't understand (i.e. which are not hardcoded). The :options bucket is a good place for them. On the other hand, I think we don't need it in HTML export. All attributes go in the same place, so the backend just transforms the plist into a string. Since it doesn't need to know about what it transforms, the bucket becomes useless, maybe confusing. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Attributes on HTML tables? Date: Fri, 12 Apr 2013 10:06:21 +0800 Message-ID: <87ehegtsde.fsf@ericabrahamsen.net> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQTHu-0002K4-Fq for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQTHt-0000d0-BZ for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:00:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:40326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQTHt-0000cu-5E for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 22:00:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQTHs-0000Ho-09 for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 04:00:24 +0200 Received: from 114.250.106.12 ([114.250.106.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 04:00:23 +0200 Received: from eric by 114.250.106.12 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 04:00:23 +0200 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: emacs-orgmode@gnu.org François Pinard writes: > Christian Moe writes: > >> XHTML is also fussy about quoting attribute values, and about escaping >> special characters as HTML entities, including the ampersand (&), and >> including inside attribute values. I'm guessing the exporter already >> does the right thing here. > > Org can of course take care of XTHML fussiness, there is likely no > problem there. > > While on this subject! :-) > > Could Org allow the output of HTML5 rather than XHTML, under the control > of some option? I've read that some frameworks really expect HTML5 to > work properly, such an option might ease inter-operation between > exported Org and such frameworks. I'm curious about this possibility as well -- how much work would it be? E From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Attributes on HTML tables? Date: Fri, 12 Apr 2013 07:42:25 +0200 Message-ID: <87a9p4e24e.fsf@bzg.ath.cx> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQWkm-0003Oz-Dg for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:42:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQWkl-0004oZ-D6 for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:42:28 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:63061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQWkl-0004oO-7z for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:42:27 -0400 Received: by mail-wi0-f180.google.com with SMTP id c10so1224106wiw.7 for ; Thu, 11 Apr 2013 22:42:26 -0700 (PDT) In-Reply-To: <87ehegtsde.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 12 Apr 2013 10:06:21 +0800") 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Hi Eric, Eric Abrahamsen writes: > I'm curious about this possibility as well -- how much work would it > be? The easiest way to know is to start working on it ;) Try creating a derived back-end from 'html one and see. ox-s5.el and ox-deck.el might be useful to read, they are derived from the 'html back-end already. HTH, PS: Maybe some adjustments could be done later do on ox-html.el so that it's easier to derive new back-ends from it... but we're not there yet. -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Attributes on HTML tables? Date: Fri, 12 Apr 2013 14:01:58 +0800 Message-ID: <87li8os2w9.fsf@ericabrahamsen.net> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQWxv-0002EI-Br for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQWxu-0000dv-H5 for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:56:03 -0400 Received: from plane.gmane.org ([80.91.229.3]:52632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQWxu-0000dg-Bm for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 01:56:02 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQWxr-0000T9-Vf for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 07:55:59 +0200 Received: from 114.250.106.12 ([114.250.106.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 07:55:59 +0200 Received: from eric by 114.250.106.12 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Apr 2013 07:55:59 +0200 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: emacs-orgmode@gnu.org Bastien writes: > Hi Eric, > > Eric Abrahamsen writes: > >> I'm curious about this possibility as well -- how much work would it >> be? > > The easiest way to know is to start working on it ;) I was afraid that was the answer! > Try creating a derived back-end from 'html one and see. > > ox-s5.el and ox-deck.el might be useful to read, they are derived > from the 'html back-end already. > > HTH, > > PS: Maybe some adjustments could be done later do on ox-html.el > so that it's easier to derive new back-ends from it... but we're > not there yet. The first step is probably to research the differences between xhtml and html 5. In a perfect world we'd be able to export to html 4, html 5, and whatever flavor of xhtml is still current. Bleagh! E From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Attributes on HTML tables? Date: Fri, 12 Apr 2013 10:46:48 +0200 Message-ID: <87wqs8b0g7.fsf@bzg.ath.cx> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQZdM-0002Vm-SH for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 04:47:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQZdL-0007ep-9w for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 04:47:00 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:52253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQZdL-0007eY-2w for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 04:46:59 -0400 Received: by mail-we0-f179.google.com with SMTP id p43so1814827wea.38 for ; Fri, 12 Apr 2013 01:46:58 -0700 (PDT) In-Reply-To: <87li8os2w9.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 12 Apr 2013 14:01:58 +0800") 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Eric Abrahamsen writes: > The first step is probably to research the differences between xhtml and > html 5. Well, I would even skip this step and just hack something usable. -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Fran=C3=A7ois_Pinard?= Subject: Re: Attributes on HTML tables? Date: Fri, 12 Apr 2013 10:36:01 -0400 Message-ID: <8661zr7r5a.fsf@iro.umontreal.ca> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQf5A-00036a-DJ for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 10:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQf59-0003cj-2k for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 10:36:04 -0400 Received: from bureau.ubity.com ([64.254.249.42]:51935 helo=mercure.bureau.ubity.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQf58-0003bx-W1 for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 10:36:03 -0400 In-Reply-To: <87wqs8b0g7.fsf@bzg.ath.cx> (Bastien's message of "Fri, 12 Apr 2013 10:46:48 +0200") 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: emacs-orgmode@gnu.org Bastien writes: > Eric Abrahamsen writes: >> The first step is probably to research the differences between xhtml and >> html 5. > Well, I would even skip this step and just hack something usable. There are validators out there, that could help us staying on track, whatever the track :-). Fran=C3=A7ois From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Attributes on HTML tables? Date: Sat, 13 Apr 2013 11:38:41 +0800 Message-ID: <877gk7qev2.fsf@ericabrahamsen.net> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQrCm-00021h-SJ for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 23:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQrCl-0004Af-Kn for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 23:32:44 -0400 Received: from plane.gmane.org ([80.91.229.3]:46559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQrCl-0004Ab-EC for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 23:32:43 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQrCj-0004bz-J7 for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 05:32:41 +0200 Received: from 114.250.135.240 ([114.250.135.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 05:32:41 +0200 Received: from eric by 114.250.135.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 05:32:41 +0200 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: emacs-orgmode@gnu.org François Pinard writes: > Bastien writes: > >> Eric Abrahamsen writes: > >>> The first step is probably to research the differences between xhtml and >>> html 5. > >> Well, I would even skip this step and just hack something usable. Okay, I've got a nearly-working patch for this, but I'm falling down hard on the defcustom. Here's what I thought to do: #+BEGIN_SRC emacs-lisp (defconst org-html-doctype-alist '((html4 . "") (html4-strict . " \"http://www.w3.org/TR/html4/strict.dtd\"") (xhtml . "") (html5 . "")) "An alist mapping (x)html flavors to specific doctypes.") (defcustom org-html-doctype 'xhtml "Document type definition to use for exported HTML files. Can be set with the in-buffer HTML_DOCTYPE property or for publishing, with :html-doctype." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") :type 'i-dont-know-how-to-work-this) #+END_SRC The end result I'm after is: the user can either set org-html-doctype to a symbol from among the cars org-html-doctype-alist, or he/she can set it directly to the doctype string. I don't know how to represent that in a defcustom. And of course, if anyone has any better approaches, then speak now or... speak later. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Attributes on HTML tables? Date: Sat, 13 Apr 2013 13:31:17 +0800 Message-ID: <8738uvq9ne.fsf@ericabrahamsen.net> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> <877gk7qev2.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQsxo-0006dC-3c for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 01:25:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQsxl-0003Rt-Kw for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 01:25:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:44317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQsxl-0003Qf-5S for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 01:25:21 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQsxk-0001S6-3L for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 07:25:20 +0200 Received: from 114.250.135.240 ([114.250.135.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 07:25:20 +0200 Received: from eric by 114.250.135.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 07:25:20 +0200 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Eric Abrahamsen writes: > François Pinard writes: > >> Bastien writes: >> >>> Eric Abrahamsen writes: >> >>>> The first step is probably to research the differences between xhtml and >>>> html 5. >> >>> Well, I would even skip this step and just hack something usable. I sort of fudged on the below. The upside is that it should be pretty forgiving now: you can set all kinds of strings as your :html-doctype, and it will do a reasonably good job of guessing how to handle it. Barring actual bugs or poor design decisions, what's left to do is: 1. Make sure that inlined script and style chunks are escaped correctly, I seem to remember reading that the commenting/escaping syntax for these chunks varies according to html flavor. 2. I'd like to add the possibility to put an arbitrary :html-container attribute on HTML elements, so that things that would have been wrapped in "div"s can be wrapped in "article", "section", "nav", and so on and so forth. Rick Frankel kindly provided a test file for this, which I've modified below: #+BEGIN_SRC emacs-lisp #+TITLE: HTML 5 Test #+DATE: {{{modification-time(%Y-%m-%d)}}} #+HTML_DOCTYPE: html5 #+BIND: org-html-divs ((preamble "header" "preamble") (content "section" "content") (postamble "footer" "postamble")) * Org HTML5 Test ok? This should be a paragraph with a \\ line break in it. I think * How about a table | col1 | col2 | |------+------| | a | 1 | | b | 2 | Tables can't have attributes in HTML5. * And a list - a - b - c * And an image [[file:1356810947473.jpg]] * A definiton list #+ATTR_HTML: :options html-container article - a :: foo - b :: bar #+END_SRC Please break! I'll provide a properly-written patch when we've sorted it out. E --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-First-stab-at-exporting-to-various-flavors-of-HTML.patch >From 296bbf0f74d0c3d49259e146597a174e7c14fda9 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 13 Apr 2013 13:22:14 +0800 Subject: [PATCH] First stab at exporting to various flavors of HTML. --- lisp/ox-html.el | 151 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 55 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 0ad3dc3..af80707 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -142,6 +142,15 @@ (defvar org-html--pre/postamble-class "status" "CSS class used for pre/postamble") +(defconst org-html-doctype-alist + '(("html4" . "") + ("html4-strict" . " +\"http://www.w3.org/TR/html4/strict.dtd\"") + ("xhtml" . "") + ("html5" . "")) + "An alist mapping (x)html flavors to specific doctypes.") + (defconst org-html-special-string-regexps '(("\\\\-" . "­") ; shy ("---\\([^-]\\)" . "—\\1") ; mdash @@ -747,7 +756,9 @@ in all modes you want. Then, use the command '(:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides") "Default attributes and values which will be used in table tags. This is a plist where attributes are symbols, starting with -colons, and values are strings." +colons, and values are strings. + +When exporting to HTML5, these values will be disregarded." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") @@ -855,7 +866,9 @@ CSS classes, then this prefix can be very useful." "The extension for exported HTML files. %s will be replaced with the charset of the exported file. This may be a string, or an alist with export extensions -and corresponding declarations." +and corresponding declarations. + +This declaration only applies when exporting to XHTML." :group 'org-export-html :type '(choice (string :tag "Single declaration") @@ -871,15 +884,14 @@ Use utf-8 as the default value." :package-version '(Org . "8.0") :type 'coding-system) -(defcustom org-html-doctype - "" +(defcustom org-html-doctype "xhtml" "Document type definition to use for exported HTML files. Can be set with the in-buffer HTML_DOCTYPE property or for publishing, with :html-doctype." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") - :type 'string) + :type 'string) (defcustom org-html-container-element "div" "HTML element to use for wrapping top level sections. @@ -1034,7 +1046,7 @@ precedence over this variable." '(("en" "

Author: %a (%e)

Date: %d

%c

-

%v

")) +

%v

")) "Alist of languages and format strings for the HTML postamble. The first element of each list is the language code, as used for @@ -1059,7 +1071,7 @@ like that: \"%%\"." :value-type (string :tag "Format string"))) (defcustom org-html-validation-link - "Validate XHTML 1.0" + "Validate" "Link to HTML validation service." :group 'org-export-html :type 'string) @@ -1239,6 +1251,19 @@ CSS classes, then this prefix can be very useful." ;;; Internal Functions +(defun org-html-xhtml-p (info) + (let ((dt (downcase (plist-get info :html-doctype)))) + (string-match-p dt "xhtml"))) + +(defun org-html-html5-p (info) + (let ((dt (downcase (plist-get info :html-doctype)))) + (member dt '("html5" "")))) + +(defun org-html-close-tag (info) + (if (org-html-xhtml-p info) + "/>" + ">")) + (defun org-html--make-attribute-string (attributes) "Return a list of attributes, as a string. ATTRIBUTES is a plist where values are either strings or nil. An @@ -1252,7 +1277,7 @@ attributes with a nil value will be omitted from the result." "\"" """ (org-html-encode-plain-text item)))) (setcar output (format "%s=\"%s\"" key value)))))))) -(defun org-html-format-inline-image (src &optional +(defun org-html-format-inline-image (src &optional info caption label attr standalone-p) "Format an inline image from SRC. CAPTION, LABEL and ATTR are optional arguments providing the @@ -1272,12 +1297,14 @@ When STANDALONE-P is t, wrap the into a
...
." (file-name-nondirectory src))))))) (cond (standalone-p - (let ((img (format "" src attr))) + (let ((img (format "%s%s\n" id (format "\n

%s

" img) (if (and caption (not (string= caption ""))) (format "\n

%s

" caption) "")))) - (t (format "" src (concat attr id)))))) + (t (format "%s\n" title) (format @@ -1434,17 +1462,18 @@ INFO is a plist used as a communication channel." (format-time-string (concat "\n")))) (format - "\n" + "\n") - (and author (format "\n" author)) + "iso-8859-1") close) + (format "\n" description)) + (format "\n" keywords))))) + (format ".. of the HTML output. @@ -1457,8 +1486,8 @@ INFO is a plist used as a communication channel." (org-element-normalize-string (plist-get info :html-head-extra)) (when (and (plist-get info :html-htmlized-css-url) (eq org-html-htmlize-output-type 'css)) - (format "\n" - (plist-get info :html-htmlized-css-url))) + (format "\n" + (plist-get info :html-htmlized-css-url) (org-html-close-tag info))) (when (plist-get info :html-head-include-scripts) org-html-scripts)))) (defun org-html--build-mathjax-config (info) @@ -1555,7 +1584,7 @@ communication channel." (format-time-string org-html-metadata-timestamp-format))) (when (plist-get info :with-creator) (format "

%s

\n" creator)) - (format "

%s

\n" + (format "

%s

\n" validation-link)))) (t (format-spec (or (cadr (assoc @@ -1597,23 +1626,31 @@ holding export options." CONTENTS is the transcoded contents string. INFO is a plist holding export options." (concat - (format - (or (and (stringp org-html-xml-declaration) - org-html-xml-declaration) - (cdr (assoc (plist-get info :html-extension) - org-html-xml-declaration)) - (cdr (assoc "html" org-html-xml-declaration)) - - "") - (or (and org-html-coding-system - (fboundp 'coding-system-get) - (coding-system-get org-html-coding-system 'mime-charset)) - "iso-8859-1")) - "\n" - (plist-get info :html-doctype) + (when (org-html-xhtml-p info) + (format "%s\n" + (format (or (and (stringp org-html-xml-declaration) + org-html-xml-declaration) + (cdr (assoc (plist-get info :html-extension) + org-html-xml-declaration)) + (cdr (assoc "html" org-html-xml-declaration)) + + "") + (or (and org-html-coding-system + (fboundp 'coding-system-get) + (coding-system-get org-html-coding-system 'mime-charset)) + "iso-8859-1")))) + (let* ((dt (plist-get info :html-doctype)) + (dt-cons (assoc dt org-html-doctype-alist))) + (if dt-cons + (cdr dt-cons) + dt)) "\n" - (format "\n" - (plist-get info :language) (plist-get info :language)) + (concat "\n") "\n" (org-html--build-meta-info info) (org-html--build-head info) @@ -2164,7 +2201,7 @@ holding contextual information." ;; Build the real contents of the sub-tree. (let* ((type (if numberedp 'ordered 'unordered)) (itemized-body (org-html-format-list-item - contents type nil nil full-text))) + contents type nil info nil full-text))) (concat (and (org-export-first-sibling-p headline info) (org-html-begin-plain-list type)) @@ -2222,7 +2259,7 @@ holding contextual information." (defun org-html-horizontal-rule (horizontal-rule contents info) "Transcode an HORIZONTAL-RULE object from Org to HTML. CONTENTS is nil. INFO is a plist holding contextual information." - "
") + (format "[-]") (t ""))) -(defun org-html-format-list-item (contents type checkbox +(defun org-html-format-list-item (contents type checkbox info &optional term-counter-id headline) "Format a list item into HTML." - (let ((checkbox (concat (org-html-checkbox checkbox) (and checkbox " ")))) + (let ((checkbox (concat (org-html-checkbox checkbox) (and checkbox " "))) + (br (format "" extra) - (when headline (concat headline "
"))))) + (when headline (concat headline br))))) (unordered (let* ((id term-counter-id) (extra (if id (format " id=\"%s\"" id) ""))) (concat (format "" extra) - (when headline (concat headline "
"))))) + (when headline (concat headline br))))) (descriptive (let* ((term term-counter-id)) (setq term (or term "(no term)")) @@ -2323,7 +2361,7 @@ contextual information." (tag (let ((tag (org-element-property :tag item))) (and tag (org-export-data tag info))))) (org-html-format-list-item - contents type checkbox (or tag counter)))) + contents type checkbox info (or tag counter)))) ;;;; Keyword @@ -2382,7 +2420,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link)) (org-html-format-inline-image - (match-string 1 formula-link) caption label attr t)))) + (match-string 1 formula-link) info caption label attr t)))) (t latex-frag)))) ;;;; Latex Fragment @@ -2401,7 +2439,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link)) (org-html-format-inline-image - (match-string 1 formula-link))))) + (match-string 1 formula-link) info)))) (t latex-frag)))) ;;;; Line Break @@ -2409,7 +2447,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (defun org-html-line-break (line-break contents info) "Transcode a LINE-BREAK object from Org to HTML. CONTENTS is nil. INFO is a plist holding contextual information." - "
\n") + (format "\n" output))) + "\\(\\\\\\\\\\)?[ \t]*\n" + (format "\n" + "^ *\\\\\\\\$" (format "\n" contents))) + "\\(\\\\\\\\\\)?[ \t]*\n" + (format " Okay, I've got a nearly-working patch for this, but I'm falling down > hard on the defcustom. Here's what I thought to do: > > #+BEGIN_SRC emacs-lisp > (defconst org-html-doctype-alist > '((html4 . "") > (html4-strict . " > \"http://www.w3.org/TR/html4/strict.dtd\"") > (xhtml . " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") > (html5 . "")) > "An alist mapping (x)html flavors to specific doctypes.") > > (defcustom org-html-doctype 'xhtml > "Document type definition to use for exported HTML files. > Can be set with the in-buffer HTML_DOCTYPE property or for > publishing, with :html-doctype." > :group 'org-export-html > :version "24.4" > :package-version '(Org . "8.0") > :type 'i-dont-know-how-to-work-this) > #+END_SRC > > The end result I'm after is: the user can either set org-html-doctype to > a symbol from among the cars org-html-doctype-alist, or he/she can set > it directly to the doctype string. I don't know how to represent that in > a defcustom. > > And of course, if anyone has any better approaches, then speak now or... > speak later. > > Eric --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Attributes on HTML tables? Date: Sat, 13 Apr 2013 13:10:13 -0400 Message-ID: <20130413171013.GA66674@BigDog.local> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR3xu-0000pD-W2 for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 13:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UR3xs-0006Jf-FP for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 13:10:14 -0400 Received: from [204.62.15.78] (port=56935 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR3xs-0006Jb-3s for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 13:10:12 -0400 Received: from BigDog.local (pool-72-89-40-63.nycmny.fios.verizon.net [72.89.40.63]) by mail.rickster.com (Postfix) with ESMTPS id 52B8A22FD2 for ; Sat, 13 Apr 2013 13:10:12 -0400 (EDT) Content-Disposition: inline In-Reply-To: <87ehegtsde.fsf@ericabrahamsen.net> 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: emacs-orgmode@gnu.org On Fri, Apr 12, 2013 at 10:06:21AM +0800, Eric Abrahamsen wrote: > Fran=E7ois Pinard writes: >=20 > > Christian Moe writes: > > > > While on this subject! :-) > > > > Could Org allow the output of HTML5 rather than XHTML, under the cont= rol > > of some option? I've read that some frameworks really expect HTML5 t= o > > work properly, such an option might ease inter-operation between > > exported Org and such frameworks. >=20 > I'm curious about this possibility as well -- how much work would it be= ? Sorry, late to the thread, i've been laid up. Anyway, the xhtml output from ox-html _should_ be mostly valid html5 (valid xhtml 1.0 in general should be valid html5). =20 However, you will need to change the html-table-tag to not use attributes, and remove the xml declaration (which is a warning and not an error in html5) =20 Here's a sample org file (which changes the divs to be more "html5ish" as well, not necessary) which validates as HTML5: (btw, i've remove the scripts and default-styles just to make the html output smaller, the file will validate even with them in the output). =20 rick =20 ----- %< --------- #+TITLE: HTML 5 Test #+DATE: {{{modification-time(%Y-%m-%d)}}} #+HTML_DOCTYPE: #+BIND: org-html-xml-declaration "" #+BIND: org-html-head-include-default-style nil #+BIND: org-html-table-tag "
" #+BIND: org-html-scripts "" #+BIND: org-html-divs ((preamble "header" "preamble") (content "section" "content") (postamble "footer" "postamble")) * Org HTML5 Test ok? * How about a table | col1 | col2 | |------+------| | a | 1 | | b | 2 | * And a list - a - b - c * A definiton list - a :: foo - b :: bar =20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Attributes on HTML tables? Date: Sat, 13 Apr 2013 16:42:59 -0400 Message-ID: <20130413204259.GA66764@BigDog.local> References: <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> <877gk7qev2.fsf@ericabrahamsen.net> <8738uvq9ne.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR7Hs-0002g6-6V for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UR7Hp-0001ox-NA for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:43:04 -0400 Received: from [204.62.15.78] (port=56050 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR7Hp-0001or-Jm for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:43:01 -0400 Content-Disposition: inline In-Reply-To: <8738uvq9ne.fsf@ericabrahamsen.net> 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org On Sat, Apr 13, 2013 at 01:31:17PM +0800, Eric Abrahamsen wrote: > Eric Abrahamsen writes: >=20 > > Fran=E7ois Pinard writes: > > > >> Bastien writes: > >> > >>> Eric Abrahamsen writes: > >> > >>>> The first step is probably to research the differences between xht= ml and > >>>> html 5. > >> > >>> Well, I would even skip this step and just hack something usable. >=20 >=20 > I sort of fudged on the below. The upside is that it should be pretty > forgiving now: you can set all kinds of strings as your :html-doctype, > and it will do a reasonably good job of guessing how to handle it. >=20 > Barring actual bugs or poor design decisions, what's left to do is: >=20 > 1. Make sure that inlined script and style chunks are escaped correctly= , > I seem to remember reading that the commenting/escaping syntax for thes= e > chunks varies according to html flavor. >=20 > 2. I'd like to add the possibility to put an arbitrary :html-container > #+BEGIN_SRC emacs-lisp > #+TITLE: HTML 5 Test > #+DATE: {{{modification-time(%Y-%m-%d)}}} > #+HTML_DOCTYPE: html5 > #+BIND: org-html-divs ((preamble "header" "preamble") (content "section= " "content") (postamble "footer" "postamble")) > * Org HTML5 Test > #+ATTR_HTML: :options html-container article note that you just just set #+HTML_CONTAINER: article in the head of the file if you want all the containers to be "article"s. > +(defconst org-html-doctype-alist > + '(("html4" . "") > + ("html4-strict" . " > +\"http://www.w3.org/TR/html4/strict.dtd\"") > + ("xhtml" . " +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") > + ("html5" . "")) I believe that should be (note the lowercase "html"): ("xhtml" . " +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") ("html5" . "") See http://www.w3schools.com/tags/tag_doctype.asp for a fairly complete list of valid doctypes. rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Attributes on HTML tables? Date: Sun, 14 Apr 2013 10:41:28 +0200 Message-ID: <874nf9a1f4.fsf@bzg.ath.cx> References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <20130413171013.GA66674@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URJY6-0007r9-6C for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 05:48:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URJY3-0003TX-TA for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 05:48:38 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:65384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URJY3-0003TB-Mb for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 05:48:35 -0400 Received: by mail-wi0-f173.google.com with SMTP id l13so136956wie.6 for ; Sun, 14 Apr 2013 02:48:34 -0700 (PDT) In-Reply-To: <20130413171013.GA66674@BigDog.local> (Rick Frankel's message of "Sat, 13 Apr 2013 13:10:13 -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 Frankel Cc: emacs-orgmode@gnu.org Hi Rick, Rick Frankel writes: > However, you will need to change the html-table-tag to not use > attributes, and remove the xml declaration > (which is a warning and not an error in html5) (Note that `org-html-table-tag' has been deleted, you need to check `org-html-table-default-attributes' instead.) The HTML5 validation is good news and your example is great. Would be nice to have this in worg/org-faq.org! Thanks, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Attributes on HTML tables? Date: Sun, 14 Apr 2013 18:13:40 +0800 Message-ID: <87ehedctd7.fsf@ericabrahamsen.net> References: <87mwtavzgv.fsf@gmail.com> <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> <877gk7qev2.fsf@ericabrahamsen.net> <8738uvq9ne.fsf@ericabrahamsen.net> <20130413204259.GA66764@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URJqf-00020C-Me for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 06:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URJqe-0001Xt-FE for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 06:07:49 -0400 Received: from plane.gmane.org ([80.91.229.3]:39447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URJqe-0001Xl-80 for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 06:07:48 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1URJqY-0004wH-JP for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 12:07:43 +0200 Received: from 114.250.128.187 ([114.250.128.187]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Apr 2013 12:07:42 +0200 Received: from eric by 114.250.128.187 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Apr 2013 12:07:42 +0200 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: emacs-orgmode@gnu.org Rick Frankel writes: > On Sat, Apr 13, 2013 at 01:31:17PM +0800, Eric Abrahamsen wrote: >> Eric Abrahamsen writes: >> >> > François Pinard writes: >> > >> >> Bastien writes: >> >> >> >>> Eric Abrahamsen writes: >> >> >> >>>> The first step is probably to research the differences between xhtml and >> >>>> html 5. >> >> >> >>> Well, I would even skip this step and just hack something usable. >> >> >> I sort of fudged on the below. The upside is that it should be pretty >> forgiving now: you can set all kinds of strings as your :html-doctype, >> and it will do a reasonably good job of guessing how to handle it. >> >> Barring actual bugs or poor design decisions, what's left to do is: >> >> 1. Make sure that inlined script and style chunks are escaped correctly, >> I seem to remember reading that the commenting/escaping syntax for these >> chunks varies according to html flavor. >> >> 2. I'd like to add the possibility to put an arbitrary :html-container > >> #+BEGIN_SRC emacs-lisp >> #+TITLE: HTML 5 Test >> #+DATE: {{{modification-time(%Y-%m-%d)}}} >> #+HTML_DOCTYPE: html5 >> #+BIND: org-html-divs ((preamble "header" "preamble") (content "section" "content") (postamble "footer" "postamble")) >> * Org HTML5 Test >> #+ATTR_HTML: :options html-container article > > note that you just just set #+HTML_CONTAINER: article in the head of the > file if you want all the containers to be "article"s. That would be pretty drastic, though -- it would wrap "article" around a whole bunch of stuff that shouldn't be an article! I think ultimately the HTML exporter should grow a slightly more flexible system for wrapping document sections in containers, but this patch definitely shouldn't get hung up on that. >> +(defconst org-html-doctype-alist >> + '(("html4" . "") >> + ("html4-strict" . " >> +\"http://www.w3.org/TR/html4/strict.dtd\"") >> + ("xhtml" . "> +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") >> + ("html5" . "")) > > I believe that should be (note the lowercase "html"): > > ("xhtml" . "> +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") > ("html5" . "") > > See http://www.w3schools.com/tags/tag_doctype.asp for a fairly > complete list of valid doctypes. Cool, thanks for the reference. If the approach of this patch seems generally acceptable I'll try to add most of the commonly-used doctypes in there. I'm waffling on XHTML5, though -- from what I can tell it's a spec everyone sort of thought ought to be in there, but no one is actually using. E From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Attributes on HTML tables? Date: Sun, 14 Apr 2013 14:01:03 -0400 Message-ID: <20130414180103.GD69197@BigDog.local> References: <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> <877gk7qev2.fsf@ericabrahamsen.net> <8738uvq9ne.fsf@ericabrahamsen.net> <20130413204259.GA66764@BigDog.local> <87ehedctd7.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URREi-0008FX-Nq for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 14:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URREe-0005Ax-In for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 14:01:08 -0400 Received: from [204.62.15.78] (port=42231 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URREe-00058y-Ea for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 14:01:04 -0400 Content-Disposition: inline In-Reply-To: <87ehedctd7.fsf@ericabrahamsen.net> 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org On Sun, Apr 14, 2013 at 06:13:40PM +0800, Eric Abrahamsen wrote: > Rick Frankel writes: > > > On Sat, Apr 13, 2013 at 01:31:17PM +0800, Eric Abrahamsen wrote: > >> * Org HTML5 Test > >> #+ATTR_HTML: :options html-container article > >> - a :: foo > >> - b :: bar > > note that you just just set #+HTML_CONTAINER: article in the head of the > > file if you want all the containers to be "article"s. > > That would be pretty drastic, though -- it would wrap "article" around a > whole bunch of stuff that shouldn't be an article! I think ultimately > the HTML exporter should grow a slightly more flexible system for > wrapping document sections in containers, but this patch definitely > shouldn't get hung up on that. It specifies the element for the top-level container---by default, something like:
In the case of e.g., a blog or slideshow,
is an appropriate top-level wrapper lelement. Regardless, I'm not sure which object you are expecting the #+ATTR_HTML to apply to in the example above. Here's the html the above section generates: #+BEGIN_HTML

5 A definiton list

a
foo
b
bar
Where the 'outline-text-2' div is actually around the entire body of the section, not just the definition list (there is no explicit wrapper around the definition list). I would argue that to set the element type fro the outer (outline-container) div or the inner (outline-text) div, a property setting would make more sense. I can see using a (headline level) :HTML_CONTAINER property to set the container on a given headline (which i think i will impliment as it is very low impact), and perhaps either an :HTML_CHILD_CONTAINER or :HTML_TEXT_CONTAINER to specify the wrapper on the inner section. rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Attributes on HTML tables? Date: Mon, 15 Apr 2013 14:03:54 -0400 Message-ID: <20130415180354.GA74470@BigDog.local> References: <86fvyy1dsp.fsf@iro.umontreal.ca> <87ehegtsde.fsf@ericabrahamsen.net> <87a9p4e24e.fsf@bzg.ath.cx> <87li8os2w9.fsf@ericabrahamsen.net> <87wqs8b0g7.fsf@bzg.ath.cx> <8661zr7r5a.fsf@iro.umontreal.ca> <877gk7qev2.fsf@ericabrahamsen.net> <8738uvq9ne.fsf@ericabrahamsen.net> <20130413204259.GA66764@BigDog.local> <87ehedctd7.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URnl0-0007NY-V5 for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 14:04:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URnky-00046w-8m for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 14:03:58 -0400 Received: from [204.62.15.78] (port=49590 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URnky-00046s-5L for emacs-orgmode@gnu.org; Mon, 15 Apr 2013 14:03:56 -0400 Content-Disposition: inline In-Reply-To: <87ehedctd7.fsf@ericabrahamsen.net> 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Eric- > Rick Frankel writes: > I would argue that to set the element type fro the outer > (outline-container) div or the inner (outline-text) div, a property > setting would make more sense. I can see using a (headline level) > :HTML_CONTAINER property to set the container on a given headline > (which i think i will impliment as it is very low impact), and perhaps > either an :HTML_CHILD_CONTAINER or :HTML_TEXT_CONTAINER to specify the > wrapper on the inner section. I have pushed to master the abilty to set the :HTML_CONTAINER property on any headline and have that value override the default (:html-container for level 1 headines, "div" for the rest). Note that this is not an inherited property so only affect the headline it is specified on, not it's children. rick