From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Publishing multiple projects Date: Wed, 16 Mar 2016 17:26:41 -0400 Message-ID: <87d1qu9kry.fsf@alphaville.usersys.redhat.com> References: <1btorcxt8h.ln2@news.c0t0d0s0.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agIy0-0006aY-E1 for emacs-orgmode@gnu.org; Wed, 16 Mar 2016 17:26:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agIxw-0007Yv-DJ for emacs-orgmode@gnu.org; Wed, 16 Mar 2016 17:26:56 -0400 Received: from plane.gmane.org ([80.91.229.3]:43187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agIxw-0007Y1-7O for emacs-orgmode@gnu.org; Wed, 16 Mar 2016 17:26:52 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1agIxu-00073u-C8 for emacs-orgmode@gnu.org; Wed, 16 Mar 2016 22:26:50 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Mar 2016 22:26:50 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Mar 2016 22:26:50 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Michael Welle writes: > Hello, > > Giuseppe Lipari writes: > >> Hello, >> >> I usually define each project into a separate project.el file, and I use a >> batch scripts for publishing, something like this: >> >> publish.sh: >> ----- >> emacs --batch -l batch_project.el --kill > ah, that makes sense. > > At the moment I have all projects in one file, separate from my org > configuration. It's a bit itching that all projects use virtually the > some property values. > I do the following for a set of similar projects: --8<---------------cut here---------------start------------->8--- ;; in my case, they are all subdirectories of a base directory ;; but you can iterate over a list of directories scattered all ;; over the place just as easily. ;; I set the publishing directory in the Makefile that publishes ;; everything: ;; ;; publish: ;; emacs -batch --eval '(setq publishing-directory "/ssh:${dest}/")'\ ;; --load foo-doc.el --eval '(org-publish "foo-doc")' (setq base-directory "/path/to/base/dir/") (defun publishing-entry (project) `(,project :base-directory ,(concat base-directory project) :base-extension "org" :publishing-directory ,(concat publishing-directory project) :publishing-function org-html-publish-to-html :headline-levels 3 :section-numbers nil :with-toc t :html-head ,html-head :html-preamble t)) (setq subdirs '("foo" "bar" "baz")) (setq org-publish-project-alist `( ... ,@(mapcar (function publishing-entry) subdirs) ("foo-doc" :components (...)))) --8<---------------cut here---------------end--------------->8--- Basically, the mapcar iterates over the subdirs list, calling the publishing-entry function on each one. The latter produces the entry for that subdir and the entries are spliced in. Note the backticks and the commas: they are important. See (info "(elisp) Backquote") HTH -- Nick