forked from mirrors/org-mode
New option :index-style for publishing.
Patch from Manuel Hermenegildo.
This commit is contained in:
parent
3c45a98032
commit
223f37f07e
|
@ -1,6 +1,7 @@
|
||||||
2008-07-09 Carsten Dominik <dominik@science.uva.nl>
|
2008-07-09 Carsten Dominik <dominik@science.uva.nl>
|
||||||
|
|
||||||
* org-publish.el (org-publish-find-title): Bug fix.
|
* org-publish.el (org-publish-find-title): Bug fix.
|
||||||
|
(org-publish-org-index): Implement new :index-style option.
|
||||||
|
|
||||||
2008-07-07 Carsten Dominik <dominik@science.uva.nl>
|
2008-07-07 Carsten Dominik <dominik@science.uva.nl>
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,12 @@ index of files or summary page for a given project.
|
||||||
:index-function Plugin function to use for generation of index.
|
:index-function Plugin function to use for generation of index.
|
||||||
Defaults to `org-publish-org-index', which
|
Defaults to `org-publish-org-index', which
|
||||||
generates a plain list of links to all files
|
generates a plain list of links to all files
|
||||||
in the project."
|
in the project.
|
||||||
|
:index-style Can be `list' (index is just an itemized list
|
||||||
|
of the titles of the files involved) or
|
||||||
|
`tree' (the directory structure of the source
|
||||||
|
files is reflected in the index). Defaults to
|
||||||
|
`tree'."
|
||||||
:group 'org-publish
|
:group 'org-publish
|
||||||
:type 'alist)
|
:type 'alist)
|
||||||
|
|
||||||
|
@ -607,6 +612,8 @@ Default for INDEX-FILENAME is 'index.org'."
|
||||||
(index-filename (concat dir (or index-filename "index.org")))
|
(index-filename (concat dir (or index-filename "index.org")))
|
||||||
(index-title (or (plist-get project-plist :index-title)
|
(index-title (or (plist-get project-plist :index-title)
|
||||||
(concat "Index for project " (car project))))
|
(concat "Index for project " (car project))))
|
||||||
|
(index-style (or (plist-get project-plist :index-style)
|
||||||
|
'tree))
|
||||||
(index-buffer (find-buffer-visiting index-filename))
|
(index-buffer (find-buffer-visiting index-filename))
|
||||||
(ifn (file-name-nondirectory index-filename))
|
(ifn (file-name-nondirectory index-filename))
|
||||||
file)
|
file)
|
||||||
|
@ -621,6 +628,9 @@ Default for INDEX-FILENAME is 'index.org'."
|
||||||
(oldlocal localdir))
|
(oldlocal localdir))
|
||||||
;; index shouldn't index itself
|
;; index shouldn't index itself
|
||||||
(unless (string= fn ifn)
|
(unless (string= fn ifn)
|
||||||
|
(if (eq index-style 'list)
|
||||||
|
(message "Generating list-style index for %s" index-title)
|
||||||
|
(message "Generating tree-style index for %s" index-title)
|
||||||
(setq localdir (concat (file-name-as-directory dir)
|
(setq localdir (concat (file-name-as-directory dir)
|
||||||
(file-name-directory link)))
|
(file-name-directory link)))
|
||||||
(unless (string= localdir oldlocal)
|
(unless (string= localdir oldlocal)
|
||||||
|
@ -635,11 +645,15 @@ Default for INDEX-FILENAME is 'index.org'."
|
||||||
(setq indent-str (make-string 2 ?\ ))
|
(setq indent-str (make-string 2 ?\ ))
|
||||||
(dolist (d subdirs)
|
(dolist (d subdirs)
|
||||||
(setq subdir (concat subdir d "/"))
|
(setq subdir (concat subdir d "/"))
|
||||||
(insert (concat indent-str " + [[file:" subdir "][" d "/]]\n"))
|
(insert (concat indent-str " + [[file:"
|
||||||
(setq indent-str (make-string (+ (length indent-str) 2) ?\ ))))))
|
subdir "][" d "/]]\n"))
|
||||||
|
(setq indent-str (make-string
|
||||||
|
(+ (length indent-str) 2) ?\ )))))))
|
||||||
|
;; This is common to 'flat and 'tree
|
||||||
(insert (concat indent-str " + [[file:" link "]["
|
(insert (concat indent-str " + [[file:" link "]["
|
||||||
(org-publish-find-title file)
|
(org-publish-find-title file)
|
||||||
"]]\n")))))
|
"]]\n"))
|
||||||
|
)))
|
||||||
(write-file index-filename)
|
(write-file index-filename)
|
||||||
(kill-buffer (current-buffer)))))
|
(kill-buffer (current-buffer)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue