emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Publishing multiple projects


From: Nick Dokos
Subject: Re: [O] Publishing multiple projects
Date: Wed, 16 Mar 2016 17:26:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Michael Welle <address@hidden> writes:

> Hello,
>
> Giuseppe Lipari <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]