emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien Guerry <bzg@altern.org>
To: lanas <lanas@securenet.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Converting to html in a shell script
Date: Thu, 13 Mar 2008 01:04:43 +0000	[thread overview]
Message-ID: <87r6efl9hw.fsf@bzg.ath.cx> (raw)
In-Reply-To: <20080312200141.4273426f@mistral.stie> (lanas@securenet.net's message of "Wed, 12 Mar 2008 20:01:41 -0400")

lanas <lanas@securenet.net> 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	other threads:[~2008-03-13  1:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13  0:01 Converting to html in a shell script lanas
2008-03-13  1:04 ` Bastien Guerry [this message]
2008-03-13 17:36 ` Michael Hohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r6efl9hw.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=lanas@securenet.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).