From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
Subject: Re: HTML Postamble is inside Content DIV
Date: Tue, 28 Jun 2011 23:45:18 +0200 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]
"Sebastien Vauban" wrote:
> Sébastien Vauban wrote:
>> Jonathan BISSON wrote:
>>> Sébastien Vauban <wxhgmqzgwmuf@...> writes:
>>>> After a couple of tests, I've observed that the postamble is forced to be
>>>> included *inside* the div "content".
>>>> Proof on Line 1764... These are the ending tags of every HTML page:
>>>> #+begin_src emacs-lisp
>>>> (unless body-only (insert "\n</div>\n</body>\n</html>\n"))
>>>> ... the closing </div> referring to the opening of "content".
>>>> Shouldn't it make sense to be able to insert something *out of* the
>>>> "content" div?
>>> I think so (and the same for preamble)!
>>> I rewrote org-export-as-html and did a custom org-publish-org-to-html to
>>> call it, in order to get them out off the content div (you can look at a
>>> first test on my webpage http://www.bjonnh.net). It's easy to do it I can
>>> send you my file if you are interested.
>> I think sharing the code here is always a good idea.
>> However, I'd favor an approach commonly shared by others, ie by either:
>> - moving the postamble out of the content DIV
>> - adding an extra "environment" next to the content DIV, if the postamble must
>> stay where it currently is -- for historical or compliance reasons?
>> (same applies for preamble)
> I'm hijacking my own thread, as it received little support, and as the new
> question is quite related to that:
> - if we customize the preamble, our string will be inserted as is;
> - if we customize the postamble, our string will be inserted as is... between
> a wrapping div called "postamble".
> Shouldn't it be normal to apply the same reasoning for both cases: either
> impose a wrapper, either not?
>> Any comment for others?
Except for the reply of Jonathan, I received no answer on this. Here is thus
my proposition for a better div-structured HTML.
There are only four parts required in the HTML for all the magic to work with
- The first part is a container div ("content", by default) that surrounds
- Inside that are three more parts:
+ a preamble (in a div, if the user wants it),
+ a div "body" and
+ a postamble (in a div, if the user wants it).
The patch is attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-html-new-structure.patch --]
[-- Type: text/x-patch, Size: 1395 bytes --]
diff --git a/lisp/org-html.el b/lisp/org-html.el
index f6108fc..daf61d2 100644
@@ -1325,7 +1325,10 @@ lang=\"%s\" xml:lang=\"%s\">
(cadr (assoc "en" org-export-html-preamble-format)))
`((?t . ,title) (?a . ,author)
- (?d . ,date) (?e . ,email)))))))))
+ (?d . ,date) (?e . ,email))))))))
+ ;; insert opening tag for body
+ (insert "\n<div id=\"body\">\n"))
(if (and org-export-with-toc (not body-only))
@@ -1721,6 +1724,8 @@ lang=\"%s\" xml:lang=\"%s\">
;; export html postamble
+ ;; insert closing tag for body
+ (insert "</div>")
(let ((html-post (plist-get opt-plist :html-postamble))
@@ -1732,12 +1737,13 @@ lang=\"%s\" xml:lang=\"%s\">
(when (plist-get opt-plist :html-postamble)
(cond ((stringp html-post)
- (insert "<div id=\"postamble\">\n")
+ ;; (insert "<div id=\"postamble\">\n")
(insert (format-spec html-post
`((?a . ,author) (?e . ,email)
(?d . ,date) (?c . ,creator-info)
(?v . ,html-validation-link))))
- (insert "</div>"))
+ ;; (insert "</div>")
(funcall html-post opt-plist))
((eq html-post 'auto)
next prev parent reply other threads:[~2011-06-28 21:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 22:15 Sébastien Vauban
2011-04-30 18:41 ` Jonathan BISSON
2011-05-03 11:17 ` Sébastien Vauban
2011-05-31 18:56 ` Sebastien Vauban
2011-06-28 21:45 ` Sebastien Vauban [this message]
2011-06-29 13:26 ` Pierre de Buyl
2011-07-01 14:06 ` Sebastien Vauban
2011-07-06 6:49 ` Pierre de Buyl
2011-07-08 7:36 ` Sebastien Vauban
2011-07-08 9:28 ` Pierre de Buyl
2011-07-21 20:47 ` [patch] " Sebastien Vauban
2011-07-21 23:35 ` Jambunathan K
2011-07-24 18:56 ` Bastien
2011-07-23 17:11 ` Bastien
2011-07-23 21:58 ` Sebastien Vauban
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).