emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML Postamble is inside Content DIV
@ 2011-04-29 22:15 Sébastien Vauban
  2011-04-30 18:41 ` Jonathan BISSON
  0 siblings, 1 reply; 15+ messages in thread
From: Sébastien Vauban @ 2011-04-29 22:15 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

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"))
#+end_src

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

Best regards,
  Seb

-- 
Sébastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-04-29 22:15 HTML Postamble is inside Content DIV Sébastien Vauban
@ 2011-04-30 18:41 ` Jonathan BISSON
  2011-05-03 11:17   ` Sébastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Jonathan BISSON @ 2011-04-30 18:41 UTC (permalink / raw)
  To: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@...> writes:

> 
> Hello,
> 
> 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"))
> #+end_src
> 
> ... 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.


Cheers,

J.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-04-30 18:41 ` Jonathan BISSON
@ 2011-05-03 11:17   ` Sébastien Vauban
  2011-05-31 18:56     ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Sébastien Vauban @ 2011-05-03 11:17 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Jonathan,

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"))
>> #+end_src
>> 
>> ... 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)

Any comment for others?

Best regards,
  Seb

-- 
Sébastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-05-03 11:17   ` Sébastien Vauban
@ 2011-05-31 18:56     ` Sebastien Vauban
  2011-06-28 21:45       ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2011-05-31 18:56 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi,

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"))
>>> #+end_src
>>> 
>>> ... 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?

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-05-31 18:56     ` Sebastien Vauban
@ 2011-06-28 21:45       ` Sebastien Vauban
  2011-06-29 13:26         ` Pierre de Buyl
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2011-06-28 21:45 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]

Hi,

"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"))
>>>> #+end_src
>>>>
>>>> ... 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 CSS:

- The first part is a container div ("content", by default) that surrounds
  everything.

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

Best regards,
  Seb

-- 
Sebastien Vauban

