Browse Source

ox-publish: Do not create an "* Index" headline in "theindex.inc"

* lisp/ox-publish.el (org-publish-index-generate-theindex): Do not
  create an "* Index" headline in "theindex.inc".  Though, create an
  "Index" title in fallback "theindex.org".
Nicolas Goaziou 12 years ago
parent
commit
1513f89f7e
1 changed files with 4 additions and 8 deletions
  1. 4 8
      lisp/ox-publish.el

+ 4 - 8
lisp/ox-publish.el

@@ -967,7 +967,6 @@ publishing directory."
 	  (unless (member term full-index) (push term full-index)))))
     ;; Write "theindex.inc" in DIRECTORY.
     (with-temp-file (expand-file-name "theindex.inc" directory)
-      (insert "* Index\n")
       (let ((current-letter nil) (last-entry nil))
 	(dolist (idx full-index)
 	  (let* ((entry (org-split-string (car idx) "!"))
@@ -979,7 +978,7 @@ publishing directory."
 			(plist-get (cdr project) :base-directory))))
 	    ;; Check if another letter has to be inserted.
 	    (unless (string= letter current-letter)
-	      (insert (format "** %s\n" letter)))
+	      (insert (format "* %s\n" letter)))
 	    ;; Compute the first difference between last entry and
 	    ;; current one: it tells the level at which new items
 	    ;; should be added.
@@ -1010,15 +1009,12 @@ publishing directory."
 		       (car (last entry)))))
 		  "\n"))))
 	    (setq current-letter letter last-entry entry))))
-      ;; Write "theindex.org" if it doesn't exist.  The combination
-      ;; "theindex.inc" and conditional "theindex.org" allows for
-      ;; a greater flexibility for the user, since he can provide its
-      ;; own "theindex.org", inserting "theindex.inc" wherever he
-      ;; wants.
+      ;; Create "theindex.org", if it doesn't exist yet, and provide
+      ;; a default index file.
       (let ((index.org (expand-file-name "theindex.org" directory)))
 	(unless (file-exists-p index.org)
 	  (with-temp-file index.org
-	    (insert "\n\n#+INCLUDE: \"theindex.inc\"\n\n")))))))
+	    (insert "#+TITLE: Index\n\n#+INCLUDE: \"theindex.inc\"\n\n")))))))