emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [OT] Exporting org files to html from outside GNU Emacs
@ 2010-12-18  1:22 Emanuele Santoro
  0 siblings, 0 replies; 5+ messages in thread
From: Emanuele Santoro @ 2010-12-18  1:22 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1538 bytes --]

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 = '/usr/bin/emacs -q --batch ' .
    "--visit=$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 
    (find-file orgdoc)
    (set-buffer (file-name-nondirectory orgdoc))
    (org-export-as-html-batch)
    (write-file 
     (concat 
      (file-name-directory org-doc) 
      "/" 
      (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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

* Re: [OT] Exporting org files to html from outside GNU Emacs
       [not found] <5103105833544608553@unknownmsgid>
@ 2010-12-18  2:38 ` Jeff Horn
  2010-12-18  8:52   ` Sébastien Vauban
  2010-12-21  5:04   ` Puneeth
  0 siblings, 2 replies; 5+ messages in thread
From: Jeff Horn @ 2010-12-18  2:38 UTC (permalink / raw)
  To: Emanuele Santoro; +Cc: emacs-orgmode

This might work: http://johnmacfarlane.net/pandoc/

On Fri, Dec 17, 2010 at 8:22 PM, Emanuele Santoro <santoro@autistici.org> wrote:
> 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 = '/usr/bin/emacs -q --batch ' .
>    "--visit=$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
>    (find-file orgdoc)
>    (set-buffer (file-name-nondirectory orgdoc))
>    (org-export-as-html-batch)
>    (write-file
>     (concat
>      (file-name-directory org-doc)
>      "/"
>      (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
> =fCTU
> -----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
>
>



-- 
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/

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

* Re: [OT] Exporting org files to html from outside GNU Emacs
  2010-12-18  2:38 ` [OT] Exporting org files to html from outside GNU Emacs Jeff Horn
@ 2010-12-18  8:52   ` Sébastien Vauban
  2010-12-21  5:04   ` Puneeth
  1 sibling, 0 replies; 5+ messages in thread
From: Sébastien Vauban @ 2010-12-18  8:52 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Emanuele,

Jeff Horn wrote:
> On Fri, Dec 17, 2010 at 8:22 PM, Emanuele Santoro <santoro-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> wrote:
>> 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.
>
> This might work: http://johnmacfarlane.net/pandoc/

Or take a look at Blorgit, from Eric Schulte.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [OT] Exporting org files to html from outside GNU Emacs
  2010-12-18  2:38 ` [OT] Exporting org files to html from outside GNU Emacs Jeff Horn
  2010-12-18  8:52   ` Sébastien Vauban
@ 2010-12-21  5:04   ` Puneeth
  2010-12-21  7:47     ` Jeff Horn
  1 sibling, 1 reply; 5+ messages in thread
From: Puneeth @ 2010-12-21  5:04 UTC (permalink / raw)
  To: Jeff Horn; +Cc: emacs-orgmode, Emanuele Santoro

On Sat, Dec 18, 2010 at 8:08 AM, Jeff Horn <jrhorn424@gmail.com> wrote:
> This might work: http://johnmacfarlane.net/pandoc/

Pandoc doesn't have an org-mode reader as of now.  I had implemented
only a writer, since I was looking for an importer to org-mode.

-- 
Puneeth

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

* Re: [OT] Exporting org files to html from outside GNU Emacs
  2010-12-21  5:04   ` Puneeth
@ 2010-12-21  7:47     ` Jeff Horn
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Horn @ 2010-12-21  7:47 UTC (permalink / raw)
  To: Puneeth; +Cc: emacs-orgmode, Emanuele Santoro

Oops! Thanks for the clarification!

On Tue, Dec 21, 2010 at 12:04 AM, Puneeth <punchagan@gmail.com> wrote:
> On Sat, Dec 18, 2010 at 8:08 AM, Jeff Horn <jrhorn424@gmail.com> wrote:
>> This might work: http://johnmacfarlane.net/pandoc/
>
> Pandoc doesn't have an org-mode reader as of now.  I had implemented
> only a writer, since I was looking for an importer to org-mode.
>
> --
> Puneeth
>



-- 
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/

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

end of thread, other threads:[~2010-12-21  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5103105833544608553@unknownmsgid>
2010-12-18  2:38 ` [OT] Exporting org files to html from outside GNU Emacs Jeff Horn
2010-12-18  8:52   ` Sébastien Vauban
2010-12-21  5:04   ` Puneeth
2010-12-21  7:47     ` Jeff Horn
2010-12-18  1:22 Emanuele Santoro

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