From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: index-title in org-publish Date: Mon, 17 Nov 2008 12:59:40 +0100 Message-ID: <873ahqd0lv.fsf@kassiopeya.MSHEIMNETZ> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L22j1-0005iP-88 for emacs-orgmode@gnu.org; Mon, 17 Nov 2008 06:57:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L22j0-0005i9-82 for emacs-orgmode@gnu.org; Mon, 17 Nov 2008 06:57:02 -0500 Received: from [199.232.76.173] (port=52208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L22j0-0005i6-0p for emacs-orgmode@gnu.org; Mon, 17 Nov 2008 06:57:02 -0500 Received: from mail.gmx.net ([213.165.64.20]:40170) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L22iz-0008W6-8o for emacs-orgmode@gnu.org; Mon, 17 Nov 2008 06:57:01 -0500 In-Reply-To: (Matthew Lundin's message of "Sun, 16 Nov 2008 16:38:02 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matthew Lundin Cc: emacs-orgmode@gnu.org 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 '' 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 ^ sitemap.html:124: parser error : Opening and ending tag mismatch: html line 3 and body ^ sitemap.html:125: parser error : Extra content at the end of the document The element in question is the one after the
    : => --->8----------------------------->8----------------------------->8--- .....

    Sitemap

    • Databases
        ...... lots of list items ....
      <== HERE
      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 '
      ', no matter if we have a section (which would insert the start tag '
      '). 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
      to close the last text-... div. - (insert "\n") + (if have-headings (insert "\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