mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-22 08:48:30 +00:00
Use theindex.inc and theindex.org as described in the manual.
* org-publish.el (org-publish-index-generate-theindex): Use theindex.inc for storing index entries, and theindex.org for including theindex.inc. Commit f0d7ac removed the theindex.inc and directly included index entries in theindex.org. This is not as flexible as using theindex.org as a page you want to manually edit, which can then include theindex.inc with proper content. Thanks to Stefan Vollmar for insisting about this issue.
This commit is contained in:
parent
a3ac9d80ed
commit
006d704145
|
@ -997,7 +997,7 @@ the project."
|
|||
(kill-buffer buf))
|
||||
(setq index (sort index (lambda (a b) (string< (downcase (car a))
|
||||
(downcase (car b))))))
|
||||
(setq ibuffer (find-file-noselect (expand-file-name "theindex.org" directory)))
|
||||
(setq ibuffer (find-file-noselect (expand-file-name "theindex.inc" directory)))
|
||||
(with-current-buffer ibuffer
|
||||
(erase-buffer)
|
||||
(insert "* Index\n")
|
||||
|
@ -1024,7 +1024,16 @@ the project."
|
|||
(insert " - " link "\n")
|
||||
(insert " - " link "\n")))
|
||||
(save-buffer))
|
||||
(kill-buffer ibuffer)))
|
||||
(kill-buffer ibuffer)
|
||||
;; Create theindex.org if it doesn't exist already
|
||||
(let ((index-file (expand-file-name "theindex.org" directory)))
|
||||
(unless (file-exists-p index-file)
|
||||
(setq ibuffer (find-file-noselect index-file))
|
||||
(with-current-buffer ibuffer
|
||||
(erase-buffer)
|
||||
(insert "\n\n#+include: \"theindex.inc\"\n\n")
|
||||
(save-buffer))
|
||||
(kill-buffer ibuffer)))))
|
||||
|
||||
;; Caching functions:
|
||||
|
||||
|
|
Loading…
Reference in a new issue