emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Publish project alist in org-mode 8 - confusing documentation
@ 2014-03-06 19:00 Gez
  2014-03-06 20:56 ` Richard Lawrence
  0 siblings, 1 reply; 3+ messages in thread
From: Gez @ 2014-03-06 19:00 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

Can someone give me some hints for how to set up a publishing project in
org-mode 8?  Am I right in thinking that I can't use easy customization to
set up a publish project alist?

I've been reading various links such as

http://orgmode.org/worg/exporters/ox-overview.html
http://orgmode.org/worg/org-8.0.html

and even

http://orgmode.org/worg/exporters/ox-docstrings.html and
http://orgmode.org/worg/exporters/org-element-docstrings.html

but since I'm not at all a power user I find myself rather lost.  I
generally rely on the customization browsers to do most of my
configuration.  I do sometimes edit .emacs manually but normally closely
following an example. I'd really like to set up a project based on the worg
tutorial at

http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html

but I don't know where to begin adapting it to the new export framework.

For example, I'd be very grateful if someone could "translate" the
following (or something more simple) into org-mode 8 version, so I can
start evaluating and playing with it.

(require 'org-publish)
(setq org-publish-project-alist
      '(
("org-notes"
 :base-directory "~/org/"
 :base-extension "org"
 :publishing-directory "~/public_html/"
 :recursive t
 :publishing-function org-publish-org-to-html
 :headline-levels 7
 :auto-preamble t
 )
("org-static"
 :base-directory "~/org/"
 :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
 :publishing-directory "~/public_html/"
 :recursive t
 :publishing-function org-publish-attachment
 )
("org" :components ("org-notes" "org-static"))
      ))

Many thanks!
Gez
Org-mode version 8.2.5h (8.2.5h-30-gdd810b-elpa
GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200)

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

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

* Re: Publish project alist in org-mode 8 - confusing documentation
  2014-03-06 19:00 Publish project alist in org-mode 8 - confusing documentation Gez
@ 2014-03-06 20:56 ` Richard Lawrence
  2014-03-07 18:21   ` Gez
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Lawrence @ 2014-03-06 20:56 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: suleika

Hi Gez,

Gez <suleika@gmail.com> writes:

> but I don't know where to begin adapting it to the new export framework.
>
> For example, I'd be very grateful if someone could "translate" the
> following (or something more simple) into org-mode 8 version, so I can
> start evaluating and playing with it.
>
> (require 'org-publish)
> (setq org-publish-project-alist
>       '(
> ("org-notes"
>  :base-directory "~/org/"
>  :base-extension "org"
>  :publishing-directory "~/public_html/"
>  :recursive t
>  :publishing-function org-publish-org-to-html

It's been a while since I converted my publishing setup to the new
exporter, but I *think* the only change you need to make here is to the
:publishing-function option.  

The function you want here is now called org-html-publish-to-html.
There are other similar functions in the other export backends -- e.g.,
the function to publish to PDF is org-latex-publish-to-pdf.

Thus, if you need to find an appropriate publishing function, start by
looking for a function named like: org-BACKEND-publish-to-FORMAT.  I
don't remember how I figured this out, but hopefully it is documented in
the manual...

(I am not sure about the :recursive or :auto-preamble options, which
don't appear in the variable documentation for
org-publish-project-alist; if changing :publishing-function on its own
does not get this setup working, try removing those options.)

>  :headline-levels 7
>  :auto-preamble t
>  )
> ("org-static"
>  :base-directory "~/org/"
>  :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
>  :publishing-directory "~/public_html/"
>  :recursive t
>  :publishing-function org-publish-attachment
>  )
> ("org" :components ("org-notes" "org-static"))
>       ))

Again, I think this should work as-is, with the possible exception of
the :recursive option.  org-publish-attachment is still around.

Hope that helps!

Best,
Richard

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

* Re: Publish project alist in org-mode 8 - confusing documentation
  2014-03-06 20:56 ` Richard Lawrence
@ 2014-03-07 18:21   ` Gez
  0 siblings, 0 replies; 3+ messages in thread
From: Gez @ 2014-03-07 18:21 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

>Richard Lawrence <richard.lawrence@berkeley.edu> writes:
>
> Gez <suleika@gmail.com> writes:
>
> > but I don't know where to begin adapting it to the new export framework.
> >
> > For example, I'd be very grateful if someone could "translate" the
> > following (or something more simple) into org-mode 8 version, so I can
> > start evaluating and playing with it.
> >
> > (require 'org-publish)
> > (setq org-publish-project-alist
> >       '(
> > ("org-notes"
> >  :base-directory "~/org/"
> >  :base-extension "org"
> >  :publishing-directory "~/public_html/"
> >  :recursive t
> >  :publishing-function org-publish-org-to-html
>
> It's been a while since I converted my publishing setup to the new
> exporter, but I *think* the only change you need to make here is to the
> :publishing-function option.
>
> The function you want here is now called org-html-publish-to-html.
> There are other similar functions in the other export backends -- e.g.,
> the function to publish to PDF is org-latex-publish-to-pdf.
>
> Thus, if you need to find an appropriate publishing function, start by
> looking for a function named like: org-BACKEND-publish-to-FORMAT.  I
> don't remember how I figured this out, but hopefully it is documented in
> the manual...

Thanks - in fact, the first issue was the first line:

(require 'org-publish)

which gave the error message

eval: Cannot open load file: org-publish

But I guessed I needed to replace it with:

(require 'ox-publish)

And that fixed it.  As for the function you mentioned, I checked
http://orgmode.org/worg/org-8.0.html#sec-5-2 and replaced
org-publish-org-to-html with org-html-publish-to-html.  And I got
something to publish.  Now that it's basically working I can play
around with the options etc. Many thanks.

By the way, sorry if this isn't threaded correctly; I didn't receive
these emails (mine and the reply) from the list so I couldn't reply.
I have checked my mailman settings and I'm supposed to receive my own
posts.  :-(

Gez

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

end of thread, other threads:[~2014-03-07 18:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 19:00 Publish project alist in org-mode 8 - confusing documentation Gez
2014-03-06 20:56 ` Richard Lawrence
2014-03-07 18:21   ` Gez

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