CGI Programming in Elisp?

我怕爱的太早我们不能终老 提交于 2019-11-30 07:31:59

This might help you out, a simple cgi library for emacs

http://www.emacswiki.org/emacs/cgi.el

I've not written any CGI scripts, but have used xmlgen to generate xml. It'd likely be easier than what you had up there - as it's easy to generate lists in Emacs and have them automatically converted to xml/html.

This code generates the same string:

(require 'xmlgen)
(princ  "Content-type: text/html; charset=utf-8\n\n")
(princ (xmlgen '(html (body (h1 :style "text-align: center" "Elisp CGI Programming")
                      (table :style "border: 1px solid"
                             (tr (th "One")
                                 (th "Two"))
                             (tr (th "A")
                                 (th "B")))))))

One way to do it is, use the httpd server in Emacs HttpServer and send request to emacs using proxy.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!