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: Sat, 13 Apr 2013 13:31:17 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (gnu/linux)

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
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

Attachment: 0001-First-stab-at-exporting-to-various-flavors-of-HTML.patch
Description: Text Data



> 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 . "<!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>"))
>   "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

reply via email to

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