[-- 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
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1325,7 +1325,10 @@ lang=\"%s\" xml:lang=\"%s\">
 				      org-export-html-preamble-format))
 			 (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))
 	  (progn
@@ -1721,6 +1724,8 @@ lang=\"%s\" xml:lang=\"%s\">
 
       ;; export html postamble
       (unless body-only
+	;; insert closing tag for body
+	(insert "</div>")
 	(let ((html-post (plist-get opt-plist :html-postamble))
 	      (email
 	       (mapconcat (lambda(e)
@@ -1732,12 +1737,13 @@ lang=\"%s\" xml:lang=\"%s\">
 		       (number-to-string emacs-major-version))))
 	  (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>")
+		   )
 		  ((functionp html-post)
 		   (funcall html-post opt-plist))
 		  ((eq html-post 'auto)

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-06-28 21:45       ` Sebastien Vauban
@ 2011-06-29 13:26         ` Pierre de Buyl
  2011-07-01 14:06           ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Pierre de Buyl @ 2011-06-29 13:26 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Le 28 juin 11 à 23:45, Sebastien Vauban a écrit :
> "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"))
>>>>> #+end_src
>>>>>
>>>>> ... 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 CSS:
>
> - The first part is a container div ("content", by default) that  
> surrounds
>   everything.
>
> - 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.
>
> Best regards,
>   Seb
>

Hello,

I think my regular use of the html export would be broken.

I add a <div id="wrapper"> in the preamble and a </div> in the  
postamble.
This allows me to make a "boxed" page (see http://homepages.ulb.ac.be/ 
~pdebuyl/ ) which I like.

If I cannot end my div in the postamble, I think it would break my  
setup.

Here is my setup:
	 :html-preamble "
    <div id=\"wrapper\">
    <div id=\"menu\">
    HERE, some static menu items.
    </div>
"
	 :html-postamble "
    </div>
"

I tried without that extra div and I cannot reproduce my former layout.

Pierre

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-06-29 13:26         ` Pierre de Buyl
@ 2011-07-01 14:06           ` Sebastien Vauban
  2011-07-06  6:49             ` Pierre de Buyl
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2011-07-01 14:06 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Pierre,

Pierre de Buyl wrote:
> Le 28 juin 11 à 23:45, Sebastien Vauban a écrit :
>> 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 CSS:
>>
>> - The first part is a container div ("content", by default) that surrounds
>>   everything.
>>
>> - 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).
>
> I think my regular use of the html export would be broken.

We'll try to solve that, then.

> I add a <div id="wrapper"> in the preamble and a </div> in the postamble.
> This allows me to make a "boxed" page (see
> http://homepages.ulb.ac.be/~pdebuyl/ ) which I like.
>
> If I cannot end my div in the postamble, I think it would break my setup.
>
> Here is my setup:
> 	 :html-preamble "
>    <div id=\"wrapper\">
>    <div id=\"menu\">
>    HERE, some static menu items.
>    </div>
> "
> 	 :html-postamble "
>    </div>
> "

Why are you adding a `wrapper' div in the already existing `content' div (that
surrounds everything). I see no real difference between both.

> I tried without that extra div and I cannot reproduce my former layout.

Would you apply your CSS rule onto `content', would that make a diff?

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-07-01 14:06           ` Sebastien Vauban
@ 2011-07-06  6:49             ` Pierre de Buyl
  2011-07-08  7:36               ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Pierre de Buyl @ 2011-07-06  6:49 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hello,

I checked and indeed "content" is working well.

Pierre

Le 1 juil. 11 à 16:06, Sebastien Vauban a écrit :

> Hi Pierre,
>
> Pierre de Buyl wrote:
>> Le 28 juin 11 à 23:45, Sebastien Vauban a écrit :
>>> 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 CSS:
>>>
>>> - The first part is a container div ("content", by default) that  
>>> surrounds
>>>   everything.
>>>
>>> - 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).
>>
>> I think my regular use of the html export would be broken.
>
> We'll try to solve that, then.
>
>> I add a <div id="wrapper"> in the preamble and a </div> in the  
>> postamble.
>> This allows me to make a "boxed" page (see
>> http://homepages.ulb.ac.be/~pdebuyl/ ) which I like.
>>
>> If I cannot end my div in the postamble, I think it would break my  
>> setup.
>>
>> Here is my setup:
>> 	 :html-preamble "
>>    <div id=\"wrapper\">
>>    <div id=\"menu\">
>>    HERE, some static menu items.
>>    </div>
>> "
>> 	 :html-postamble "
>>    </div>
>> "
>
> Why are you adding a `wrapper' div in the already existing  
> `content' div (that
> surrounds everything). I see no real difference between both.
>
>> I tried without that extra div and I cannot reproduce my former  
>> layout.
>
> Would you apply your CSS rule onto `content', would that make a diff?
>
> Best regards,
>   Seb
>
> -- 
> Sebastien Vauban
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-07-06  6:49             ` Pierre de Buyl
@ 2011-07-08  7:36               ` Sebastien Vauban
  2011-07-08  9:28                 ` Pierre de Buyl
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2011-07-08  7:36 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Pierre,

Any objection for applying this patch?

Pierre de Buyl wrote:
> I checked and indeed "content" is working well.
>
> Pierre
>
> Le 1 juil. 11 à 16:06, Sebastien Vauban a écrit :
>
>> Hi Pierre,
>>
>> Pierre de Buyl wrote:
>>> Le 28 juin 11 à 23:45, Sebastien Vauban a écrit :
>>>> 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 CSS:
>>>>
>>>> - The first part is a container div ("content", by default) that surrounds
>>>>   everything.
>>>>
>>>> - 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).
>>>
>>> I think my regular use of the html export would be broken.
>>
>> We'll try to solve that, then.
>>
>>> I add a <div id="wrapper"> in the preamble and a </div> in the postamble.
>>> This allows me to make a "boxed" page (see
>>> http://homepages.ulb.ac.be/~pdebuyl/ ) which I like.
>>>
>>> If I cannot end my div in the postamble, I think it would break my setup.
>>>
>>> Here is my setup:
>>> 	 :html-preamble "
>>>    <div id=\"wrapper\">
>>>    <div id=\"menu\">
>>>    HERE, some static menu items.
>>>    </div>
>>> "
>>> 	 :html-postamble "
>>>    </div>
>>> "
>>
>> Why are you adding a `wrapper' div in the already existing `content' div
>> (that
>> surrounds everything). I see no real difference between both.
>>
>>> I tried without that extra div and I cannot reproduce my former layout.
>>
>> Would you apply your CSS rule onto `content', would that make a diff?

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: HTML Postamble is inside Content DIV
  2011-07-08  7:36               ` Sebastien Vauban
@ 2011-07-08  9:28                 ` Pierre de Buyl
  2011-07-21 20:47                   ` [patch] " Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Pierre de Buyl @ 2011-07-08  9:28 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Not at all.

Pierre

Le 8 juil. 11 à 09:36, Sebastien Vauban a écrit :

> Hi Pierre,
>
> Any objection for applying this patch?
>
> Pierre de Buyl wrote:
>> I checked and indeed "content" is working well.
>>
>> Pierre
>>
>> Le 1 juil. 11 à 16:06, Sebastien Vauban a écrit :
>>
>>> Hi Pierre,
>>>
>>> Pierre de Buyl wrote:
>>>> Le 28 juin 11 à 23:45, Sebastien Vauban a écrit :
>>>>> 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 CSS:
>>>>>
>>>>> - The first part is a container div ("content", by default)  
>>>>> that surrounds
>>>>>   everything.
>>>>>
>>>>> - 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).
>>>>
>>>> I think my regular use of the html export would be broken.
>>>
>>> We'll try to solve that, then.
>>>
>>>> I add a <div id="wrapper"> in the preamble and a </div> in the  
>>>> postamble.
>>>> This allows me to make a "boxed" page (see
>>>> http://homepages.ulb.ac.be/~pdebuyl/ ) which I like.
>>>>
>>>> If I cannot end my div in the postamble, I think it would break  
>>>> my setup.
>>>>
>>>> Here is my setup:
>>>> 	 :html-preamble "
>>>>    <div id=\"wrapper\">
>>>>    <div id=\"menu\">
>>>>    HERE, some static menu items.
>>>>    </div>
>>>> "
>>>> 	 :html-postamble "
>>>>    </div>
>>>> "
>>>
>>> Why are you adding a `wrapper' div in the already existing  
>>> `content' div
>>> (that
>>> surrounds everything). I see no real difference between both.
>>>
>>>> I tried without that extra div and I cannot reproduce my former  
>>>> layout.
>>>
>>> Would you apply your CSS rule onto `content', would that make a  
>>> diff?
>
> Best regards,
>   Seb
>
> -- 
> Sebastien Vauban
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [patch] Re: HTML Postamble is inside Content DIV
  2011-07-08  9:28                 ` Pierre de Buyl
@ 2011-07-21 20:47                   ` Sebastien Vauban
  2011-07-21 23:35                     ` Jambunathan K
  2011-07-23 17:11                     ` Bastien
  0 siblings, 2 replies; 15+ messages in thread
From: Sebastien Vauban @ 2011-07-21 20:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Hi Pierre, Bastien et al.,

Pierre de Buyl wrote:
> Le 8 juil. 11 à 09:36, Sebastien Vauban a écrit :
>>> 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 CSS:
>>>
>>> - The first part is a container div ("content", by default) that
>>> surrounds
>>>   everything.
>>>
>>> - 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).
>>
>> Any objection for applying this patch?
>
> Not at all.

After off-line discussion with Bastien, here is the updated proposition --
and patch!

There is no global DIV anymore directly inside the body, as there is already
(in CSS) a virtual DIV called "#body"...

Inside the "body" tags, 3 DIV:

- "preamble" (useful for adding a static menu, outside of the "content" DIV)
- "content" (by default, see "org-export-html-content-div")
- "postamble"

Preamble and postamble DIV are only inserted if they're not void.

The "content" DIV (name free to be customized) will always be inserted.

Any comment or objection?

Best regards,
  Seb

-- 
Sebastien Vauban

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-html-new-structure.patch --]
[-- Type: text/x-patch, Size: 4200 bytes --]

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 7bb8b61..8aff1c6 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -614,11 +614,6 @@ with a link to this URL."
 	  (const :tag "Keep internal css" nil)
 	  (string :tag "URL or local href")))
 
-(defcustom org-export-html-before-content-div ""
-  "Arbitrary HTML code placed before <div id=\"content\">."
-  :group 'org-export-html
-  :type 'string)
-
 (defcustom org-export-html-content-div "content"
   "The name of the container DIV that holds all the page contents."
   :group 'org-export-html
@@ -1300,8 +1295,6 @@ lang=\"%s\" xml:lang=\"%s\">
 </head>
 <body>
 %s
-<div id=\"%s\">
-%s
 "
 		 (format
 		  (or (and (stringp org-export-html-xml-declaration)
@@ -1317,8 +1310,6 @@ lang=\"%s\" xml:lang=\"%s\">
 		 date author description keywords
 		 style
 		 mathjax
-		 org-export-html-before-content-div
-		 org-export-html-content-div
 		 (if (or link-up link-home)
 		     (concat
 		      (format org-export-html-home/up-format
@@ -1330,6 +1321,7 @@ lang=\"%s\" xml:lang=\"%s\">
 	;; insert html preamble
 	(when (plist-get opt-plist :html-preamble)
 	  (let ((html-pre (plist-get opt-plist :html-preamble)))
+	    (insert "<div id=\"preamble\">")
 	    (cond ((stringp html-pre)
 		   (insert
 		    (format-spec html-pre `((?t . ,title) (?a . ,author)
@@ -1343,8 +1335,13 @@ lang=\"%s\" xml:lang=\"%s\">
 				      org-export-html-preamble-format))
 			 (cadr (assoc "en" org-export-html-preamble-format)))
 		     `((?t . ,title) (?a . ,author)
-		       (?d . ,date) (?e . ,email)))))))))
+		       (?d . ,date) (?e . ,email))))))
+	    (insert "</div>\n")))
 
+	;; begin wrap around body
+	(insert (format "\n<div id=\"%s\">" org-export-html-content-div)))
+
+      ;; insert body
       (if (and org-export-with-toc (not body-only))
 	  (progn
 	    (push (format "<h%d>%s</h%d>\n"
@@ -1748,8 +1745,11 @@ lang=\"%s\" xml:lang=\"%s\">
 	(when bib
 	  (insert "\n" bib "\n")))
 
-      ;; export html postamble
       (unless body-only
+	;; end wrap around body
+	(insert "</div>\n")
+
+	;; export html postamble
 	(let ((html-post (plist-get opt-plist :html-postamble))
 	      (email
 	       (mapconcat (lambda(e)
@@ -1759,19 +1759,18 @@ lang=\"%s\" xml:lang=\"%s\">
 	      (creator-info
 	       (concat "Org version " org-version " with Emacs version "
 		       (number-to-string emacs-major-version))))
+
 	  (when (plist-get opt-plist :html-postamble)
+	    (insert "\n<div id=\"postamble\">")
 	    (cond ((stringp html-post)
-		   (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>"))
+					  (?v . ,html-validation-link)))))
 		  ((functionp html-post)
 		   (funcall html-post))
 		  ((eq html-post 'auto)
 		   ;; fall back on default postamble
-		   (insert "<div id=\"postamble\">\n")
 		   (when (plist-get opt-plist :time-stamp-file)
 		     (insert "<p class=\"date\">" (nth 2 lang-words) ": " date "</p>\n"))
 		   (when (and (plist-get opt-plist :author-info) author)
@@ -1782,22 +1781,22 @@ lang=\"%s\" xml:lang=\"%s\">
 		     (insert "<p class=\"creator\">"
 			     (concat "Org version " org-version " with Emacs version "
 				     (number-to-string emacs-major-version) "</p>\n")))
-		   (insert html-validation-link "\n</div>"))
+		   (insert html-validation-link "\n"))
 		  (t
-		   (insert "<div id=\"postamble\">\n")
 		   (insert (format-spec
 			    (or (cadr (assoc (nth 0 lang-words)
 					     org-export-html-postamble-format))
 				(cadr (assoc "en" org-export-html-postamble-format)))
 			    `((?a . ,author) (?e . ,email)
 			      (?d . ,date)   (?c . ,creator-info)
-			      (?v . ,html-validation-link))))
-		   (insert "</div>"))))))
+			      (?v . ,html-validation-link))))))
+	    (insert "</div>")
+	    )))
 
       (if org-export-html-with-timestamp
 	  (insert org-export-html-html-helper-timestamp))
 
