[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [New Exporter] Parameterized wrapper elements
From: |
Rick Frankel |
Subject: |
Re: [O] [New Exporter] Parameterized wrapper elements |
Date: |
Sat, 9 Mar 2013 11:07:45 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Mar 09, 2013 at 01:46:37AM +0100, Nicolas Goaziou wrote:
> Since I don't use html back-end, it would be better to hear from actual
> users what they think about it.
Sorry, forgot that you are not the keeper of ox-html, just the new
exporter at large ;).
> Anyway, just a few comments:
>
> > +(defcustom org-html-divs
> > + '(("preamble" "div")
> > + ("content" "div")
> > + ("postamble" "div"))
> > + "Alist of the main divs for HTML export.
> Even if this is technically an alist, you don't use it as such, because
> you do not treat ID as keys.
>
> Perhaps something like the following would be better:
>
> '((preamble "preamble" "div")
> (content "content" "div")
> (postamble "postamble" "div"))
>
> One advantage is that you don't have to rely on order of associations.
> Another advantage is that you can write:
>
> (nth 1 (assq 'content org-html-divs))
I agree, but couldn't figure out a way to specify a defcustom alist
that requires a fixed set of options. I'm quite new to the
defcustom specification format, so maybe there is a way...
Given what I see is possible w/ custom alists, the code would have to
look like:
(nth 1 (or (assq 'content org-html-divs)
(assq 'content org-html-default-divs)))
Not sure this is any better than the nth nth approach. What do you
think?
> > + (if (= 1 (org-export-get-relative-level headline info))
> > + (plist-get info :html-container))))))))
>
> Shouldn't you close the div when level is different from 1 here?
Yes, it's a bug. Missing the else part. Will amend the patch and
repost. thanx for finding this.
rick