emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Publishing multiple projects
       [not found] <o7ljrcxnvb.ln2@news.c0t0d0s0.de>
@ 2016-03-16 11:09 ` Giuseppe Lipari
       [not found]   ` <1btorcxt8h.ln2@news.c0t0d0s0.de>
  0 siblings, 1 reply; 2+ messages in thread
From: Giuseppe Lipari @ 2016-03-16 11:09 UTC (permalink / raw)
  To: Michael Welle, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

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
-----

And my project.el
-----
(add-to-list 'load-path "~/elisp/org-mode/lisp") (add-to-list 'load-path
"~/elisp/org-mode/contrib/lisp") (require 'org) (require 'htmlize) (setq
c-standard-font-lock-fontify-region-function
'font-lock-default-fontify-region) (setq org-export-backends (quote (ascii
html icalendar latex odt md))) (org-babel-do-load-languages
'org-babel-load-languages '((dot . t) (emacs-lisp . t) (python . t) (ditaa
. t))) (custom-set-variables '(org-confirm-babel-evaluate nil)) (require
'ox-publish) (org-babel-lob-ingest "~/Copy/Documents/www/org-web/
navbar-code.org") (setq org-publish-project-alist '( ("org-notes"
:base-directory "~/Copy/Documents/www/org-web/" :base-extension "org"
:publishing-directory "~/Copy/Documents/www/public_html" :recursive t
:publishing-function org-html-publish-to-html :headline-levels 5 ; Just the
default for this project. :auto-preamble t ) ("org-static" :base-directory
"~/Copy/Documents/www/org-web/" :base-extension
"css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|config\\|sh\\|zip\\|c\\|h"
:publishing-directory "~/Copy/Documents/www/public_html" :recursive t
:publishing-function org-publish-attachment ) ("org" :components
("org-notes" "org-static")) ;; ... add all the components here (see
below)... )) ; (org-publish-remove-all-timestamps) (org-publish-project
"org")
----

Hope this helps

Giuseppe Lipari





Le lun. 14 mars 2016 à 22:01, Michael Welle <mwe012008@gmx.net> a écrit :

> Hello,
>
> I want to publish about 20 different projects into one web site. The
> projects don't share a common root directory (except /). Does that mean I
> need 41 (20 projects + 20 project-static + 1 meta project) entries in my
> org-publish-project-alist?
>
> Regards
> hmw
>
>
>

[-- Attachment #2: Type: text/html, Size: 2741 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Publishing multiple projects
       [not found]   ` <1btorcxt8h.ln2@news.c0t0d0s0.de>
@ 2016-03-16 21:26     ` Nick Dokos
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Dokos @ 2016-03-16 21:26 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-16 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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

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).