[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Error with elnode serving html creating by org-mode
From: |
Renaud Casenave-Péré |
Subject: |
Error with elnode serving html creating by org-mode |
Date: |
Wed, 08 Oct 2014 23:00:24 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
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é
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Error with elnode serving html creating by org-mode,
Renaud Casenave-Péré <=