Function: org-publish-projects

org-publish-projects is a byte-compiled function defined in ox-publish.el.gz.

Signature

(org-publish-projects PROJECTS)

Documentation

Publish all files belonging to the PROJECTS alist.

If :auto-sitemap is set, publish the sitemap too. If
:makeindex is set, also produce a file "theindex.org".

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-publish.el.gz
(defun org-publish-projects (projects)
  "Publish all files belonging to the PROJECTS alist.
If `:auto-sitemap' is set, publish the sitemap too.  If
`:makeindex' is set, also produce a file \"theindex.org\"."
  (dolist (project (org-publish-expand-projects projects))
    (let ((plist (cdr project)))
      (let ((fun (org-publish-property :preparation-function project)))
	(cond
	 ((functionp fun) (funcall fun plist))
	 ((consp fun) (dolist (f fun) (funcall f plist)))))
      ;; Each project uses its own cache file.
      (org-publish-initialize-cache (car project))
      (when (org-publish-property :auto-sitemap project)
	(let ((sitemap-filename
	       (or (org-publish-property :sitemap-filename project)
		   "sitemap.org")))
	  (org-publish-sitemap project sitemap-filename)))
      ;; Publish all files from PROJECT except "theindex.org".  Its
      ;; publishing will be deferred until "theindex.inc" is
      ;; populated.
      (let ((theindex
	     (expand-file-name "theindex.org"
			       (org-publish-property :base-directory project))))
	(dolist (file (org-publish-get-base-files project))
	  (unless (file-equal-p file theindex)
	    (org-publish-file file project t)))
	;; Populate "theindex.inc", if needed, and publish
	;; "theindex.org".
	(when (org-publish-property :makeindex project)
	  (org-publish-index-generate-theindex
	   project (org-publish-property :base-directory project))
	  (org-publish-file theindex project t)))
      (let ((fun (org-publish-property :completion-function project)))
	(cond
	 ((functionp fun) (funcall fun plist))
	 ((consp fun) (dolist (f fun) (funcall f plist))))))
    (org-publish-write-cache-file)))