emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [New Exporter] Parameterized wrapper elements
Date: Sat, 09 Mar 2013 01:46:37 +0100	[thread overview]
Message-ID: <87li9xz9g2.fsf@gmail.com> (raw)
In-Reply-To: <20130309001710.GB22813@BigDog.local> (Rick Frankel's message of "Fri, 8 Mar 2013 19:17:10 -0500")

Hello,

Rick Frankel <rick@rickster.com> 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	other threads:[~2013-03-09  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09  0:17 [New Exporter] Parameterized wrapper elements Rick Frankel
2013-03-09  0:46 ` Nicolas Goaziou [this message]
2013-03-09 16:07   ` Rick Frankel
2013-03-09  2:33 ` Jambunathan K
2013-03-09  9:32 ` Bastien
2013-03-09 16:39   ` Rick Frankel
2013-03-09 17:15     ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87li9xz9g2.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).