emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Converting to html in a shell script


From: Bastien Guerry
Subject: Re: [Orgmode] Converting to html in a shell script
Date: Thu, 13 Mar 2008 01:04:43 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

lanas <address@hidden> writes:

>   I would like to convert an org file to HTML, much like C-c C-e h
> would do, automatically from a shell script.  So far I've tried
> unsuccesfully some permutaions of:
>
> emacs -batch -l ~/.emacs -eval '(org-export-as-html "./file.org")'
> emacs -batch -l ~/.emacs -eval '(org-export-as-html)' ./file.org

The function `org-export-as-html' doesn't take the file as an argument,
it has to be called in the buffer where a file has been found.

Look at the script for example:

#!/bin/bash

emacs -batch -eval \
"(progn (load-file \"~/org-mode/org.el\") \
        (load-file \"~/elisp/config/org-batch-config.el\") \
        (find-file \"~/yourfile.org\") \
        (org-export-as-html 3))"

I use org-batch-config.el because obviously I don't need to load all my
Emacs config for running this script.  

But I think it's cleaner to define projects with org-publish and then to
publish a project like:

emacs -batch -eval "(progn (load \"~/org-mode/org.el\") \
                           (org-publish \"myproject\"))"

HTH,

-- 
Bastien




reply via email to

[Prev in Thread] Current Thread [Next in Thread]