全部博文(43)
分类:
2011-08-01 09:17:53
;;(setq org-agenda-files `org-publish-files-alist)
(require 'org-publish)
(setq note-root-dir
(file-name-directory (or load-file-name (buffer-file-name))))
(setq note-publish-dir
(expand-file-name "public_html" (directory-file-name
(file-name-directory
(directory-file-name note-root-dir)))))
(setq org-publish-project-alist
`(("note-org"
:base-directory ,note-root-dir
:publishing-directory ,note-publish-dir
:base-extension "org"
:recursive t
:publishing-function org-publish-org-to-html
:auto-index t
:index-filename "index.org"
:index-title "index"
:link-home "index.html")
("note-static"
:base-directory ,note-root-dir
:publishing-directory ,note-publish-dir
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
:recursive t
:publishing-function org-publish-attachment)
("note" :components ("note-org" "note-static"))))
;; "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
(defcustom org-export-html-style
"" ""
:group 'org-export-html
:type 'string)
(defvar org-todo-files nil)
(setq org-agenda-files nil)
(defun org-get-todo-files-1 (base-dir &optional recurse match skip-file skip-dir)
(mapc (lambda (f)
(let ((fd-p (file-directory-p f))
(fnd (file-name-nondirectory f)))
(if (and fd-p recurse
(not (string-match "^\\.+$" fnd))
(if skip-dir (not (string-match skip-dir fnd)) t))
(org-get-todo-files-1 f recurse match skip-file skip-dir)
(unless (or fd-p ;; this is a directory
(and skip-file (string-match skip-file fnd))
(not (file-exists-p (file-truename f)))
(not (string-match match fnd)))
(pushnew f org-agenda-files)))))
(directory-files base-dir t (unless recurse match))))
(org-get-todo-files-1 note-root-dir t (concat "^[^\\.].*\\.\\(" "org" "") )
(list org-agenda-files)