-      (unless body-only (insert "\n</div>\n</body>\n</html>\n"))
+      (unless body-only (insert "\n</body>\n</html>\n"))
 
       (unless (plist-get opt-plist :buffer-will-be-killed)
 	(normal-mode)

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [patch] Re: HTML Postamble is inside Content DIV
  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
  1 sibling, 1 reply; 15+ messages in thread
From: Jambunathan K @ 2011-07-21 23:35 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Hi Pierre, Bastien et al.,
>
> Pierre de Buyl wrote:
>> Le 8 juil. 11 à 09:36, Sebastien Vauban a écrit :
>>>> 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 CSS:
>>>>
>>>> - The first part is a container div ("content", by default) that
>>>> surrounds
>>>>   everything.
>>>>
>>>> - 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).
>>>
>>> Any objection for applying this patch?
>>
>> Not at all.
>
> After off-line discussion with Bastien, here is the updated proposition --
> and patch!
>
> There is no global DIV anymore directly inside the body, as there is already
> (in CSS) a virtual DIV called "#body"...
>
> Inside the "body" tags, 3 DIV:
>
> - "preamble" (useful for adding a static menu, outside of the "content" DIV)
> - "content" (by default, see "org-export-html-content-div")
> - "postamble"
>
> Preamble and postamble DIV are only inserted if they're not void.
>
> The "content" DIV (name free to be customized) will always be inserted.
>
> Any comment or objection?

