emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Publishing multiple projects
Date: Wed, 16 Mar 2016 17:26:41 -0400	[thread overview]
Message-ID: <87d1qu9kry.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: 1btorcxt8h.ln2@news.c0t0d0s0.de

Michael Welle <mwe012008@gmx.net> writes:

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

      parent reply	other threads:[~2016-03-16 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <o7ljrcxnvb.ln2@news.c0t0d0s0.de>
2016-03-16 11:09 ` Publishing multiple projects Giuseppe Lipari
     [not found]   ` <1btorcxt8h.ln2@news.c0t0d0s0.de>
2016-03-16 21:26     ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1qu9kry.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).