emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* batch exporting
@ 2009-12-20 18:26 andrea
  2009-12-20 19:09 ` Nick Dokos
  0 siblings, 1 reply; 10+ messages in thread
From: andrea @ 2009-12-20 18:26 UTC (permalink / raw)
  To: emacs-orgmode


Given that I often would like to export to some formats I would like to
create the final script that handles everything.

If easy enough it can also be useful for non org users that still would
like to get the output formatted...

So my attempt is here
--8<---------------cut here---------------start------------->8---
#!/bin/bash

# Pass as input the file you want to convert to html

FILE=$1

if ! test -f $FILE
then
    echo "file not found"
else
    echo "converting file $FILE"
    # TODO putting a minimal init file
    emacs --batch \
	--eval "(add-to-list 'load-path \"$HOME/.emacs.d/org-mode/lisp/\")" \
	--load=$HOME/.emacs.d/org-mode/lisp/org.el \
	--visit=MyFile --funcall org-export-as-html-batch
fi

help() {
    echo "pass a file to export"
}

--8<---------------cut here---------------end--------------->8---

But it gives this error
*Wrong type argument: commandp, org-export-as-html-batch*

Then I would like to add some flags to export in different formats and
to set destination and source.

And by the way, the script given as example in the function help doesn't
work...

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

* Re: batch exporting
  2009-12-20 18:26 batch exporting andrea
@ 2009-12-20 19:09 ` Nick Dokos
  2009-12-20 22:43   ` andrea
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2009-12-20 19:09 UTC (permalink / raw)
  To: andrea.crotti.0; +Cc: emacs-orgmode

andrea <andrea.crotti.0@gmail.com> wrote:

> 
> Given that I often would like to export to some formats I would like to
> create the final script that handles everything.
> 
> If easy enough it can also be useful for non org users that still would
> like to get the output formatted...
> 
> So my attempt is here
> --8<---------------cut here---------------start------------->8---
> #!/bin/bash
> 
> # Pass as input the file you want to convert to html
> 
> FILE=$1
> 
> if ! test -f $FILE
> then
>     echo "file not found"
> else
>     echo "converting file $FILE"
>     # TODO putting a minimal init file
>     emacs --batch \
> 	--eval "(add-to-list 'load-path \"$HOME/.emacs.d/org-mode/lisp/\")" \
> 	--load=$HOME/.emacs.d/org-mode/lisp/org.el \
> 	--visit=MyFile --funcall org-export-as-html-batch
> fi
> 
> help() {
>     echo "pass a file to export"
> }
> 
> --8<---------------cut here---------------end--------------->8---
> 
> But it gives this error
> *Wrong type argument: commandp, org-export-as-html-batch*
> 
> Then I would like to add some flags to export in different formats and
> to set destination and source.
> 
> And by the way, the script given as example in the function help doesn't
> work...
> 
> 

See the thread at

    http://thread.gmane.org/gmane.emacs.orgmode/17059

HTH,
Nick

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

* Re: batch exporting
  2009-12-20 19:09 ` Nick Dokos
@ 2009-12-20 22:43   ` andrea
  2009-12-20 22:52     ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: andrea @ 2009-12-20 22:43 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> See the thread at
>
>     http://thread.gmane.org/gmane.emacs.orgmode/17059

I also tried the scripts from that thread (but it's actually the same
thing), I always get the same error.
What could that mean:

"converting file euler.org
Wrong type argument: commandp, org-export-as-html-batch"

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

* Re: Re: batch exporting
  2009-12-20 22:43   ` andrea
@ 2009-12-20 22:52     ` Carsten Dominik
  2009-12-21  7:27       ` andrea
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2009-12-20 22:52 UTC (permalink / raw)
  To: andrea; +Cc: emacs-orgmode


On Dec 20, 2009, at 11:43 PM, andrea wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
>
>> See the thread at
>>
>>    http://thread.gmane.org/gmane.emacs.orgmode/17059
>
> I also tried the scripts from that thread (but it's actually the same
> thing), I always get the same error.
> What could that mean:
>
> "converting file euler.org
> Wrong type argument: commandp, org-export-as-html-batch"

Have you tried (as the installation instructions say)