Specifically can it do this:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00524.html

I think having <div class="presentation"> is significant for org-s5
(though I haven't verified it). What the org-s5 use-case emphasizes is
that the user should have the flexibility to add attributes of his own
choosing to the div element and not merely the name of the id tag.

I see that there has been a lot of ping-ponging around this area for a
while now and you now seem to have a new proposal at hand. Your patch
seems to be touching Bastien's commit pursuant to my above request
[1]. I don't understand or use html or org-s5. I hope the proposal here
is the final one :-). Please make Eric Schulte a respondent or reviewer
for this patch (from org-s5 side of things) and insist on a feedback
from him before committing..

ps: I would desire that any changes to org-html.el also need to be
ported to org-lparse.el and (or) org-xhtml.el.

Jambunathan K.

>
> Best regards,
>   Seb


Footnotes: 

[1] I was not happy with Bastien's change which I felt was ignoring the
core of my proposal)

-- 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Re: HTML Postamble is inside Content DIV
  2011-07-21 20:47                   ` [patch] " Sebastien Vauban
  2011-07-21 23:35                     ` Jambunathan K
@ 2011-07-23 17:11                     ` Bastien
  2011-07-23 21:58                       ` Sebastien Vauban
  1 sibling, 1 reply; 15+ messages in thread
