emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Struggling with new exporter
@ 2014-09-22 19:50 Phillip Lord
  2014-09-22 20:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Lord @ 2014-09-22 19:50 UTC (permalink / raw)
  To: emacs-orgmode



I'm rather struggling with the new exporter. I fear I have used a
combination of old and new configuration which cannot be helping.
I am trying to get publishing working mostly in batch, so that it will
work as part of my continuous integration framework. But having it work
interactively would be nice also.

I have installed the org-mode daily from the Org ELPA. I have a file
called book.org, which also includes several other files.

I want to publish to HTML and PDF. It would be nice to publish to
some kind of chunked HTML also, as the file will get quite long, but for
the moment I can live with out this.


The headers look like this:

#+LATEX_HEADER: \usepackage{tawny}
#+LATEX_HEADER: \lstnewenvironment{tawny}{\lstset{style=tawnystyle}}{}

#+BIND: org-publishing-directory "./exports"
#+BIND: org-latex-custom-lang-environments ((clojure "tawny"))
#+BIND: org-latex-listings t

Tawny is my own package, and is present in the same location as the org
file. It provides the syntax highlighting support latex. 

Now, by original batch build commands looked like this...

(defun build/pdf ()
  (with-current-buffer
      (find-file-noselect build-source-file)
    (org-export-as-pdf
     org-export-headline-levels)))

