From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Horn Subject: Re: [OT] Exporting org files to html from outside GNU Emacs Date: Fri, 17 Dec 2010 21:38:20 -0500 Message-ID: References: <5103105833544608553@unknownmsgid> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=46833 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTmh8-0001pt-3G for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 21:38:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTmh6-000478-OQ for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 21:38:49 -0500 Received: from mail-fx0-f48.google.com ([209.85.161.48]:34406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTmh6-00046z-J3 for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 21:38:48 -0500 Received: by fxm2 with SMTP id 2so1261884fxm.35 for ; Fri, 17 Dec 2010 18:38:47 -0800 (PST) In-Reply-To: <5103105833544608553@unknownmsgid> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emanuele Santoro Cc: emacs-orgmode@gnu.org This might work: http://johnmacfarlane.net/pandoc/ On Fri, Dec 17, 2010 at 8:22 PM, Emanuele Santoro w= rote: > I'll be a little OT, I'm sorry. > > Hello people, > I'm writing a sort of wiki software, and i want it to use Org-Mode's > syntax for its documents. > Thus, I'd need to have some code to export org files to HTML. > Something like a library for Php or Perl. > Is anyone planning to write something like that? > > Now, in the meantime, it's ok for me to use an underlying emacs for do > the html export, via the org-export-as-html-batch function. > I can export org-files by calling, in Perl: > > my $args =3D '/usr/bin/emacs -q --batch ' . > =A0 =A0"--visit=3D$DOCUMENT " . > =A0 =A0'--funcall org-export-as-html-batch '. > =A0 =A0">/dev/null 2>&1"; > > (I know it's ugly code, but it's still a draft) > > It works, but it's damned slow since it has to spawn a new full emacs > process each time. > > Since I usually use emacs in daemon mode, I then tried to use my > emacsclient to export org files, writing this silly function: > > (defun batch-export-file (orgdoc) > =A0"open and export an file" > =A0(interactive "") > =A0(save-excursion > =A0 =A0(find-file orgdoc) > =A0 =A0(set-buffer (file-name-nondirectory orgdoc)) > =A0 =A0(org-export-as-html-batch) > =A0 =A0(write-file > =A0 =A0 (concat > =A0 =A0 =A0(file-name-directory org-doc) > =A0 =A0 =A0"/" > =A0 =A0 =A0(file-name-sans-extension (file-name-nondirectory org-doc)))))= ) > > As you can see, I'm not a proficient elisp programmer. > The aim is to run emacsclient -e "(batch-export-file $my_file_path)", > but still it isn't fully working. > Any idea on how to improve it? > > Sorry for being OT and thanks in advance. > > Cheers, > -- > Emanuele Santoro > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAk0MDNIACgkQa3jIggJUg2mQXQCePFLwSTGhpOACtQwGxT2n3Kuh > 9uoAn2Ng793XaNR70TJebcp5eJqCgyb2 > =3DfCTU > -----END PGP SIGNATURE----- > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > --=20 Jeffrey Horn Graduate Lecturer and PhD Student in Economics George Mason University (704) 271-4797 jhorn@gmu.edu jrhorn424@gmail.com http://www.failuretorefrain.com/jeff/