Michael Welle <mwe012...@gmx.net> writes: > Hello, > > Giuseppe Lipari <giulip...@gmail.com> 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