(defun build/html ()
  (init-faces)
  (setq htmlize-use-rgb-map 'force)
  (with-current-buffer
      (find-file-noselect build-source-file))
    (org-export-as-html-batch org-export-headline-levels))

but these are using the old org-export functions.

My current version looks like this...

(defun build/html ()
  (init-faces)
  (setq htmlize-use-rgb-map 'force)
  (with-current-buffer
      (find-file-noselect build-source-file))
  (org-html-publish-to-html
   ;; publishing plist
   nil
   ;; output file name
   "book.html"
   ;; directory
   "exports"))

Which is crashing with:

Debugger entered--Lisp error: (error "`org-publish-cache-get' called, but no cache present")
  signal(error ("`org-publish-cache-get' called, but no cache present"))
  error("`org-publish-cache-get' called, but no cache present")

Interactively, the publishing works BUT the bind forms appear to do
nothing. My source code is coming up verbatim and the publishing
directory is being ignored.

Any help gratefully recieved!

Phil

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

* Re: Struggling with new exporter
  2014-09-22 19:50 Struggling with new exporter Phillip Lord
@ 2014-09-22 20:15 ` Nicolas Goaziou
  2014-09-23  8:55   ` Phillip Lord
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-09-22 20:15 UTC (permalink / raw)
  To: Phillip Lord; +Cc: emacs-orgmode

Hello,

phillip.lord@newcastle.ac.uk (Phillip Lord) writes:

> I'm rather struggling with the new exporter. I fear I have used a
> combination of old and new configuration which cannot be helping.
> I am trying to get publishing working mostly in batch, so that it will
> work as part of my continuous integration framework. But having it work
> interactively would be nice also.
>
> I have installed the org-mode daily from the Org ELPA. I have a file
> called book.org, which also includes several other files.
>
> I want to publish to HTML and PDF. It would be nice to publish to
> some kind of chunked HTML also, as the file will get quite long, but for
> the moment I can live with out this.
>
>
> The headers look like this:
>
> #+LATEX_HEADER: \usepackage{tawny}
> #+LATEX_HEADER: \lstnewenvironment{tawny}{\lstset{style=tawnystyle}}{}
>
> #+BIND: org-publishing-directory "./exports"
> #+BIND: org-latex-custom-lang-environments ((clojure "tawny"))
> #+BIND: org-latex-listings t
>
> Tawny is my own package, and is present in the same location as the org
> file. It provides the syntax highlighting support latex. 
>
> Now, by original batch build commands looked like this...
>
> (defun build/pdf ()
>   (with-current-buffer
>       (find-file-noselect build-source-file)
>     (org-export-as-pdf
>      org-export-headline-levels)))
>
> (defun build/html ()
>   (init-faces)
>   (setq htmlize-use-rgb-map 'force)
>   (with-current-buffer
>       (find-file-noselect build-source-file))
>     (org-export-as-html-batch org-export-headline-levels))
>
> but these are using the old org-export functions.
>
> My current version looks like this...
>
> (defun build/html ()
>   (init-faces)
>   (setq htmlize-use-rgb-map 'force)
>   (with-current-buffer
>       (find-file-noselect build-source-file))
>   (org-html-publish-to-html
>    ;; publishing plist
>    nil
>    ;; output file name
>    "book.html"
>    ;; directory
>    "exports"))
>
> Which is crashing with:

[...]

`org-html-publish-to-html' is not meant to be called directly, but
rather used in a project definition as a :publishing-function value.

Speaking of which, why don't you simply create a proper project-alist
and call `org-publish' on it (interactively or not)?

If you simply want to export a single file, then the correct functions
are `org-latex-export-to-pdf' and `org-html-export-to-html'. Note that
the first (optional) argument isn't the maximum headline level anymore,
so don't call any of them with `org-export-headline-levels'. 


HTH,

-- 
Nicolas Goaziou

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

* Re: Struggling with new exporter
  2014-09-22 20:15 ` Nicolas Goaziou
@ 2014-09-23  8:55   ` Phillip Lord
  2014-09-23 21:35     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Lord @ 2014-09-23  8:55 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> [...]
>
> `org-html-publish-to-html' is not meant to be called directly, but
> rather used in a project definition as a :publishing-function value.
>
> Speaking of which, why don't you simply create a proper project-alist
> and call `org-publish' on it (interactively or not)?


Okay, I've done it this way. Took a bit of fiddling since I need the
project-alist to work in different configurations (i.e. interactively,
in batch and in batch on a CI machine). Also, the timestamp stuff
confused me -- org was skipping publication, even though the output file
had been deleted.

This part...

#+BIND: org-latex-custom-lang-environments ((clojure "tawny"))
#+BIND: org-latex-listings t

isn't working at the moment. Source listings are coming out in verbatim.
Can I set this in the project-alist. From looking at org-latex-src-block
it would appear not.

Phil

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

* Re: Struggling with new exporter
  2014-09-23  8:55   ` Phillip Lord
@ 2014-09-23 21:35     ` Nicolas Goaziou
  2014-09-24 11:44       ` Phillip Lord
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-09-23 21:35 UTC (permalink / raw)
  To: Phillip Lord; +Cc: emacs-orgmode

Hello,

phillip.lord@newcastle.ac.uk (Phillip Lord) writes:

> Okay, I've done it this way. Took a bit of fiddling since I need the
> project-alist to work in different configurations (i.e. interactively,
> in batch and in batch on a CI machine). Also, the timestamp stuff
> confused me -- org was skipping publication, even though the output file
> had been deleted.

You can force re-pulication.

> This part...
>
> #+BIND: org-latex-custom-lang-environments ((clojure "tawny"))
> #+BIND: org-latex-listings t
>
> isn't working at the moment. Source listings are coming out in verbatim.
> Can I set this in the project-alist. From looking at org-latex-src-block
> it would appear not.

On the development branch, you can add ":latex-listings t" property in
your project definition. In maint branch, you may dynamically bind
`org-latex-listings' around project publishing function call.


Regards,

-- 
Nicolas Goaziou

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

* Re: Struggling with new exporter
  2014-09-23 21:35     ` Nicolas Goaziou
@ 2014-09-24 11:44       ` Phillip Lord
  0 siblings, 0 replies; 5+ messages in thread
From: Phillip Lord @ 2014-09-24 11:44 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>> Okay, I've done it this way. Took a bit of fiddling since I need the
>> project-alist to work in different configurations (i.e. interactively,
>> in batch and in batch on a CI machine). Also, the timestamp stuff
>> confused me -- org was skipping publication, even though the output file
>> had been deleted.
>
> You can force re-pulication.

Yes, I did. I was confused by the skipping though -- I was expecting
make like behaviour -- where the output was checked. Still, it's fixed
now.

>> #+BIND: org-latex-custom-lang-environments ((clojure "tawny"))
>> #+BIND: org-latex-listings t
>>
>> isn't working at the moment. Source listings are coming out in verbatim.
>> Can I set this in the project-alist. From looking at org-latex-src-block
>> it would appear not.
>
> On the development branch, you can add ":latex-listings t" property in
> your project definition. In maint branch, you may dynamically bind
> `org-latex-listings' around project publishing function call.

Okay.

Currently, it appears to be that the org-latex-publish-to-pdf isn't
respecting :publishing-directory in the project-alist, so I am
publishing to latex and compiling by hand from there. I had to do this
anyway, because in batch, emacs swallows the latex output which makes
errors very hard to detect.

Thanks for the help.

Phil

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

end of thread, other threads:[~2014-09-25  4:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 19:50 Struggling with new exporter Phillip Lord
2014-09-22 20:15 ` Nicolas Goaziou
2014-09-23  8:55   ` Phillip Lord
2014-09-23 21:35     ` Nicolas Goaziou
2014-09-24 11:44       ` Phillip Lord

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