Skip to content

ruediger/org-ehtml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Export Org-mode files as editable web pages -*- org -*-

Installation and Configuration Instructions

You will need Emacs 24 or later, and recent versions of elnode and Org-mode which are available from http://nicferrier.github.com/elnode/ and http://orgmode.org/org-mode-download.html respectively.

  1. Optionally install with ELPA from the marmalade repository http://marmalade-repo.org/packages/org-ehtml.
    (mapc (lambda (package) (add-to-list  'package-archives package))
          '(("org"       . "http://orgmode.org/elpa/")
            ("marmalade" . "http://marmalade-repo.org/packages/")))
    (unless (package-installed-p 'org-ehtml) (package-install 'org-ehtml))
        
  2. Run the tests to make sure everything is working.
    (require 'test-org-ehtml)
    (ert "org-ehtml")
        
  3. Set the root of your directory of Org-mode files. For now we’ll just use the example files used in the tests, later you can customize this variable.
    (setq org-ehtml-docroot test-org-ehtml-example-dir)
        
  4. Start up elnode.
    (elnode-start 'org-ehtml-handler :port 8888)
        
  5. Point your browser to http://localhost:8888/simple.org and move your mouse over the page. Editable portions of the page will be highlighted, click on these to edit.

Run over your own local Org-mode files

Warning: Be sure you backup your files before you start editing them through this experimental web interface as it could trash your files.

(require 'org-ehtml)

;; Configure the server
(setq
 org-ehtml-everything-editable t
 org-ehtml-docroot "~/path/to/your/files"
 my-org-ehtml-port 3333
 )

;; Start the server
(elnode-start 'org-ehtml-handler :port my-org-ehtml-port)

;; Stop the server
;; (elnode-stop my-org-ehtml-port)

User Authentication

To enable user authentication replace the ‘org-ehtml-handler elnode handler with the ‘org-ehtml-auth-handler from src/org-ehtml-auth.el.

This may no longer work due to changes in elnode.

Integration with version control

Warning: This could screw up your version control system as well as your flat files.

org-ehtml provides an org-ehtml-after-save-hook which can be used to commit all changes to a local version control system.

(require 'vc)

(add-hook
 'org-ehtml-after-save-hook
 (lambda ()
   (let ((file (buffer-file-name (current-buffer))))
     (vc-checkin (list file) (vc-backend file) nil "edit through org-ehtml"))))

Using the Makefile

Using the Makefile is not required in any way. However, it may be used to either compile the Emacs Lisp source, or to run a simple web server. To do so, set ORGMODE and ELNODE environment variables to point to the development directories of Org-mode and elnode. You can then run “make” to build the Emacs Lisp source or run “make example” to launch an example web server.

Issues

Doesn’t work with some versions of Chrome

Specifically Version 21.0.1180.79 (151411) of chrome sends empty text fields to the server resulting in the deletion of the edited portion of the Org-mode file.

This is due to Chrome’s miss-evaluation of line 14 or so of src/ox-ehtml.js.

About

Export Org-mode files as editable web pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 88.6%
  • JavaScript 10.8%
  • CSS 0.6%