* index-title in org-publish
@ 2008-11-16 16:51 Matthew Lundin
2008-11-16 18:50 ` Carsten Dominik
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Lundin @ 2008-11-16 16:51 UTC (permalink / raw
To: emacs-orgmode
Carsten,
Thanks so much for fixing the open buffer problem with auto-index was
turned on in org-publish. All buffers now close properly after
publishing.
There is a new behavior in auto-index with 6.12. The index-title now
is written in the index-file as a heading, rather than the first line
of text.
Let's say I have the following options in org-publish-project-alist:
...
:auto-index t
:index-filename "pagelist.org"
:index-title "Page List"
...
In earlier versions of org-publish, auto-index resulted in a
pagelist.org that looked like this:
Page List
+ [[file1.org][File One]]
+ [[file2.org][File Two]]
With 6.12, it creates a pagelist.org file that looks like this:
* Page List
+ [[file1.org][File One]]
+ [[file2.org][File Two]]
In the latter instance, the published html has the name of the
file--"pagelist"--as the title (<h1>) and "Page List" as a level two
heading (<h2>).
Thanks! (And sorry to bother you with such a minor issue...)
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: index-title in org-publish
2008-11-16 16:51 index-title in org-publish Matthew Lundin
@ 2008-11-16 18:50 ` Carsten Dominik
2008-11-16 22:38 ` Matthew Lundin
0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2008-11-16 18:50 UTC (permalink / raw
To: Matthew Lundin; +Cc: emacs-orgmode
On Nov 16, 2008, at 5:51 PM, Matthew Lundin wrote:
>
> Carsten,
>
> Thanks so much for fixing the open buffer problem with auto-index was
> turned on in org-publish. All buffers now close properly after
> publishing.
>
> There is a new behavior in auto-index with 6.12. The index-title now
> is written in the index-file as a heading, rather than the first line
> of text.
>
> Let's say I have the following options in org-publish-project-alist:
>
> ...
> :auto-index t
> :index-filename "pagelist.org"
> :index-title "Page List"
> ...
>
> In earlier versions of org-publish, auto-index resulted in a
> pagelist.org that looked like this:
>
> Page List
>
> + [[file1.org][File One]]
> + [[file2.org][File Two]]
>
> With 6.12, it creates a pagelist.org file that looks like this:
>
> * Page List
>
> + [[file1.org][File One]]
> + [[file2.org][File Two]]
>
> In the latter instance, the published html has the name of the
> file--"pagelist"--as the title (<h1>) and "Page List" as a level two
> heading (<h2>).
>
> Thanks! (And sorry to bother you with such a minor issue...)
>
> Matt
Hi Matt,
from your post it is not clear to me what you would like to have
changed. Also in this iisues are usually follow Sebastian Rose's
adice who also made the change you are mentioning. Sebastian, could
you chime in here?
- Carsten
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: index-title in org-publish
2008-11-16 18:50 ` Carsten Dominik
@ 2008-11-16 22:38 ` Matthew Lundin
2008-11-17 11:59 ` Sebastian Rose
2008-11-17 13:45 ` Carsten Dominik
0 siblings, 2 replies; 6+ messages in thread
From: Matthew Lundin @ 2008-11-16 22:38 UTC (permalink / raw
To: Carsten Dominik; +Cc: emacs-orgmode
Carsten Dominik <dominik@science.uva.nl> writes:
> On Nov 16, 2008, at 5:51 PM, Matthew Lundin wrote:
>
>>
>> Carsten,
>>
>> Thanks so much for fixing the open buffer problem with auto-index was
>> turned on in org-publish. All buffers now close properly after
>> publishing.
>>
>> There is a new behavior in auto-index with 6.12. The index-title now
>> is written in the index-file as a heading, rather than the first line
>> of text.
>>
>> Let's say I have the following options in org-publish-project-alist:
>>
>> ...
>> :auto-index t
>> :index-filename "pagelist.org"
>> :index-title "Page List"
>> ...
>>
>> In earlier versions of org-publish, auto-index resulted in a
>> pagelist.org that looked like this:
>>
>> Page List
>>
>> + [[file1.org][File One]]
>> + [[file2.org][File Two]]
>>
>> With 6.12, it creates a pagelist.org file that looks like this:
>>
>> * Page List
>>
>> + [[file1.org][File One]]
>> + [[file2.org][File Two]]
>>
>> In the latter instance, the published html has the name of the
>> file--"pagelist"--as the title (<h1>) and "Page List" as a level two
>> heading (<h2>).
>>
>> Thanks! (And sorry to bother you with such a minor issue...)
>>
>> Matt
>
> Hi Matt,
>
> from your post it is not clear to me what you would like to have
> changed. Also in this iisues are usually follow Sebastian Rose's
> adice who also made the change you are mentioning. Sebastian, could
> you chime in here?
>
> - Carsten
Hi Carsten (and Sebastian),
Yes, so sorry. My post wasn't clear. I was wondering if
org-publish-org-index could be reverted to the old behavior to produce
a file in which the first line contains the index-filename (e.g.,
"Page List") in form "a" below:
Page List <------- (a) - old behavior
rather than
* Page List <------- (b) new behavior
The new behavior (b) causes the filename (e.g., "pagelist") to be
exported as the title, which results in redundant titles/headings in
the html. You can see the results new behavior at:
http://faculty.valpo.edu/mlundin/pagelist.html
Thanks,
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: index-title in org-publish
2008-11-16 22:38 ` Matthew Lundin
@ 2008-11-17 11:59 ` Sebastian Rose
2008-11-17 12:37 ` Carsten Dominik
2008-11-17 13:45 ` Carsten Dominik
1 sibling, 1 reply; 6+ messages in thread
From: Sebastian Rose @ 2008-11-17 11:59 UTC (permalink / raw
To: Matthew Lundin; +Cc: emacs-orgmode
Hi Matthew,
sorry, I'm off on weekends currently till I have a new machine at
home. My old omnibook broke lately :-(
> Hi Carsten (and Sebastian),
>
> Yes, so sorry. My post wasn't clear. I was wondering if
> org-publish-org-index could be reverted to the old behavior to produce
> a file in which the first line contains the index-filename (e.g.,
> "Page List") in form "a" below:
>
> Page List <------- (a) - old behavior
>
> rather than
>
> * Page List <------- (b) new behavior
>
> The new behavior (b) causes the filename (e.g., "pagelist") to be
> exported as the title, which results in redundant titles/headings in
> the html. You can see the results new behavior at:
>
> http://faculty.valpo.edu/mlundin/pagelist.html
This is due to the fact, that the structure of the exported index file
now is the same, as for all the other files. We did this partly, to
produce valid XHTML.
As an aside, the file now looks as all the other files. The solution is
not perfect, yes. There is the title, eventually a T.O.C. and a first
section (depends on your global setting), wich just repeats the title.
I will take a look in it - hm, was certainly not the best way to fix
it. It was the easiest way to get rid of thoses XHTML errors. I was not
aware of the index-title option and I don't use it, sorry for that.
The first thing that happens on export, is to produce a Org-file with
index-filename. This file is exported just like any other
Org-file. Since the export to XHTML is more complicated, this won't be
as easy as the (dubious) quick-fix I came up with, I fear.
The index-title should be correct.
In org-publish-org-index:
(index-title (or (plist-get project-plist :index-title)
(concat "Index for project " (car project))))
>>> Thanks! (And sorry to bother you with such a minor issue...)
Is there another way to advance?
OK, this patch would revert the change (I believe):
<<< --->8----------------------------->8----------------------------->8---
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 77ccd4f..5a46551 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -626,7 +626,7 @@ Default for INDEX-FILENAME is 'index.org'."
(if index-buffer
(kill-buffer index-buffer))
(with-temp-buffer
- (insert (concat "* " index-title "\n\n"))
+ (insert (concat "#+TITLE: " index-title "\n\n"))
(while (setq file (pop files))
(let ((fn (file-name-nondirectory file))
(link (file-relative-name file dir))
<<< ---8<-----------------------------8<-----------------------------8<---
Ahh - now as I read this, there is the index-title again, sorry.
The created Org-file now looks like this (for my test data on github):
<<< --->8----------------------------->8----------------------------->8---
#+TITLE: Sitemap
+ Databases
+ [[file:Databases/index.org][Databases]]
+ [[file:Databases/test-level-1.org][test-level-1]]
+ Emacs
+ [[file:Emacs/org-mode.org][Org-mode]]
+ Test-tree
+ Jack London
+ [[file:Test-tree/Jack London/The-white-fang.org][The White Fang]]
+ Paul-Auster
+ [[file:Test-tree/Paul-Auster/Moon-Palace.org][Moon Palace]]
+ [[file:Test-tree/Paul-Auster/test-level-2.org][Test level-2]]
+ [[file:Umlaut-test.org][Umlaut-test]]
+ [[file:footnotes-test.org][footnotes-test]]
+ [[file:index.org][Org export tests - main page]]
+ [[file:test-level-0.org][test-level-0]]
+ [[file:test-slides.org][Comming soon: Slides with Org-Mode and JavaScript]]
+ [[file:test-standard-export-options.org][Test of standard export options template]]
+ [[file:test-text-before-first-headline.org][test-text-before-first-headline]]
+ xhmtl-tests
+ [[file:xhmtl-tests/horizontal-line.org][horizontal-line]]
<<< ---8<-----------------------------8<-----------------------------8<---
But unfortunately, there is a '</div>' near the end of the resulting
XHTML file, which was never opened. This seems to be the bug I should
have have fixed before (there's a patch below):
sh$ xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd sitemap.html
sitemap.html:118: parser error : Opening and ending tag mismatch: body line 42 and div
</div>
^
sitemap.html:124: parser error : Opening and ending tag mismatch: html line 3 and body
</div></body>
^
sitemap.html:125: parser error : Extra content at the end of the document
</html>
The </div> element in question is the one after the <ul>:
=> --->8----------------------------->8----------------------------->8---
.....
<body>
<h1 id="title">Sitemap</h1>
<ul>
<li>
Databases
<ul>
...... lots of list items ....
</ul>
</div> <== HERE <div> never opened.
<= ---8<-----------------------------8<-----------------------------8<---
Carsten, is there an easy way to fix this? I believe it's these lines in
org-exp.el, since they alway insert an '</div>', no matter if we have a
section (which would insert the start tag '<div>'). This one fixes it. I
did my xmllint for all files in my test-repo, and it works.
=> --->8----------------------------->8----------------------------->8---
sh$ git-diff lisp/org-exp.el
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 3b9d1c9..88c2225 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -3510,7 +3510,7 @@ lang=\"%s\" xml:lang=\"%s\">
(and org-export-with-toc (<= level umax))
head-count)
;; the </div> to close the last text-... div.
- (insert "</div>\n")
+ (if have-headings (insert "</div>\n"))
(save-excursion
(goto-char (point-min))
<= ---8<-----------------------------8<-----------------------------8<---
Regards,
Sebastian
--
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.: +49 (0)511 - 36 58 472
Fax: +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Email: s.rose emma-stil de, sebastian_rose gmx de
Http: www.emma-stil.de
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: index-title in org-publish
2008-11-17 11:59 ` Sebastian Rose
@ 2008-11-17 12:37 ` Carsten Dominik
0 siblings, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2008-11-17 12:37 UTC (permalink / raw
To: Sebastian Rose; +Cc: emacs-orgmode
Hi Sebastian,
I actually fixed the bug with the superfluous </div>. So it should
now be no problem to remove the headline stars again.
- Carsten
On Nov 17, 2008, at 12:59 PM, Sebastian Rose wrote:
> Hi Matthew,
>
>
> sorry, I'm off on weekends currently till I have a new machine at
> home. My old omnibook broke lately :-(
>
>
>
>> Hi Carsten (and Sebastian),
>>
>> Yes, so sorry. My post wasn't clear. I was wondering if
>> org-publish-org-index could be reverted to the old behavior to
>> produce
>> a file in which the first line contains the index-filename (e.g.,
>> "Page List") in form "a" below:
>>
>> Page List <------- (a) - old behavior
>>
>> rather than
>>
>> * Page List <------- (b) new behavior
>>
>> The new behavior (b) causes the filename (e.g., "pagelist") to be
>> exported as the title, which results in redundant titles/headings in
>> the html. You can see the results new behavior at:
>>
>> http://faculty.valpo.edu/mlundin/pagelist.html
>
>
>
> This is due to the fact, that the structure of the exported index file
> now is the same, as for all the other files. We did this partly, to
> produce valid XHTML.
>
> As an aside, the file now looks as all the other files. The solution
> is
> not perfect, yes. There is the title, eventually a T.O.C. and a first
> section (depends on your global setting), wich just repeats the title.
>
> I will take a look in it - hm, was certainly not the best way to fix
> it. It was the easiest way to get rid of thoses XHTML errors. I was
> not
> aware of the index-title option and I don't use it, sorry for that.
>
> The first thing that happens on export, is to produce a Org-file with
> index-filename. This file is exported just like any other
> Org-file. Since the export to XHTML is more complicated, this won't be
> as easy as the (dubious) quick-fix I came up with, I fear.
>
>
> The index-title should be correct.
>
> In org-publish-org-index:
>
> (index-title (or (plist-get project-plist :index-title)
> (concat "Index for project " (car project))))
>
>
>>>> Thanks! (And sorry to bother you with such a minor issue...)
>
> Is there another way to advance?
>
>
>
>
> OK, this patch would revert the change (I believe):
>
> <<< --->8----------------------------->8-----------------------------
> >8---
> diff --git a/lisp/org-publish.el b/lisp/org-publish.el
> index 77ccd4f..5a46551 100644
> --- a/lisp/org-publish.el
> +++ b/lisp/org-publish.el
> @@ -626,7 +626,7 @@ Default for INDEX-FILENAME is 'index.org'."
> (if index-buffer
> (kill-buffer index-buffer))
> (with-temp-buffer
> - (insert (concat "* " index-title "\n\n"))
> + (insert (concat "#+TITLE: " index-title "\n\n"))
> (while (setq file (pop files))
> (let ((fn (file-name-nondirectory file))
> (link (file-relative-name file dir))
> <<<
> ---8<-----------------------------8<-----------------------------8<---
>
>
> Ahh - now as I read this, there is the index-title again, sorry.
>
>
>
> The created Org-file now looks like this (for my test data on github):
>
>
> <<< --->8----------------------------->8-----------------------------
> >8---
> #+TITLE: Sitemap
>
> + Databases
> + [[file:Databases/index.org][Databases]]
> + [[file:Databases/test-level-1.org][test-level-1]]
> + Emacs
> + [[file:Emacs/org-mode.org][Org-mode]]
> + Test-tree
> + Jack London
> + [[file:Test-tree/Jack London/The-white-fang.org][The White
> Fang]]
> + Paul-Auster
> + [[file:Test-tree/Paul-Auster/Moon-Palace.org][Moon Palace]]
> + [[file:Test-tree/Paul-Auster/test-level-2.org][Test level-2]]
> + [[file:Umlaut-test.org][Umlaut-test]]
> + [[file:footnotes-test.org][footnotes-test]]
> + [[file:index.org][Org export tests - main page]]
> + [[file:test-level-0.org][test-level-0]]
> + [[file:test-slides.org][Comming soon: Slides with Org-Mode and
> JavaScript]]
> + [[file:test-standard-export-options.org][Test of standard export
> options template]]
> + [[file:test-text-before-first-headline.org][test-text-before-
> first-headline]]
> + xhmtl-tests
> + [[file:xhmtl-tests/horizontal-line.org][horizontal-line]]
>
> <<<
> ---8<-----------------------------8<-----------------------------8<---
>
>
>
> But unfortunately, there is a '</div>' near the end of the resulting
> XHTML file, which was never opened. This seems to be the bug I should
> have have fixed before (there's a patch below):
>
>
> sh$ xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> sitemap.html
> sitemap.html:118: parser error : Opening and ending tag mismatch:
> body line 42 and div
> </div>
> ^
> sitemap.html:124: parser error : Opening and ending tag mismatch:
> html line 3 and body
> </div></body>
> ^
> sitemap.html:125: parser error : Extra content at the end of the
> document
> </html>
>
>
>
>
>
> The </div> element in question is the one after the <ul>:
>
> => --->8----------------------------->8-----------------------------
> >8---
>
> .....
>
> <body>
> <h1 id="title">Sitemap</h1>
>
> <ul>
> <li>
> Databases
> <ul>
>
> ...... lots of list items ....
>
> </ul>
> </div> <== HERE <div> never opened.
>
> <=
> ---8<-----------------------------8<-----------------------------8<---
>
>
>
>
> Carsten, is there an easy way to fix this? I believe it's these
> lines in
> org-exp.el, since they alway insert an '</div>', no matter if we
> have a
> section (which would insert the start tag '<div>'). This one fixes
> it. I
> did my xmllint for all files in my test-repo, and it works.
>
>
>
> => --->8----------------------------->8-----------------------------
> >8---
> sh$ git-diff lisp/org-exp.el
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 3b9d1c9..88c2225 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -3510,7 +3510,7 @@ lang=\"%s\" xml:lang=\"%s\">
> (and org-export-with-toc (<= level umax))
> head-count)
> ;; the </div> to close the last text-... div.
> - (insert "</div>\n")
> + (if have-headings (insert "</div>\n"))
>
> (save-excursion
> (goto-char (point-min))
>
> <=
> ---8<-----------------------------8<-----------------------------8<---
>
>
>
>
> Regards,
>
> Sebastian
>
>
> --
> Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449
> Hannover
>
> Tel.: +49 (0)511 - 36 58 472
> Fax: +49 (0)1805 - 233633 - 11044
> mobil: +49 (0)173 - 83 93 417
> Email: s.rose emma-stil de, sebastian_rose gmx de
> Http: www.emma-stil.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: index-title in org-publish
2008-11-16 22:38 ` Matthew Lundin
2008-11-17 11:59 ` Sebastian Rose
@ 2008-11-17 13:45 ` Carsten Dominik
1 sibling, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2008-11-17 13:45 UTC (permalink / raw
To: Matthew Lundin; +Cc: emacs-orgmode
On Nov 16, 2008, at 11:38 PM, Matthew Lundin wrote:
> [...] My post wasn't clear. I was wondering if
> org-publish-org-index could be reverted to the old behavior to produce
> a file in which the first line contains the index-filename (e.g.,
> "Page List") in form "a" below:
>
> Page List <------- (a) - old behavior
>
> rather than
>
> * Page List <------- (b) new behavior
>
> The new behavior (b) causes the filename (e.g., "pagelist") to be
> exported as the title, which results in redundant titles/headings in
> the html. You can see the results new behavior at:
Fixed, now, thanks.
- Carsten
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-17 13:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16 16:51 index-title in org-publish Matthew Lundin
2008-11-16 18:50 ` Carsten Dominik
2008-11-16 22:38 ` Matthew Lundin
2008-11-17 11:59 ` Sebastian Rose
2008-11-17 12:37 ` Carsten Dominik
2008-11-17 13:45 ` Carsten Dominik
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.