emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Attributes on HTML tables?


From: Eric Abrahamsen
Subject: Re: [O] Attributes on HTML tables?
Date: Sun, 14 Apr 2013 18:13:40 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (gnu/linux)

Rick Frankel <address@hidden> writes:

> On Sat, Apr 13, 2013 at 01:31:17PM +0800, Eric Abrahamsen wrote:
>> Eric Abrahamsen <address@hidden> writes:
>> 
>> > François Pinard <address@hidden> writes:
>> >
>> >> Bastien <address@hidden> writes:
>> >>
>> >>> Eric Abrahamsen <address@hidden> 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" . "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">")
>> +    ("html4-strict" . "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">
>> +\"http://www.w3.org/TR/html4/strict.dtd\"";)
>> +    ("xhtml" . "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
>> +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>")
>> +    ("html5" . "<!DOCTYPE HTML>"))
>
> I believe that should be (note the lowercase "html"):
>
>   ("xhtml" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
>> +\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>")
>   ("html5" . "<!DOCTYPE html>")
>
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]