(require 'org-install)

??

- Carsten

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

* Re: batch exporting
  2009-12-20 22:52     ` Carsten Dominik
@ 2009-12-21  7:27       ` andrea
  2009-12-21 10:25         ` andrea Crotti
  2009-12-21 14:25         ` Nick Dokos
  0 siblings, 2 replies; 10+ messages in thread
From: andrea @ 2009-12-21  7:27 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Dec 20, 2009, at 11:43 PM, andrea wrote:
>
>> Nick Dokos <nicholas.dokos@hp.com> writes:
>>
>>> See the thread at
>>>
>>>    http://thread.gmane.org/gmane.emacs.orgmode/17059
>>
>> I also tried the scripts from that thread (but it's actually the same
>> thing), I always get the same error.
>> What could that mean:
>>
>> "converting file euler.org
>> Wrong type argument: commandp, org-export-as-html-batch"
>
> Have you tried (as the installation instructions say)
>
> (require 'org-install)
>
> ??
>
Now it goes a bit further

--8<---------------cut here---------------start------------->8---
    emacs   --batch \
	--eval "(add-to-list 'load-path \"$HOME/.emacs.d/org-mode/lisp/\")" \
	--eval "(require 'org-install)" \
	--load=$orglib/org.el \
	--visit=$1 --funcall org-export-as-html-batch
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
ip116-027:euler_project andrea$ org_html.sh euler.org 
converting file euler.org
Exporting...
htmlize.el 1.34 or later is needed for source code formatting
Exporting...
Exporting...
Wrong type argument: stringp, nil
--8<---------------cut here---------------end--------------->8---

How can I have more verbose errors by the way?

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

* Re: batch exporting
  2009-12-21  7:27       ` andrea
@ 2009-12-21 10:25         ` andrea Crotti
  2009-12-21 14:25         ` Nick Dokos
  1 sibling, 0 replies; 10+ messages in thread
From: andrea Crotti @ 2009-12-21 10:25 UTC (permalink / raw)
  To: emacs-orgmode

This is my whole error by the way if someone can understand what it means...

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  re-search-forward(nil nil t)
  org-export-remove-headline-metadata((:for-LaTeX t :emph-multiline t
  :add-text nil :comments nil :skip-before-1st-heading nil
  :LaTeX-fragments nil :timestamps t :footnotes t))
  org-export-preprocess-string("" :for-LaTeX t :emph-multiline t
  :add-text nil :comments nil :skip-before-1st-heading nil
  :LaTeX-fragments nil :timestamps t :footnotes t)
  org-export-latex-first-lines((:latex-image-options "width=10em"
  :exclude-tags ("noexport") :select-tags ("export") :email
  "andrea@44-131.eduroam.rwth-aachen.de" :author "andrea"
  :auto-postamble nil :auto-preamble nil :postamble nil :preamble nil
  :publishing-directory nil :timestamp nil :expand-quoted-html t
  :html-table-tag nil :xml-declaration nil :html-extension nil
  :inline-images nil :convert-org-links nil :agenda-style ""
  :style-extra nil :style nil :style-include-scripts nil
  :style-include-default nil :table-auto-headline t :tables t
  :time-stamp-file t ...) nil nil) org-export-as-latex(3 hidden)
  org-export-as-latex-batch() command-line-1(("--no-splash" "--eval"
  "(add-to-list 'load-path \"/Users/andrea/.emacs.d/org-mode/lisp/\")"
  "--eval" "(setq debug-on-error t)" "--eval" "(require 'org)"
  "--eval" "(require 'org-install)" "--visit=navigator.org" "-f"
  "org-export-as-latex-batch")) command-line() normal-top-level()

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

* Re: Re: batch exporting
  2009-12-21  7:27       ` andrea
  2009-12-21 10:25         ` andrea Crotti
@ 2009-12-21 14:25         ` Nick Dokos
  2009-12-21 14:51           ` andrea
  1 sibling, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2009-12-21 14:25 UTC (permalink / raw)
  To: andrea; +Cc: emacs-orgmode

andrea <andrea.crotti.0@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
> > On Dec 20, 2009, at 11:43 PM, andrea wrote:
> >
> >> Nick Dokos <nicholas.dokos@hp.com> writes:
> >>
> >>> See the thread at
> >>>
> >>>    http://thread.gmane.org/gmane.emacs.orgmode/17059
> >>
> >> I also tried the scripts from that thread (but it's actually the same
> >> thing), I always get the same error.
> >> What could that mean:
> >>
> >> "converting file euler.org
> >> Wrong type argument: commandp, org-export-as-html-batch"
> >
> > Have you tried (as the installation instructions say)
> >
> > (require 'org-install)
> >
> > ??
> >
> Now it goes a bit further
> 
>     emacs   --batch \
> 	--eval "(add-to-list 'load-path \"$HOME/.emacs.d/org-mode/lisp/\")" \
> 	--eval "(require 'org-install)" \
> 	--load=$orglib/org.el \
> 	--visit=$1 --funcall org-export-as-html-batch
> 
> ip116-027:euler_project andrea$ org_html.sh euler.org 
> converting file euler.org
> Exporting...
> htmlize.el 1.34 or later is needed for source code formatting
> Exporting...
> Exporting...
> Wrong type argument: stringp, nil
> 
> How can I have more verbose errors by the way?
> 

Further along in the thread I pointed out to you, there is a discussion
of emacs --batch implying emacs -q and how to load your .emacs file.
I believe that't the problem you are having.

HTH,
Nick

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

* Re: batch exporting
  2009-12-21 14:25         ` Nick Dokos
@ 2009-12-21 14:51           ` andrea
  2009-12-21 17:10             ` Nick Dokos
  0 siblings, 1 reply; 10+ messages in thread
From: andrea @ 2009-12-21 14:51 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:


> Further along in the thread I pointed out to you, there is a discussion
> of emacs --batch implying emacs -q and how to load your .emacs file.
> I believe that't the problem you are having.
>

Alright I can try, but I don't want to load my configuration every time
I want to export, it's quite big now and it takes some time.
I just want to load only what's necessary to export, and what I've put
should be already enough...

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

* Re: Re: batch exporting
  2009-12-21 14:51           ` andrea
@ 2009-12-21 17:10             ` Nick Dokos
  2009-12-22  9:20               ` andrea
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2009-12-21 17:10 UTC (permalink / raw)
  To: andrea; +Cc: emacs-orgmode

andrea <andrea.crotti.0@gmail.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
> 
> > Further along in the thread I pointed out to you, there is a discussion
> > of emacs --batch implying emacs -q and how to load your .emacs file.
> > I believe that't the problem you are having.
> >
> 
> Alright I can try, but I don't want to load my configuration every time
> I want to export, it's quite big now and it takes some time.
> I just want to load only what's necessary to export, and what I've put
> should be already enough...
> 

Then prepare a skeleton .emacs just for export and load that:

     emacs --batch --load ~/.skeleton-emacs-for-export ...

Nick

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

* Re: batch exporting
  2009-12-21 17:10             ` Nick Dokos
@ 2009-12-22  9:20               ` andrea
  0 siblings, 0 replies; 10+ messages in thread
From: andrea @ 2009-12-22  9:20 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> andrea <andrea.crotti.0@gmail.com> wrote:
>
>
> Then prepare a skeleton .emacs just for export and load that:
>
>      emacs --batch --load ~/.skeleton-emacs-for-export ...
>

Eh eh solved, I was just using the builtin emacs version on snow leopard
(22.1), which for some reasons don't work at all..

This is enough, now I'll have to play with getopt a little bit
--8<---------------cut here---------------start------------->8---
FILE=$1
ORG="$HOME/.emacs.d/org-mode/lisp/"
EMACS="/Applications/Emacs.app/Contents/MacOS/Emacs"

if ! test -f $FILE
then
    help
else
    echo "converting file $FILE"
    $EMACS   --batch \
	--eval "(add-to-list 'load-path \"$ORG\")" \
	--eval "(require 'org)" \
	--visit=$FILE --funcall org-export-as-latex-batch
fi
--8<---------------cut here---------------end--------------->8---

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

end of thread, other threads:[~2009-12-22  9:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-20 18:26 batch exporting andrea
2009-12-20 19:09 ` Nick Dokos
2009-12-20 22:43   ` andrea
2009-12-20 22:52     ` Carsten Dominik
2009-12-21  7:27       ` andrea
2009-12-21 10:25         ` andrea Crotti
2009-12-21 14:25         ` Nick Dokos
2009-12-21 14:51           ` andrea
2009-12-21 17:10             ` Nick Dokos
2009-12-22  9:20               ` andrea

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