* Error with elnode serving html creating by org-mode
@ 2014-10-08 14:00 Renaud Casenave-Péré
0 siblings, 0 replies; only message in thread
From: Renaud Casenave-Péré @ 2014-10-08 14:00 UTC (permalink / raw
To: help-gnu-emacs
Hi,
I would like to use elnode to view some info managed by emacs (like messages
managed by gnus, for example) on my phone but I am not really versed in the way
of the html so I tried to use org-mode's feature to export buffers as html like
this:
#+begin_src elisp
(defun testorg-handler (httpcon)
(elnode-http-start httpcon 200 '("Content-type" . "text/html"))
(with-temp-buffer
(insert "* Title
** Subtitle
text")
(org-html-export-as-html)
(with-current-buffer "*Org HTML Export*"
(elnode-http-return httpcon (buffer-substring-no-properties (point-min) (point-max))))))
#+end_src
but when I try to get the webpage with firefox nothing happen and chromium
returns the following error code: ERR_INVALID_CHUNKED_ENCODING
If I first save the exported html code in a file and I then serve this file like
this:
#+begin_src elisp
(defun testorg-handler (httpcon)
(elnode-http-start httpcon 200 '("Content-type" . "text/html"))
(with-temp-buffer
(insert "* Title
** Subtitle
youhou")
(org-export-to-file 'html "/tmp/testorg.html")
(elnode-send-file httpcon "/tmp/testorg.html")))
#+end_src
everything works fine so I can work around this problem but I was still
wondering what is wrong with my temporary buffer version.
I am using the latest elnode from git and the 20141006 version of org-mode from
its elpa-like repository which by the way doesn't seem to define the
org-export-as-html function used in the elnode README anymore.
--
Renaud Casenave-Péré
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-08 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 14:00 Error with elnode serving html creating by org-mode Renaud Casenave-Péré
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.