From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nitin Agarwal Subject: Re: [ANN] Editable HTML export of Org-mode files Date: Tue, 30 Oct 2012 14:37:14 +0500 Message-ID: References: <87pq6ua0kk.fsf@gmx.com> <50843E8D.4010305@gmx.de> <877gqitf70.fsf@gmx.com> <50883F59.10907@gmx.de> <87625utyi7.fsf@gmail.com> <508D50DF.7020200@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b678864fd262d04cd43879c Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT8GC-0003Xx-0G for emacs-orgmode@gnu.org; Tue, 30 Oct 2012 05:37:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT8G4-0001Qz-9q for emacs-orgmode@gnu.org; Tue, 30 Oct 2012 05:37:23 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]:46117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT8G4-0001Qu-16 for emacs-orgmode@gnu.org; Tue, 30 Oct 2012 05:37:16 -0400 Received: by mail-qa0-f48.google.com with SMTP id c11so49042qad.0 for ; Tue, 30 Oct 2012 02:37:15 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte , emacs-orgmode@gnu.org Cc: Venkatesh Choppella --047d7b678864fd262d04cd43879c Content-Type: text/plain; charset=ISO-8859-1 Hi, Somehow we have to edit the org-ehtml-server.el and the org-ehtml-client.el file in order to the edit the orgmode file as editable web page where we can edit the headings or subheadings. functions defined in the org-ehtml-server.el file (defun org-ehtml-handler (httpcon) (elnode-log-access "org-ehtml" httpcon) (elnode-method httpcon (GET (org-ehtml-file-handler httpcon)) (POST (org-ehtml-edit-handler httpcon)))) (defun org-ehtml-file-handler (httpcon) (let ((elnode-docroot-for-no-404 t) (elnode-docroot-for-no-cache t)) (elnode-docroot-for org-ehtml-docroot :with file :on httpcon :do (org-ehtml-serve-file file httpcon)))) (defun org-ehtml-serve-file (file httpcon) (cond ;; normal files (including index.org or index.html if they exist) ((or (not (file-directory-p file)) (let ((i-org (expand-file-name "index.org" file)) (i-html (expand-file-name "index.html" file))) (or (and (file-exists-p i-org) (setq file i-org)) (and (file-exists-p i-html) (setq file i-html))))) (elnode-send-file httpcon (if (member (file-name-extension file) '("org" "html")) (org-ehtml-client-cached file) file))) ;; directory listing ((file-directory-p file) (let ((pt (elnode-http-pathinfo httpcon))) (elnode-http-start httpcon 200 '("Content-type" . "text/html")) (elnode-http-return httpcon (elnode--webserver-index org-ehtml-docroot file pt org-ehtml-dir-match)))) ;; none of the above -> missing file (t (elnode-send-404 httpcon)))) (defun org-ehtml-edit-handler (httpcon) (let* ((params (elnode-http-params httpcon)) (path (substring (cdr (assoc "path" params)) 1)) (beg (string-to-number (cdr (assoc "beg" params)))) (end (string-to-number (cdr (assoc "end" params)))) (org (cdr (assoc "org" params)))) (when (string= (file-name-nondirectory path) "") (setq path (concat path "index.org"))) (when (string= (file-name-extension path) "html") (setq path (concat (file-name-sans-extension path) ".org"))) (org-babel-with-temp-filebuffer (expand-file-name path org-ehtml-docroot) (let ((orig (buffer-string))) (replace-region beg end org) (if (run-hook-with-args-until-failure 'org-ehtml-before-save-hook) (save-buffer) (replace-region (point-min) (point-max) orig) (elnode-send-500 httpcon "edit failed `org-ehtml-before-save-hook'"))) (run-hooks 'org-ehtml-after-save-hook)) (elnode-http-start httpcon "200" '("Content-type" . "text/html")) (elnode-http-return httpcon (org-export-string org 'html org-ehtml-docroot)))) (provide 'org-ehtml-server) This provides the org-ehtml-server function on the backend side to export the org-ehtml file as editable web page and make the changes to the org-file on the server side to the org file. functions identified in the org-ehtml-client.el file (defvar org-ehtml-everything-editable nil "Set to a true value to everything exported by org-ehtml editable.") (defvar org-ehtml-editable-types '(paragraph plain-list table verbatim quote-block verse-block) "Types of elements whose children should not be editable.") (defun org-ehtml-client-editable-p (element info) (let ((parent (org-export-get-parent element))) (cond ((eq (car parent) 'headline) (or org-ehtml-everything-editable (member "EDITABLE" (org-export-get-tags parent info)))) ((eq (car parent) 'org-data) (or org-ehtml-everything-editable (some (lambda (keyword) (let ((key (plist-get (cadr keyword) :key)) (val (plist-get (cadr keyword) :value))) (and (string= "PROPERTY" key) (string-match "editable \\(.+\\)" val) (car (read-from-string (match-string 1 val)))))) (cddr (caddr parent))))) ((member (car parent) org-ehtml-editable-types) nil) (t (org-ehtml-client-editable-p parent info))))) (defmacro def-ehtml-wrap (e-html-function) "Defines and returns an ehtml-wrapped version of E-HTML-FUNCTION." (let ((fname (intern (concat "org-ehtml-client" (substring (symbol-name e-html-function) 10))))) `(defun ,fname (element contents info) ,(format "ehtml wrapper around `%s'." e-html-function) (let* ((original-contents (copy-seq contents)) (original-info (copy-seq info)) (html-text (,e-html-function element contents info)) (org-text (or (org-element-interpret-data element) original-contents (error "no org-text found for %s" (car element))))) (if (org-ehtml-client-editable-p element info) (org-fill-template org-ehtml-client-wrap-template `(("html-text" . ,html-text) ("org-text" . ,org-text) ("begin" . ,(number-to-string (plist-get (cadr element) :begin))) ("end" . ,(number-to-string (plist-get (cadr element) :end))))) html-text))))) (eval `(org-export-define-derived-backend ehtml e-html :translate-alist ((paragraph . ,(def-ehtml-wrap org-e-html-paragraph)) (plain-list . ,(def-ehtml-wrap org-e-html-plain-list)) (table . ,(def-ehtml-wrap org-e-html-table)) (verbatim . ,(def-ehtml-wrap org-e-html-verbatim)) (quote-block . ,(def-ehtml-wrap org-e-html-quote-block)) ;; (src-block . ,(def-ehtml-wrap org-e-html-src-block)) (verse-block . ,(def-ehtml-wrap org-e-html-verse-block))))) (defun org-ehtml-client-export-to-html (&optional subtreep visible-only body-only ext-plist pub-dir) "Export current buffer to an editable HTML file." (interactive) (let* ((extension (concat "." org-e-html-extension)) (file (org-export-output-file-name extension subtreep pub-dir)) (org-export-coding-system org-e-html-coding-system) ;; custom headers (org-e-html-style-extra (concat org-e-html-style-extra "\n" org-ehtml-client-style)) (org-e-html-scripts (concat org-e-html-scripts "\n" (org-ehtml-client-scripts)))) (org-export-to-file 'ehtml file subtreep visible-only body-only ext-plist))) (defun org-ehtml-client-export-file (file) "Export FILE's contents to editable HTML." (save-window-excursion (find-file file) (org-ehtml-client-export-to-html))) (defun org-ehtml-client-cached (file) "Export FILE to editable HTML if no previous export exists. If a previous HTML export of FILE exists but is older than FILE re-export." (flet ((age (f) (float-time (time-subtract (current-time) (nth 5 (or (file-attributes (file-truename f)) (file-attributes f))))))) (let* ((base (file-name-sans-extension file)) (html (concat base ".html")) (org (concat base ".org"))) (if (and (file-exists-p org) (or (not (file-exists-p html)) (> (age html) (age org)))) (org-ehtml-client-export-file org) html)))) (provide 'org-ehtml-client) this provides the org-ehtml-client where the client can make the changes to the org-file viewed as an editable web page and editable function (defun org-ehtml-client-editable-p (element info). If anyone comes with some solution to make the org-file exported as an editable web page where one can edit the parent headings and subheadings of the content , kindly reply back. Thanks Nitin Agarwal On Mon, Oct 29, 2012 at 1:29 PM, Nitin Agarwal wrote: > The edit option comes only for the content of the headings. We can't edit > the headings and the subheadings of the headings. > So the source code has to be modified to make the org-mode document > editable as HTML where we can edit the Headings and subheadings. > The edit button appears only for the content of the subheadings or > headings of the document. > So we have to modify the org-ehtml to inculcate this feature. > > thanks > Nitin Agarwal > > > > On Sun, Oct 28, 2012 at 8:35 PM, Simon Thum wrote: > >> On 10/28/2012 04:19 PM, Eric Schulte wrote: >> >>> Yes, the content of the edit boxes does come from the exported html. >>> For each portion of the Org-mode document (as delimited by >>> org-elements), both the raw Org-mode text and the HTML are exported >>> side-by-side, then the raw Org-mode text is hidden and the HTML is >>> displayed, until the [edit] button is pushed at which point JavaScript >>> is used to hide the HTML and to expose the raw Org-mode text in an edit >>> box. When edits are committed they are committed one portion (edit-box) >>> at a time. >>> >>> Does this make sense? >>> >>> Why would something need to change for "this" to be reliable? >>> >> No, that sounds correct in principle. But my whitespace got eaten >> nonetheless ;( >> >> I'll be investigating further. >> >> Cheers, >> >> Simon >> >> >> > > > -- > *Nitin Agarwal* > Computer Science and Engineering Student > International Institute of Information Technology > Gachibowli, Hyderabad 500 032 > Andhra Pradesh, India > Phone : +91-9573572831 > E-mail: nitinagarwal3006@gmail.com > *nitin.agarwal@students.iiit.ac.in* > -- *Nitin Agarwal* Computer Science and Engineering Student International Institute of Information Technology Gachibowli, Hyderabad 500 032 Andhra Pradesh, India Phone : +91-9573572831 E-mail: nitinagarwal3006@gmail.com *nitin.agarwal@students.iiit.ac.in* --047d7b678864fd262d04cd43879c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
Somehow we have to edit the org-ehtml-server.el and the org-ehtml-cl= ient.el file in order to the edit the orgmode file as editable web page whe= re we can edit the headings
or subheadings.

functions defined in = the org-ehtml-server.el file

(defun org-ehtml-handler (httpcon)
=A0 (elnode-log-access "org-= ehtml" httpcon)
=A0 (elnode-method httpcon
=A0=A0=A0 (GET=A0 (or= g-ehtml-file-handler httpcon))
=A0=A0=A0 (POST (org-ehtml-edit-handler h= ttpcon))))

(defun org-ehtml-file-handler (httpcon)
=A0 (let ((elnode-docroot-fo= r-no-404 t) (elnode-docroot-for-no-cache t))
=A0=A0=A0 (elnode-docroot-f= or org-ehtml-docroot :with file :on httpcon :do
=A0=A0=A0=A0=A0 (org-eht= ml-serve-file file httpcon))))

(defun org-ehtml-serve-file (file httpcon)
=A0 (cond
=A0=A0 ;; no= rmal files (including index.org or index.h= tml if they exist)
=A0=A0 ((or (not (file-directory-p file))
=A0=A0= =A0=A0=A0=A0=A0 (let ((i-org=A0 (expand-file-name "index.org" file))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (i-html (expand-file-name "ind= ex.html" file)))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 (or (and (file-exists-= p i-org)=A0 (setq file i-org))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (= and (file-exists-p i-html) (setq file i-html)))))
=A0=A0=A0 (elnode-send= -file httpcon
=A0=A0=A0=A0=A0 (if (member (file-name-extension file) '("org"= ; "html"))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-ehtml-client-cache= d file) file)))
=A0=A0 ;; directory listing
=A0=A0 ((file-directory-p= file)
=A0=A0=A0 (let ((pt (elnode-http-pathinfo httpcon)))
=A0=A0=A0=A0=A0 (elnode-http-start httpcon 200 '("Content-type&quo= t; . "text/html"))
=A0=A0=A0=A0=A0 (elnode-http-return httpcon=
=A0=A0=A0=A0=A0=A0=A0 (elnode--webserver-index
=A0=A0=A0=A0=A0=A0=A0= =A0 org-ehtml-docroot file pt org-ehtml-dir-match))))
=A0=A0 ;; none of the above -> missing file
=A0=A0 (t (elnode-send-40= 4 httpcon))))

(defun org-ehtml-edit-handler (httpcon)
=A0 (let* (= (params (elnode-http-params httpcon))
=A0=A0=A0=A0=A0=A0=A0=A0 (path=A0= =A0=A0=A0=A0=A0 (substring (cdr (assoc "path" params)) 1))
=A0=A0=A0=A0=A0=A0=A0=A0 (beg (string-to-number (cdr (assoc "beg"= =A0 params))))
=A0=A0=A0=A0=A0=A0=A0=A0 (end (string-to-number (cdr (ass= oc "end"=A0 params))))
=A0=A0=A0=A0=A0=A0=A0=A0 (org=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (cdr (assoc "org"= =A0 params))))
=A0=A0=A0 (when (string=3D (file-name-nondirectory path) "")
= =A0=A0=A0=A0=A0 (setq path (concat path "= index.org")))
=A0=A0=A0 (when (string=3D (file-name-extension p= ath) "html")
=A0=A0=A0=A0=A0 (setq path (concat (file-name-sans-extension path) ".o= rg")))
=A0=A0=A0 (org-babel-with-temp-filebuffer (expand-file-name = path org-ehtml-docroot)
=A0=A0=A0=A0=A0 (let ((orig (buffer-string)))=A0=A0=A0=A0=A0=A0=A0 (replace-region beg end org)
=A0=A0=A0=A0=A0=A0=A0 (if (run-hook-with-args-until-failure 'org-ehtml-= before-save-hook)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (save-buffer)
=A0= =A0=A0=A0=A0=A0=A0=A0=A0 (replace-region (point-min) (point-max) orig)
= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (elnode-send-500 httpcon "edit failed `org= -ehtml-before-save-hook'")))
=A0=A0=A0=A0=A0 (run-hooks 'org-ehtml-after-save-hook))
=A0=A0=A0 (e= lnode-http-start httpcon "200" '("Content-type" . &= quot;text/html"))
=A0=A0=A0 (elnode-http-return httpcon
=A0=A0= =A0=A0=A0 (org-export-string org 'html org-ehtml-docroot))))

(provide 'org-ehtml-server)
This provides the org-ehtml-server f= unction on the backend side to export the org-ehtml file as editable web pa= ge and make the changes to the org-file on the server side to the org file.=

functions identified in the org-ehtml-client.el file

(defvar org= -ehtml-everything-editable nil
=A0 "Set to a true value to everythi= ng exported by org-ehtml editable.")

(defvar org-ehtml-editable= -types
=A0 '(paragraph plain-list table verbatim quote-block verse-block)
= =A0 "Types of elements whose children should not be editable.")
(defun org-ehtml-client-editable-p (element info)
=A0 (let ((paren= t (org-export-get-parent element)))
=A0=A0=A0 (cond ((eq (car parent) 'headline)
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 (or org-ehtml-everything-editable
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 (member "EDITABLE" (org-export-get-tags parent in= fo))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 ((eq (car parent) 'org-data)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (or org-ehtml-everything-editable
=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (some
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (lambda (keyword)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (let ((key (plist-get (cadr keyword) :key))
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (val (plist-ge= t (cadr keyword) :value)))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (and (string=3D &= quot;PROPERTY" key)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (string-match "editable \\(.+\\)" val= )
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 (car (read-from-string (match-string 1 val))))))
=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (cddr (caddr parent)))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 ((member (car parent) org-ehtml-editable-types)= nil)
=A0=A0=A0=A0=A0=A0=A0=A0=A0 (t (org-ehtml-client-editable-p parent= info)))))

(defmacro def-ehtml-wrap (e-html-function)
=A0 "D= efines and returns an ehtml-wrapped version of E-HTML-FUNCTION."
=A0 (let ((fname (intern (concat "org-ehtml-client"
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (substring (symbol-name e-html-function) 10)))))
=A0=A0=A0 `(defu= n ,fname (element contents info)
=A0=A0=A0=A0=A0=A0 ,(format "ehtml= wrapper around `%s'." e-html-function)
=A0=A0=A0=A0=A0=A0 (let* ((original-contents (copy-seq contents))
=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (original-info=A0=A0=A0=A0 (copy-seq info= ))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (html-text (,e-html-function = element contents info))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-tex= t=A0 (or (org-element-interpret-data element)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 original-contents
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (error "no org-text found f= or %s" (car element)))))
=A0=A0=A0=A0=A0=A0=A0=A0 (if (org-ehtml-cl= ient-editable-p element info)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-= fill-template org-ehtml-client-wrap-template
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 `(("html-text" . ,html-te= xt)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ("org-text"= =A0 . ,org-text)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ("be= gin"=A0=A0=A0=A0 . ,(number-to-string
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (plis= t-get (cadr element) :begin)))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ("end"=A0=A0=A0=A0= =A0=A0 . ,(number-to-string
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (plist-get (cadr ele= ment) :end)))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 html-text)))))

(ev= al `(org-export-define-derived-backend ehtml e-html
=A0=A0=A0=A0=A0=A0=A0=A0 :translate-alist
=A0=A0=A0=A0=A0=A0=A0=A0 ((par= agraph=A0=A0 . ,(def-ehtml-wrap org-e-html-paragraph))
=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (plain-list=A0 . ,(def-ehtml-wrap org-e-html-plain-list))
= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (table=A0=A0=A0=A0=A0=A0 . ,(def-ehtml-wrap org= -e-html-table))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 (verbatim=A0=A0=A0 . ,(def-ehtml-wrap org-e-htm= l-verbatim))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 (quote-block . ,(def-ehtml-wrap= org-e-html-quote-block))
=A0=A0=A0=A0=A0=A0=A0=A0=A0 ;; (src-block=A0= =A0 . ,(def-ehtml-wrap org-e-html-src-block))
=A0=A0=A0=A0=A0=A0=A0=A0= =A0 (verse-block . ,(def-ehtml-wrap org-e-html-verse-block)))))

(defun org-ehtml-client-export-to-html
=A0 (&optional subtreep v= isible-only body-only ext-plist pub-dir)
=A0 "Export current buffer= to an editable HTML file."
=A0 (interactive)
=A0 (let* ((extens= ion (concat "." org-e-html-extension))
=A0=A0=A0 =A0(file (org-export-output-file-name extension subtreep pub-dir)= )
=A0=A0=A0 =A0(org-export-coding-system org-e-html-coding-system)
= =A0=A0=A0=A0=A0=A0=A0=A0 ;; custom headers
=A0=A0=A0=A0=A0=A0=A0=A0 (org= -e-html-style-extra (concat org-e-html-style-extra "\n"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 org-ehtml-client-style))
= =A0=A0=A0=A0=A0=A0=A0=A0 (org-e-html-scripts (concat org-e-html-scripts &qu= ot;\n"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-ehtml-client-scripts)= )))
=A0=A0=A0 (org-export-to-file 'ehtml file subtreep visible-only = body-only ext-plist)))

(defun org-ehtml-client-export-file (file)
=A0 "Export FILE'= ;s contents to editable HTML."
=A0 (save-window-excursion
=A0=A0= =A0 (find-file file)
=A0=A0=A0 (org-ehtml-client-export-to-html)))
(defun org-ehtml-client-cached (file)
=A0 "Export FILE to editable HTML if no previous export exists.
If = a previous HTML export of FILE exists but is older than FILE
re-export.&= quot;
=A0 (flet ((age (f)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (fl= oat-time
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (time-subtract (curr= ent-time)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (nth 5 (or (file-attributes (file-truename f))
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (file-attributes f)))))))
=A0=A0=A0 (l= et* ((base (file-name-sans-extension file))
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 (html (concat base ".html"))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org (concat base ".org")))
=A0= =A0=A0=A0=A0 (if (and (file-exists-p org)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (or (not (file-exists-p html)) (> (age html) (age org))))=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-ehtml-client-export-file org)
=A0=A0= =A0=A0=A0=A0=A0 html))))

(provide 'org-ehtml-client)

this provides the org-ehtml-clie= nt where the client can make the changes to the org-file viewed as an edita= ble web page and editable function (defun org-ehtml-client-editable-p (elem= ent info).

If anyone comes with some solution to make the org-file exported as an = editable web page where one can edit the parent headings and subheadings of= the content , kindly reply back.

Thanks
Nitin Agarwal



On Mon, Oct 29, 2012 at 1:29 PM, Nitin A= garwal <nitinagarwal3006@gmail.com> wrote:
The edit option comes only for the content of the headings. We can't ed= it the headings and the subheadings of the headings.
So the source code = has to be modified to make the org-mode document editable as HTML where we = can edit the Headings and subheadings.
The edit button appears only for the content of the subheadings or headings= of the document.
So we have to modify the org-ehtml to inculcate this f= eature.

thanks
Nitin Agarwal



On Sun, Oct 28, 2012 at 8:35 PM, Simon Thum <simon.thum@gmx.de> wrote:
On 10/28/2012 04:19 PM, Eric Schulte wrote:
Yes, the content of the edit boxes does come from the exported html.
For each portion of the Org-mode document (as delimited by
org-elements), both the raw Org-mode text and the HTML are exported
side-by-side, then the raw Org-mode text is hidden and the HTML is
displayed, until the [edit] button is pushed at which point JavaScript
is used to hide the HTML and to expose the raw Org-mode text in an edit
box. =A0When edits are committed they are committed one portion (edit-box)<= br> at a time.

Does this make sense?

Why would something need to change for "this" to be reliable?
No, that sounds correct in principle. But my whitespace got eaten nonethele= ss ;(

I'll be investigating further.

Cheers,

Simon





--
Nitin Agarwal<= br>Computer Science and Engineering Student
International Institute of I= nformation Technology
Gachibowli, Hyderabad 500 032
Andhra Pradesh, India
Phone : +91-9573572831
E-mail: nitinagarwal3006@gmail.com<= /a>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
nitin.agarwal@students.iiit.ac.in<= /u>




--
Nitin Agarwal
Computer Science and = Engineering Student
International Institute of Information Technology Gachibowli, Hyderabad 500 032
Andhra Pradesh, India
Phone : +91-9573572831
E-mail: nitinagarwal3006@gmail.com<= /a>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
nitin.agarwal@students.iiit.ac.in<= /u>

--047d7b678864fd262d04cd43879c--