From: Bastien @ 2011-07-23 17:11 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sebastien,

thanks a lot for the patch.  

I've just committed a modified version of it:

  http://orgmode.org/w/?p=org-mode.git;a=commit;h=2f1fbc58be1dc48621217d666da7bc46c3c5d84e

Putting "preamble", "content" and "postamble" in a new variable
`org-export-html-divs' (which see).  The old variable
`org-export-html-content-div' is still here for compatibility 
reasons, but is not customizable anymore.

> Any comment or objection?

One comment: thanks for bringing this up :)

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Re: HTML Postamble is inside Content DIV
  2011-07-23 17:11                     ` Bastien
@ 2011-07-23 21:58                       ` Sebastien Vauban
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastien Vauban @ 2011-07-23 21:58 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> thanks a lot for the patch.  
>
> I've just committed a modified version of it:
>
>   http://orgmode.org/w/?p=org-mode.git;a=commit;h=2f1fbc58be1dc48621217d666da7bc46c3c5d84e
>
> Putting "preamble", "content" and "postamble" in a new variable
> `org-export-html-divs' (which see).  The old variable
> `org-export-html-content-div' is still here for compatibility 
> reasons, but is not customizable anymore.

Just reviewed it. Very nice addition. Thanks for committing it.

>> Any comment or objection?
>
> One comment: thanks for bringing this up :)

You're welcome!

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [patch] Re: HTML Postamble is inside Content DIV
  2011-07-21 23:35                     ` Jambunathan K
@ 2011-07-24 18:56                       ` Bastien
  0 siblings, 0 replies; 15+ messages in thread
From: Bastien @ 2011-07-24 18:56 UTC (permalink / raw)
  To: Jambunathan K; +Cc: public-emacs-orgmode-mXXj517/zsQ, Sebastien Vauban



Jambunathan,

Jambunathan K <kjambunathan@gmail.com> writes:

> Specifically can it do this:
> http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00524.html

We can modified the structure of `org-export-html-divs' so that it is an
alist instead of a list, with div ids and associated attributes.

If you think that's a good direction, can you provide a patch for this?

> I see that there has been a lot of ping-ponging around this area for a
> while now and you now seem to have a new proposal at hand. Your patch
> seems to be touching Bastien's commit pursuant to my above request
> [1]. 

Well, I didn't really like this proposed variable:

#+begin_src emacs-lisp
  (defcustom org-export-html-content-div "%s <div %s> %s"
    "The name of the container DIV that holds all the page contents."
    :group 'org-export-htmlize
    :type 'string)
#+end_src

It is not simple enough to my eyes...

> I don't understand or use html or org-s5. I hope the proposal here
> is the final one :-). 

I hope nothing is final in this world.  :)

> Please make Eric Schulte a respondent or reviewer
> for this patch (from org-s5 side of things) and insist on a feedback
> from him before committing..

I committed this yesterday.

> ps: I would desire that any changes to org-html.el also need to be
> ported to org-lparse.el and (or) org-xhtml.el.

(Can you take charge of this?)

This is the main reason why having duplicate code in this area is a
burden.

I still think our energy will be better spent by progressively adding
things from org-xhtml.el to org-html.el, feature by feature.  This is a
lot of (possibly boring) work, but being lazy now will just make it even
more difficult later.

In any case, working on porting changes from org-html.el to org-xhtml.el
isn't the right direction.

Let's keep up the good work!

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-07-24 19:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29 22:15 HTML Postamble is inside Content DIV 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
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

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