Skip to content

Instantly share code, notes, and snippets.

@svanellewee
Created July 23, 2016 21:37
Show Gist options
  • Save svanellewee/319af8e71125241f4577c30b3a11b511 to your computer and use it in GitHub Desktop.
Save svanellewee/319af8e71125241f4577c30b3a11b511 to your computer and use it in GitHub Desktop.
Elnode org-mode mounting

Stephan’s index page

Hello world!

You may have to reload org-more (C-u M-x org-reload)

  ;;; server.el ---  -*- lexical-binding: t -*-
(require 'elnode)
(defvar my-org-dir "/Users/svanellewee/source/orgz")
(require 'ox)

(defvar my-org-dir "~/source/org")

(defun my-elnode-org-handler (httpcon)
  (elnode-docroot-for my-org-dir
    with org-file
    on httpcon
    do (with-current-buffer (find-file-noselect org-file)
	 (org-html-export-as-html)
	 (elnode-send-html httpcon (buffer-string)))))

  (elnode-start 'my-elnode-org-handler :port 8002) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment