emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [New Exporter] Parameterized wrapper elements


From: Nicolas Goaziou
Subject: Re: [O] [New Exporter] Parameterized wrapper elements
Date: Sat, 09 Mar 2013 01:46:37 +0100

Hello,

Rick Frankel <address@hidden> writes:

> Anyway, attached is a patch which parameterizes the html exporter in a
> way which is useful (for me :) in deriving new backends. It also make
> the exporter more capable of generating HTML5 compatible output
> instead of just XHTML.

Thank you for your patch.

> If you agree with it, i would be happy to apply it (or you can :).

Since I don't use html back-end, it would be better to hear from actual
users what they think about it.

Anyway, just a few comments:

> +(defcustom org-html-container-element "div"
> +  "Container class to use for wrapping top level sections in
> +the exported html file. Can be set with the in-buffer HTML_CONTAINER
> +property or for publishing, with :html-container"

First line needs to be a sentence on its own. Also, the docstring has to
end with a full stop.

> +(defcustom org-html-divs
> +  '(("preamble"  "div")
> +    ("content"   "div")
> +    ("postamble" "div"))
> +  "Alist of the main divs for HTML export.
> +This is a list of three pairs, ID and ELEMENT, the first one
> +for the preamble, the second one for the content and the
> +third one for the postamble."
> +  :group 'org-export-html
> +  :version "24.4"
> +  :package-version '(Org . "8.0")
> +  :type '(list
> +       (list :tag "Preamble"
> +             (string :tag "     id") (string :tag "element"))
> +       (list :tag "Content"
> +             (string :tag "     id") (string :tag "element"))
> +       (list :tag "Postamble"
> +             (string :tag "     id") (string :tag "element"))))

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

instead of:

  (nth 1 (nth 1 org-html-divs))

which, IMO, is easier to read.

> +               contents)
> +             (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?


Regards,

-- 
Nicolas Goaziou



reply via email to

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