/org-iv

A tool used to view html generated by org-file immediately.

Primary LanguageEmacs Lisp

View html generated by org-mode immediately

http://melpa.org/packages/org-iv-badge.svg

Configure

Install it by git-clone or from melpa

(require 'org-iv)

(org-iv/add-to-alist
   'org-iv/config-alist
   `(("config-001"
      :front-html-file ,(expand-file-name "default/org-iv-front-file.html" org-iv/root)
      ;; The file put on front of the html generated by org-file.
      :back-html-file ,(expand-file-name "default/org-iv-back-file.html" org-iv/root)
      ;; The file put on back of the html generated by org-file.
      :backend 'html
      ;; The org-export-backend we choose
      :web-test-root ,(expand-file-name "default" org-iv/root)
      ;; where we copy the content of web-resource-dir into
      :web-test-port 9876)
      ("config-002"
       ;; ...
      )))

or, use ‘use-package’

(use-package org-iv
  :defer t
  :commands org-iv/immediate-view
  :config
  (org-iv/add-to-alist
   'org-iv/config-alist
   `(("config-001"
      :front-html-file ,(expand-file-name "default/org-iv-front-file.html" org-iv/root)
      ;; The file put on front of the html generated by org-file.
      :back-html-file ,(expand-file-name "default/org-iv-back-file.html" org-iv/root)
      ;; The file put on back of the html generated by org-file.
      :web-test-root ,(expand-file-name "default" org-iv/root)
      ;; where we copy the content of web-resource-dir into
      :web-test-port 9876)
      ("config-002"
       ;; ...
      ))
   ))

Usage

Use commands org-iv/immediate-view and org-iv/stop-immediate-view , you can bind the key you like in emacs.

Or, when the org-file is being larger and larger, the response of org-iv will be slower and slower. In order to change the situation, you can use org-iv/manually-update command,and from that time,the html-file will be updated when you save the org-file.

And, there is another method: Narrow-to-region. When org-iv is too slow, consider use it and use org-iv/immediate-view to see the region changes.

What’s more, if you want to save the generated html file, use org-iv/org-to-html command while the focus is on the current editing org file.

Machanism

Open the “default” directory, you can see two files:

  • org-iv-front-file.html
  • org-iv-back-file.html

These two files are put before and after the html generated by org-mode respectively.

<html>
<head>...</head>
<body><!--org-iv-front-file.html-->

<!--Html generated by org-mode-->

</body><!--org-iv-back-file.html-->
</html>

Dependencies

org-mode
org-mode
impatient-mode
https://github.com/netguy204/imp.el