From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Santoro Subject: [OT] Exporting org files to html from outside GNU Emacs Date: Sat, 18 Dec 2010 02:22:26 +0100 Message-ID: <9360.34962437606$1292637343@news.gmane.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1592219723==" Return-path: Received: from [140.186.70.92] (port=40397 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTm0V-0006Pc-NF for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 20:55:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTlzu-0005ET-K4 for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 20:54:46 -0500 Received: from espatrio.investici.org ([204.13.164.67]:20949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTlzu-0005BY-8L for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 20:54:10 -0500 Received: from [204.13.164.67] (espatrio [204.13.164.67]) (Authenticated sender: salmoro@inventati.org) by localhost (Postfix) with ESMTPSA id 71A1D4AB90 for ; Sat, 18 Dec 2010 01:30:19 +0000 (UTC) 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: emacs-orgmode@gnu.org --===============1592219723== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 ' . "--visit=3D$DOCUMENT " . '--funcall org-export-as-html-batch '. ">/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) "open and export an file" (interactive "") (save-excursion=20 (find-file orgdoc) (set-buffer (file-name-nondirectory orgdoc)) (org-export-as-html-batch) (write-file=20 (concat=20 (file-name-directory org-doc)=20 "/"=20 (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.=20 Any idea on how to improve it? Sorry for being OT and thanks in advance. Cheers, -- Emanuele Santoro --/04w6evG8XlLl3ft Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0MDNIACgkQa3jIggJUg2mQXQCePFLwSTGhpOACtQwGxT2n3Kuh 9uoAn2Ng793XaNR70TJebcp5eJqCgyb2 =fCTU -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- --===============1592219723== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1592219723==--