all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [ANN] Editable HTML export of Org-mode files
@ 2012-08-13 22:28 Eric Schulte
  2012-08-14  7:44 ` Bastien
                   ` (5 more replies)
  0 siblings, 6 replies; 35+ messages in thread
From: Eric Schulte @ 2012-08-13 22:28 UTC (permalink / raw)
  To: Org Mode Mailing List

Hi,

I've recently put together a web server which runs in Emacs and exports
local Org-mode files to HTML in such a way that they may be edited from
within a web browser with the edits saved to local files on disk.  The
code is available from github.

         repository ---- https://github.com/eschulte/org-ehtml
          README ------- http://eschulte.github.com/org-ehtml

This is a very thin Emacs Lisp and JavaScript wrapper around Nic
Ferrier's elnode Emacs web server [1], and Nicolas Goaziou's structured
Org-mode file representation and export engine.  It requires Emacs 24
and the development versions of both Org-mode and elnode.

The code is fairly new so there are likely some kinks to be worked out
(backup your files before editing them with this web-server), but the
implementation is very simple and should be easy to modify.  See the
README for information on how to make use of elnode's authentication
system, or how to have web edits automatically committed to a local
version control system.

Comments and patches are welcome.

Cheers,

Footnotes: 
[1]  https://github.com/nicferrier/elnode

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
@ 2012-08-14  7:44 ` Bastien
  2012-08-14  9:40 ` Rasmus
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 35+ messages in thread
From: Bastien @ 2012-08-14  7:44 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Eric Schulte <eric.schulte@gmx.com> writes:

> The code is fairly new so there are likely some kinks to be worked out
> (backup your files before editing them with this web-server), but the
> implementation is very simple and should be easy to modify.  See the
> README for information on how to make use of elnode's authentication
> system, or how to have web edits automatically committed to a local
> version control system.
>
> Comments and patches are welcome.

One single comment: that's *great* stuff.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
  2012-08-14  7:44 ` Bastien
@ 2012-08-14  9:40 ` Rasmus
  2012-08-14 10:01   ` Bastien
  2012-08-15  3:25 ` Eric Abrahamsen
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 35+ messages in thread
From: Rasmus @ 2012-08-14  9:40 UTC (permalink / raw)
  To: emacs-orgmode


Eric Schulte <eric.schulte@gmx.com> writes:

> I've recently put together a web server which runs in Emacs and exports
> local Org-mode files to HTML in such a way that they may be edited from
> within a web browser with the edits saved to local files on disk.  The
> code is available from github.

That's very cool!  Good job!  This could be useful.  Would this be
something that could eventually be used in the Worg?

–Rasmus

-- 
Hooray!

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-14  9:40 ` Rasmus
@ 2012-08-14 10:01   ` Bastien
  2012-08-14 12:56     ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Bastien @ 2012-08-14 10:01 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> That's very cool!  Good job!  This could be useful.  Would this be
> something that could eventually be used in the Worg?

If there are some good ideas, and if Jason (as the security guy for 
the server) is okay, why not?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-14 10:01   ` Bastien
@ 2012-08-14 12:56     ` Eric Schulte
  2012-08-14 21:45       ` Bastien
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-14 12:56 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Rasmus

Bastien <bzg@gnu.org> writes:

> Rasmus <rasmus@gmx.us> writes:
>
>> That's very cool!  Good job!  This could be useful.  Would this be
>> something that could eventually be used in the Worg?
>
> If there are some good ideas, and if Jason (as the security guy for 
> the server) is okay, why not?

With respect to security, elnode has a simple authentication system
which seems to work well in my local trials.  It has no forms for
setting passwords online, so users would have to generate a hash of
their password locally, and then send the hash to someone who would
manually add it to the elnode authentication database on orgmode.org.

During authentication the hashed password is sent in plain text, so we
would need to run the elnode server behind an https proxy server.  I
don't think this would be difficult to implement and is a good idea for
any system with authentication.

With respect to integration with the existing Worg, this system should
work well in concert with the git backend.  Git could still be used for
offline edits as it is currently.  The org-ehtml server could be
configured to commit all web edits to git.  A conflict checker would be
needed, which could be added to the `org-ehtml-before-save-hook'.

Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-14 12:56     ` Eric Schulte
@ 2012-08-14 21:45       ` Bastien
  2012-08-15 15:31         ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Bastien @ 2012-08-14 21:45 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode, Rasmus

Hi Eric,

Eric Schulte <eric.schulte@gmx.com> writes:

> With respect to security, elnode has a simple authentication system
> which seems to work well in my local trials.  It has no forms for
> setting passwords online, so users would have to generate a hash of
> their password locally, and then send the hash to someone who would
> manually add it to the elnode authentication database on orgmode.org.
>
> During authentication the hashed password is sent in plain text, so we
> would need to run the elnode server behind an https proxy server.  I
> don't think this would be difficult to implement and is a good idea for
> any system with authentication.

Thanks for those details.

> With respect to integration with the existing Worg, this system should
> work well in concert with the git backend.  Git could still be used for
> offline edits as it is currently.  The org-ehtml server could be
> configured to commit all web edits to git.  A conflict checker would be
> needed, which could be added to the `org-ehtml-before-save-hook'.

I think a page should be locked when a user is editing it through
org-ehtml.el.  This would prevent conflicts from concurrent editing
from the web.

As for conflicts between the .org to be written (from org-ehtml) and 
the .org that might have been pushed trough git, what would be the
behavior?  Discard this edit?  Use org-merge-driver to help resolve
the conflict?  Let the user download the .org he has been editing, 
so that his changes are not lost?

This is still quite unclear to me.  

In any case, we should first try this on a prototype for a while and 
see if this is robust enough.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
  2012-08-14  7:44 ` Bastien
  2012-08-14  9:40 ` Rasmus
@ 2012-08-15  3:25 ` Eric Abrahamsen
  2012-08-15 15:17   ` Eric Schulte
  2012-08-16  2:06 ` Ista Zahn
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 35+ messages in thread
From: Eric Abrahamsen @ 2012-08-15  3:25 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Aug 14 2012, Eric Schulte wrote:

> Hi,
>
> I've recently put together a web server which runs in Emacs and exports
> local Org-mode files to HTML in such a way that they may be edited from
> within a web browser with the edits saved to local files on disk.  The
> code is available from github.
>
>          repository ---- https://github.com/eschulte/org-ehtml
>           README ------- http://eschulte.github.com/org-ehtml
>
> This is a very thin Emacs Lisp and JavaScript wrapper around Nic
> Ferrier's elnode Emacs web server [1], and Nicolas Goaziou's structured
> Org-mode file representation and export engine.  It requires Emacs 24
> and the development versions of both Org-mode and elnode.
>
> The code is fairly new so there are likely some kinks to be worked out
> (backup your files before editing them with this web-server), but the
> implementation is very simple and should be easy to modify.  See the
> README for information on how to make use of elnode's authentication
> system, or how to have web edits automatically committed to a local
> version control system.

I gave this a very brief whirl, with the dev versions of emacs, org,
elnode, and org-ehtml, and running the test server on simple.org as
described in the README. Every time I edited a block and clicked "save",
it just deleted the whole block. I got these errors in
~/.elnodelogs/elnode-error:

20120814213846: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59834> with buffer nil
20120814213846: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59834> open from 127.0.0.1
20120814213847: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59836> with buffer nil
20120814213847: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59836> open from 127.0.0.1
20120814213847: filter: calling handler on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: starting HTTP response on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: Elnode-child-process init *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: filter: handler returned on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: Elnode-child-process-filter http state: open data length: 4096 on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: Elnode-child-process-filter http state: open data length: 4096 on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: Elnode-child-process-filter http state: open data length: 1286 on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: Elnode-child-process-sentinel Status @ finished: open -> exit on *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: elnode--http-end ending socket *elnode-webserver-proc*<1> <127.0.0.1:59834>
20120814213848: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59834> with buffer  *elnode-request-59834*
20120814213849: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59834> deleted
20120814213854: filter: calling handler on *elnode-webserver-proc*<1> <127.0.0.1:59836>
20120814213854: starting HTTP response on *elnode-webserver-proc*<1> <127.0.0.1:59836>
20120814213854: elnode--process-send-eof on *elnode-webserver-proc*<1> <127.0.0.1:59836>
20120814213854: elnode--http-end ending socket *elnode-webserver-proc*<1> <127.0.0.1:59836>
20120814213855: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59836> with buffer  *elnode-request-59836*
20120814213855: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59836> deleted
20120814213855: filter: handler returned on *elnode-webserver-proc*<1> <127.0.0.1:59836>
20120814213940: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59848> with buffer nil
20120814213940: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59848> open from 127.0.0.1
20120814213940: filter: calling handler on *elnode-webserver-proc*<1> <127.0.0.1:59848>
20120814213940: starting HTTP response on *elnode-webserver-proc*<1> <127.0.0.1:59848>
20120814213940: elnode--process-send-eof on *elnode-webserver-proc*<1> <127.0.0.1:59848>
20120814213940: elnode--http-end ending socket *elnode-webserver-proc*<1> <127.0.0.1:59848>
20120814213940: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59848> with buffer  *elnode-request-59848*
20120814213940: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59848> deleted
20120814213941: filter: handler returned on *elnode-webserver-proc*<1> <127.0.0.1:59848>
20120814213954: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59851> with buffer nil
20120814213954: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59851> open from 127.0.0.1
20120814213955: filter: calling handler on *elnode-webserver-proc*<1> <127.0.0.1:59851>
20120814213955: starting HTTP response on *elnode-webserver-proc*<1> <127.0.0.1:59851>
20120814213955: elnode--process-send-eof on *elnode-webserver-proc*<1> <127.0.0.1:59851>
20120814213955: elnode--http-end ending socket *elnode-webserver-proc*<1> <127.0.0.1:59851>
20120814213955: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc*<1> <127.0.0.1:59851> with buffer  *elnode-request-59851*
20120814213955: Elnode status: *elnode-webserver-proc*<1> <127.0.0.1:59851> deleted
20120814213955: filter: handler returned on *elnode-webserver-proc*<1> <127.0.0.1:59851>
20120814214032: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc*<1> with buffer *elnode-webserver*
20120814214032: Elnode server stopped

I'd be happy to mess with this further if it would be helpful.

E

-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.11)
 of 2012-08-06 on pellet
7.8.11

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-15  3:25 ` Eric Abrahamsen
@ 2012-08-15 15:17   ` Eric Schulte
  2012-08-15 23:51     ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-15 15:17 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2196 bytes --]

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> On Tue, Aug 14 2012, Eric Schulte wrote:
>
>> Hi,
>>
>> I've recently put together a web server which runs in Emacs and exports
>> local Org-mode files to HTML in such a way that they may be edited from
>> within a web browser with the edits saved to local files on disk.  The
>> code is available from github.
>>
>>          repository ---- https://github.com/eschulte/org-ehtml
>>           README ------- http://eschulte.github.com/org-ehtml
>>
>> This is a very thin Emacs Lisp and JavaScript wrapper around Nic
>> Ferrier's elnode Emacs web server [1], and Nicolas Goaziou's structured
>> Org-mode file representation and export engine.  It requires Emacs 24
>> and the development versions of both Org-mode and elnode.
>>
>> The code is fairly new so there are likely some kinks to be worked out
>> (backup your files before editing them with this web-server), but the
>> implementation is very simple and should be easy to modify.  See the
>> README for information on how to make use of elnode's authentication
>> system, or how to have web edits automatically committed to a local
>> version control system.
>
> I gave this a very brief whirl, with the dev versions of emacs, org,
> elnode, and org-ehtml, and running the test server on simple.org as
> described in the README. Every time I edited a block and clicked "save",
> it just deleted the whole block. I got these errors in
> ~/.elnodelogs/elnode-error:
>

I'm not sure what could be causing this problem.  Did the test suite run
successfully for you?  I'm betting it did if the problem didn't arise
until you POSTed save data.  Was the block deleted from the Org-mode
file on disk, or just from the web page?  What happens when you refresh
the web page after an edit?

>
> I'd be happy to mess with this further if it would be helpful.
>

This would be very helpful as I can't reproduce the problem locally.

Please re-run with emacs -Q using the attached batch.el ELisp file.
Instructions for re-running are included in the top of the file.  This
will re-run on your system with a minimal configuration, and will stifle
the elnode warning (which are uniformly unhelpful).


[-- Attachment #2: batch.el --]
[-- Type: application/emacs-lisp, Size: 1754 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1185 bytes --]


When I run this locally, I get the following output in my *Messages*
buffer.

,----[*Messages*]
| ---------------------start-relevant-output---------------------
| Added to /home/eschulte/.elnodelogs/elnode-error [3 times]
| Added to /home/eschulte/.elnodelogs/org-ehtml
| OVERVIEW
| Loading vc-git...done
| Saving file /home/eschulte/.emacs.d/src/org-ehtml/test/examples/simple.html...
| Wrote /home/eschulte/.emacs.d/src/org-ehtml/test/examples/simple.html
| Added to /home/eschulte/.elnodelogs/elnode-error [13 times]
| Added to /home/eschulte/.elnodelogs/org-ehtml
| Saving file /home/eschulte/.emacs.d/src/org-ehtml/test/examples/simple.org...
| Wrote /home/eschulte/.emacs.d/src/org-ehtml/test/examples/simple.org
| Added to /home/eschulte/.elnodelogs/elnode-error
| Saving file /tmp/org-11503Cdz...
| Wrote /tmp/org-11503Cdz
| OVERVIEW
| Exporting... [2 times]
| HTML export done, pushed to kill ring and clipboard
| Added to /home/eschulte/.elnodelogs/elnode-error [5 times]
`----

If this doesn't solve the problem I can send a modified version of the
attached batch.el file which will include more debug output.

Thanks,

>
> E

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-14 21:45       ` Bastien
@ 2012-08-15 15:31         ` Eric Schulte
  0 siblings, 0 replies; 35+ messages in thread
From: Eric Schulte @ 2012-08-15 15:31 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Rasmus

Bastien <bzg@gnu.org> writes:

> Hi Eric,
>
> Eric Schulte <eric.schulte@gmx.com> writes:
>
>> With respect to security, elnode has a simple authentication system
>> which seems to work well in my local trials.  It has no forms for
>> setting passwords online, so users would have to generate a hash of
>> their password locally, and then send the hash to someone who would
>> manually add it to the elnode authentication database on orgmode.org.
>>
>> During authentication the hashed password is sent in plain text, so we
>> would need to run the elnode server behind an https proxy server.  I
>> don't think this would be difficult to implement and is a good idea for
>> any system with authentication.
>
> Thanks for those details.
>
>> With respect to integration with the existing Worg, this system should
>> work well in concert with the git backend.  Git could still be used for
>> offline edits as it is currently.  The org-ehtml server could be
>> configured to commit all web edits to git.  A conflict checker would be
>> needed, which could be added to the `org-ehtml-before-save-hook'.
>
> I think a page should be locked when a user is editing it through
> org-ehtml.el.  This would prevent conflicts from concurrent editing
> from the web.
>
> As for conflicts between the .org to be written (from org-ehtml) and 
> the .org that might have been pushed trough git, what would be the
> behavior?  Discard this edit?  Use org-merge-driver to help resolve
> the conflict?  Let the user download the .org he has been editing, 
> so that his changes are not lost?
>

I haven't given this much thought, but my first instinct is to avoid any
use of locking.  I think the conflict resolution model used by version
control systems could also be appropriate here.  Namely, the first to
commit an edit has their edit applied, and any subsequent out-of-date
edits are merged.

- if the backend VC system is able to automatically merge the edit, then
  this will be done automatically.  The probability of a successful
  merge becomes more likely if the new org-merge engine is used by the
  backing VC system.

- if such a merge is not possible, then the edited version should be
  saved in some way.  maybe this data should be presented to the user in
  a plain text block or as a file download (depending on edit size).
  The user could then refresh the org page to get the new version and
  manually incorporate their edit.

- if at some point in the hazy distant future someone builds a simple
  elnode web interface to ediff, then that could be used to perform live
  merges of files.  Such a system would boast better conflict handling
  than any existing wiki system of which I'm currently aware.

>
> This is still quite unclear to me.
>
> In any case, we should first try this on a prototype for a while and 
> see if this is robust enough.

I absolutely agree, this is not yet ready for Worg.  After we figure out
good answers to the above we can try a test run in a sandbox, and then
possibly migrate to Worg only after we're convinced this is stable.

I view org-ehtml as an opportunistic integration of a confluence of
developments in elnode and org-element.  While I think it is an elegant
design and has a lot of potential I wouldn't call it a production-ready
system.

Thanks

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-15 15:17   ` Eric Schulte
@ 2012-08-15 23:51     ` Eric Schulte
  2012-08-16  5:08       ` Eric Abrahamsen
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-15 23:51 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

>> Every time I edited a block and clicked "save", it just deleted the
>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>
>
> I'm not sure what could be causing this problem.  Did the test suite run
> successfully for you?

I've now added a POST test to the test suite.  So if your problem
persists you should now see a failing test, and conversely if you are
now passing the test suite this problem should be eliminated.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
                   ` (2 preceding siblings ...)
  2012-08-15  3:25 ` Eric Abrahamsen
@ 2012-08-16  2:06 ` Ista Zahn
  2012-08-16  6:31   ` Eric Schulte
  2012-10-02  5:23 ` Eric S Fraga
  2012-10-21 18:27 ` Simon Thum
  5 siblings, 1 reply; 35+ messages in thread
From: Ista Zahn @ 2012-08-16  2:06 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Hi Eric,

Sounds really cool, I'd love to try it out. But when I run (ert
"org-ehtml") I get errors like

Selector: "org-ehtml"
Passed: 0
Failed: 5 (5 unexpected)
Total:  5/6

Started at:   2012-08-15 22:00:20-0400
Finished.
Finished at:  2012-08-15 22:00:50-0400

FFQFFF

F org-ehtml-elnode-serve-all-editable
    (void-function cl-flet)

F org-ehtml-elnode-serve-complex
    (void-function cl-flet)

Q org-ehtml-elnode-serve-simple
    (quit)

F org-ehtml-export-file
    (void-variable org-export-with-LaTeX-fragments)

F org-ehtml-post-request
    (error "Shell command in progress")

F org-ehtml-simple-export
    (void-variable org-export-with-LaTeX-fragments)

This is with the git version of org and emacs 24.1.1

Any ideas what I might have missed?

Thanks,
Ista

On Mon, Aug 13, 2012 at 6:28 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Hi,
>
> I've recently put together a web server which runs in Emacs and exports
> local Org-mode files to HTML in such a way that they may be edited from
> within a web browser with the edits saved to local files on disk.  The
> code is available from github.
>
>          repository ---- https://github.com/eschulte/org-ehtml
>           README ------- http://eschulte.github.com/org-ehtml
>
> This is a very thin Emacs Lisp and JavaScript wrapper around Nic
> Ferrier's elnode Emacs web server [1], and Nicolas Goaziou's structured
> Org-mode file representation and export engine.  It requires Emacs 24
> and the development versions of both Org-mode and elnode.
>
> The code is fairly new so there are likely some kinks to be worked out
> (backup your files before editing them with this web-server), but the
> implementation is very simple and should be easy to modify.  See the
> README for information on how to make use of elnode's authentication
> system, or how to have web edits automatically committed to a local
> version control system.
>
> Comments and patches are welcome.
>
> Cheers,
>
> Footnotes:
> [1]  https://github.com/nicferrier/elnode
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte
>

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-15 23:51     ` Eric Schulte
@ 2012-08-16  5:08       ` Eric Abrahamsen
  2012-08-16  6:45         ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Abrahamsen @ 2012-08-16  5:08 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Aug 16 2012, Eric Schulte wrote:

>>> Every time I edited a block and clicked "save", it just deleted the
>>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>>
>>
>> I'm not sure what could be causing this problem.  Did the test suite run
>> successfully for you?
>
> I've now added a POST test to the test suite.  So if your problem
> persists you should now see a failing test, and conversely if you are
> now passing the test suite this problem should be eliminated.

So yes, I did run the tests the first time, and you're right that,
without the "post" test, they went just fine. The documents were also
altered on-disk (ie, the chunks really were deleted). I updated
org-ehtml to get the new tests, and the "post" test failed thusly:

--8<---------------cut here---------------start------------->8---
F org-ehtml-post-request
    (ert-test-failed
     ((should
       (string-match "<i>foo</i>" html))
      :form
      (string-match "<i>foo</i>"
		    #("\n<p><em>foo</em>\n</p>" 0 17
		      (fontified t front-sticky
				 (field inhibit-line-move-field-capture)
				 rear-nonsticky t field output inhibit-line-move-field-capture t)
		      17 21
		      (fontified t front-sticky
				 (field inhibit-line-move-field-capture)
				 rear-nonsticky t field output inhibit-line-move-field-capture t)))
      :value nil))
--8<---------------cut here---------------end--------------->8---

This is still with my regular emacs environment.

Then I restarted emacs -Q and used your batch.el file. I'm still getting
the same problem, unfortunately: the editable blocks disappear when I
hit "save". I realized I don't actually know whether this is supposed to
edit the simple.org or simple.html files: anyway, the text disappears
from the org file, but not from the html file. Here's the output of
*Messages*:

--8<---------------cut here---------------start------------->8---
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set [2 times]
deleting server process
Added to /home/eric/.elnodelogs/elnode-error
found the server process - NOT deleting
Added to /home/eric/.elnodelogs/elnode-error
---------------------start-relevant-output---------------------
Added to /home/eric/.elnodelogs/elnode-error [5 times]
Added to /home/eric/.elnodelogs/org-ehtml
Added to /home/eric/.elnodelogs/elnode-error [11 times]
Added to /home/eric/.elnodelogs/org-ehtml
Added to /home/eric/.elnodelogs/elnode-error [9 times]
Added to /home/eric/.elnodelogs/org-ehtml
OVERVIEW
Loading vc-git...done
Saving file /home/eric/.emacs.d/org-ehtml/test/examples/simple.org...
Wrote /home/eric/.emacs.d/org-ehtml/test/examples/simple.org
Added to /home/eric/.elnodelogs/elnode-error
Saving file /tmp/org-22133iXI...
Wrote /tmp/org-22133iXI
OVERVIEW
Exporting... [2 times]
HTML export done, pushed to kill ring and clipboard
Added to /home/eric/.elnodelogs/elnode-error [8 times]
Added to /home/eric/.elnodelogs/org-ehtml
OVERVIEW
Saving file /home/eric/.emacs.d/org-ehtml/test/examples/simple.org...
Wrote /home/eric/.emacs.d/org-ehtml/test/examples/simple.org
Added to /home/eric/.elnodelogs/elnode-error
Saving file /tmp/org-22133vhO...
Wrote /tmp/org-22133vhO
Exporting... [2 times]
HTML export done, pushed to kill ring and clipboard
Added to /home/eric/.elnodelogs/elnode-error [5 times]
Making completion list...
deleting server process          ; here I called (elnode-stop 3333) explicitly)
Added to /home/eric/.elnodelogs/elnode-error
found the server process - NOT deleting
Added to /home/eric/.elnodelogs/elnode-error
nil
--8<---------------cut here---------------end--------------->8---

And the elnode error file:

--8<---------------cut here---------------start------------->8---
20120816123716: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* with buffer *elnode-webserver*
20120816123716: Elnode server stopped
20120816123751: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc* <127.0.0.1:41647> with buffer nil
20120816123751: Elnode status: *elnode-webserver-proc* <127.0.0.1:41647> open from 127.0.0.1
20120816123751: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc* <127.0.0.1:41649> with buffer nil
20120816123752: Elnode status: *elnode-webserver-proc* <127.0.0.1:41649> open from 127.0.0.1
20120816123752: filter: calling handler on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123752: starting HTTP response on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123752: Elnode-child-process init *elnode-webserver-proc* <127.0.0.1:41647>
20120816123752: filter: handler returned on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123752: Elnode-child-process-filter http state: open data length: 4096 on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123752: Elnode-child-process-filter http state: open data length: 4096 on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123753: Elnode-child-process-filter http state: open data length: 1286 on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123753: Elnode-child-process-sentinel Status @ finished: open -> exit on *elnode-webserver-proc* <127.0.0.1:41647>
20120816123753: elnode--http-end ending socket *elnode-webserver-proc* <127.0.0.1:41647>
20120816123753: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* <127.0.0.1:41647> with buffer  *elnode-request-41647*
20120816123753: Elnode status: *elnode-webserver-proc* <127.0.0.1:41647> deleted
20120816123755: filter: calling handler on *elnode-webserver-proc* <127.0.0.1:41649>
20120816123755: starting HTTP response on *elnode-webserver-proc* <127.0.0.1:41649>
20120816123755: elnode--process-send-eof on *elnode-webserver-proc* <127.0.0.1:41649>
20120816123755: elnode--http-end ending socket *elnode-webserver-proc* <127.0.0.1:41649>
20120816123755: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* <127.0.0.1:41649> with buffer  *elnode-request-41649*
20120816123755: Elnode status: *elnode-webserver-proc* <127.0.0.1:41649> deleted
20120816123755: filter: handler returned on *elnode-webserver-proc* <127.0.0.1:41649>
20120816123842: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc* <127.0.0.1:41660> with buffer nil
20120816123842: Elnode status: *elnode-webserver-proc* <127.0.0.1:41660> open from 127.0.0.1
20120816123842: filter: calling handler on *elnode-webserver-proc* <127.0.0.1:41660>
20120816123843: starting HTTP response on *elnode-webserver-proc* <127.0.0.1:41660>
20120816123843: elnode--process-send-eof on *elnode-webserver-proc* <127.0.0.1:41660>
20120816123843: elnode--http-end ending socket *elnode-webserver-proc* <127.0.0.1:41660>
20120816123843: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* <127.0.0.1:41660> with buffer  *elnode-request-41660*
20120816123843: Elnode status: *elnode-webserver-proc* <127.0.0.1:41660> deleted
20120816123843: filter: handler returned on *elnode-webserver-proc* <127.0.0.1:41660>
20120816123909: elnode--sentinel 'open from 127.0.0.1.' for process  *elnode-webserver-proc* <127.0.0.1:41664> with buffer nil
20120816123909: Elnode status: *elnode-webserver-proc* <127.0.0.1:41664> open from 127.0.0.1
20120816123909: filter: calling handler on *elnode-webserver-proc* <127.0.0.1:41664>
20120816123910: starting HTTP response on *elnode-webserver-proc* <127.0.0.1:41664>
20120816123910: elnode--process-send-eof on *elnode-webserver-proc* <127.0.0.1:41664>
20120816123910: elnode--http-end ending socket *elnode-webserver-proc* <127.0.0.1:41664>
20120816123910: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* <127.0.0.1:41664> with buffer  *elnode-request-41664*
20120816123910: Elnode status: *elnode-webserver-proc* <127.0.0.1:41664> deleted
20120816123910: filter: handler returned on *elnode-webserver-proc* <127.0.0.1:41664>
20120816123943: elnode--sentinel 'deleted.' for process  *elnode-webserver-proc* with buffer *elnode-webserver*
20120816123943: Elnode server stopped
--8<---------------cut here---------------end--------------->8---


-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.11)
 of 2012-08-14 on pellet
7.8.11

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16  2:06 ` Ista Zahn
@ 2012-08-16  6:31   ` Eric Schulte
  2012-08-16 15:58     ` Ista Zahn
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-16  6:31 UTC (permalink / raw)
  To: Ista Zahn; +Cc: Org Mode Mailing List

Ista Zahn <istazahn@gmail.com> writes:

> Hi Eric,
>
> Sounds really cool, I'd love to try it out. But when I run (ert
> "org-ehtml") I get errors like
>
> Selector: "org-ehtml"
> Passed: 0
> Failed: 5 (5 unexpected)
> Total:  5/6
>
> Started at:   2012-08-15 22:00:20-0400
> Finished.
> Finished at:  2012-08-15 22:00:50-0400
>
> FFQFFF
>
> F org-ehtml-elnode-serve-all-editable
>     (void-function cl-flet)
>
> F org-ehtml-elnode-serve-complex
>     (void-function cl-flet)
>
> Q org-ehtml-elnode-serve-simple
>     (quit)
>
> F org-ehtml-export-file
>     (void-variable org-export-with-LaTeX-fragments)
>
> F org-ehtml-post-request
>     (error "Shell command in progress")
>
> F org-ehtml-simple-export
>     (void-variable org-export-with-LaTeX-fragments)
>
> This is with the git version of org and emacs 24.1.1
>
> Any ideas what I might have missed?
>
> Thanks,
> Ista
>

Ah, thanks for sharing this output, it looks like I wasn't careful
enough about ensuring that cl-lib was loaded.  I've added a number of
require statements which should fix the error you pointed out above.

Please grab the latest from git, and let me know if these problems
persist or any new issues assert themselves.

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16  5:08       ` Eric Abrahamsen
@ 2012-08-16  6:45         ` Eric Schulte
  2012-08-16  7:27           ` Eric Abrahamsen
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-16  6:45 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2980 bytes --]

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> On Thu, Aug 16 2012, Eric Schulte wrote:
>
>>>> Every time I edited a block and clicked "save", it just deleted the
>>>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>>>
>>>
>>> I'm not sure what could be causing this problem.  Did the test suite run
>>> successfully for you?
>>
>> I've now added a POST test to the test suite.  So if your problem
>> persists you should now see a failing test, and conversely if you are
>> now passing the test suite this problem should be eliminated.
>
> So yes, I did run the tests the first time, and you're right that,
> without the "post" test, they went just fine. The documents were also
> altered on-disk (ie, the chunks really were deleted).

Interesting.

> I updated org-ehtml to get the new tests, and the "post" test failed
> thusly:
>
> --8<---------------cut here---------------start------------->8---
> F org-ehtml-post-request
>     (ert-test-failed
>      ((should
>        (string-match "<i>foo</i>" html))
>       :form
>       (string-match "<i>foo</i>"
> 		    #("\n<p><em>foo</em>\n</p>" 0 17
> 		      (fontified t front-sticky
> 				 (field inhibit-line-move-field-capture)
> 				 rear-nonsticky t field output inhibit-line-move-field-capture t)
> 		      17 21
> 		      (fontified t front-sticky
> 				 (field inhibit-line-move-field-capture)
> 				 rear-nonsticky t field output inhibit-line-move-field-capture t)))
>       :value nil))
> --8<---------------cut here---------------end--------------->8---
>
> This is still with my regular emacs environment.
>

Even thought this test is failing, it does show that your elnode server
is returning the HTML in response to your POST requests.  It looks like
it only fails because your Emacs exports *foo* as <em>foo</em> instead
of as <i>foo</i>.

>
> Then I restarted emacs -Q and used your batch.el file. I'm still getting
> the same problem, unfortunately: the editable blocks disappear when I
> hit "save". I realized I don't actually know whether this is supposed to
> edit the simple.org or simple.html files:

Edits are applied to the simple.org file itself.  The simple.html file
will not be updated until you refresh the page through your web browser.

> anyway, the text disappears from the org file, but not from the html
> file. Here's the output of *Messages*:
>
[...]

Nothing here looks odd.

>
> And the elnode error file:
>
[...]

The elnode error output don't generally contain anything interesting.
Instead of listing errors it just lists routine access.

I've just pushed up some changes to the git repository which add new
require statements.  Hopefully the errors above were caused by some
required functions not being loaded at run time.  If the newest from git
doesn't work fix these problems, please try running

  emacs -Q -l batch.el

with this updated version of batch.el, and let me know what is printed
in the *Messages* buffer in the line which starts as "params:".


[-- Attachment #2: batch.el --]
[-- Type: application/emacs-lisp, Size: 2827 bytes --]

[-- Attachment #3: Type: text/plain, Size: 55 bytes --]


Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16  6:45         ` Eric Schulte
@ 2012-08-16  7:27           ` Eric Abrahamsen
  2012-08-16 13:36             ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Abrahamsen @ 2012-08-16  7:27 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Aug 16 2012, Eric Schulte wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> On Thu, Aug 16 2012, Eric Schulte wrote:
>>
>>>>> Every time I edited a block and clicked "save", it just deleted the
>>>>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>>>>
>>>>
>>>> I'm not sure what could be causing this problem.  Did the test suite run
>>>> successfully for you?
>>>
>>> I've now added a POST test to the test suite.  So if your problem
>>> persists you should now see a failing test, and conversely if you are
>>> now passing the test suite this problem should be eliminated.
>>
>> So yes, I did run the tests the first time, and you're right that,
>> without the "post" test, they went just fine. The documents were also
>> altered on-disk (ie, the chunks really were deleted).
>
> Interesting.

[...]

> Even thought this test is failing, it does show that your elnode server
> is returning the HTML in response to your POST requests.  It looks like
> it only fails because your Emacs exports *foo* as <em>foo</em> instead
> of as <i>foo</i>.
>
>>
>> Then I restarted emacs -Q and used your batch.el file. I'm still getting
>> the same problem, unfortunately: the editable blocks disappear when I
>> hit "save". I realized I don't actually know whether this is supposed to
>> edit the simple.org or simple.html files:
>

[...]

> I've just pushed up some changes to the git repository which add new
> require statements.  Hopefully the errors above were caused by some
> required functions not being loaded at run time.  If the newest from git
> doesn't work fix these problems, please try running
>
>   emacs -Q -l batch.el
>
> with this updated version of batch.el, and let me know what is printed
> in the *Messages* buffer in the line which starts as "params:".

The same test failed in the same way, so I loaded up the new batch.el
file, and here's the "params" line:

params:(("path" . "/simple.org") ("end" . "577") ("beg" . "156") ("org"
. ""))

Hope that's enlightening!

E

-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.11)
 of 2012-08-14 on pellet
7.8.11

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16  7:27           ` Eric Abrahamsen
@ 2012-08-16 13:36             ` Eric Schulte
  2012-08-16 14:41               ` Eric Abrahamsen
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-16 13:36 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> On Thu, Aug 16 2012, Eric Schulte wrote:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> On Thu, Aug 16 2012, Eric Schulte wrote:
>>>
>>>>>> Every time I edited a block and clicked "save", it just deleted the
>>>>>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>>>>>
>>>>>
>>>>> I'm not sure what could be causing this problem.  Did the test suite run
>>>>> successfully for you?
>>>>
>>>> I've now added a POST test to the test suite.  So if your problem
>>>> persists you should now see a failing test, and conversely if you are
>>>> now passing the test suite this problem should be eliminated.
>>>
>>> So yes, I did run the tests the first time, and you're right that,
>>> without the "post" test, they went just fine. The documents were also
>>> altered on-disk (ie, the chunks really were deleted).
>>
>> Interesting.
>
> [...]
>
>> Even thought this test is failing, it does show that your elnode server
>> is returning the HTML in response to your POST requests.  It looks like
>> it only fails because your Emacs exports *foo* as <em>foo</em> instead
>> of as <i>foo</i>.
>>
>>>
>>> Then I restarted emacs -Q and used your batch.el file. I'm still getting
>>> the same problem, unfortunately: the editable blocks disappear when I
>>> hit "save". I realized I don't actually know whether this is supposed to
>>> edit the simple.org or simple.html files:
>>
>
> [...]
>
>> I've just pushed up some changes to the git repository which add new
>> require statements.  Hopefully the errors above were caused by some
>> required functions not being loaded at run time.  If the newest from git
>> doesn't work fix these problems, please try running
>>
>>   emacs -Q -l batch.el
>>
>> with this updated version of batch.el, and let me know what is printed
>> in the *Messages* buffer in the line which starts as "params:".
>
> The same test failed in the same way,

Fair enough, this must be a legitimate difference in our HTML export,
I'll make the test appropriately more permissive.

> so I loaded up the new batch.el file, and here's the "params" line:
>
> params:(("path" . "/simple.org") ("end" . "577") ("beg" . "156") ("org"
> . ""))
>
> Hope that's enlightening!
>

Yes, very enlightening.  It means that the server-side and Emacs Lisp
side are working as expected.  However, for some reason, when you hit
[SAVE] the information submitted by your browser includes an empty text
field (this is the "org" pair above).

This must be a JavaScript issue related to some difference between
browsers.  Can I ask, what browser you are using?  I've done all of my
testing with browsers in the Firefox family (Firefox and conkeror).

Thanks!

>
> E

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 13:36             ` Eric Schulte
@ 2012-08-16 14:41               ` Eric Abrahamsen
  2012-08-16 15:08                 ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Abrahamsen @ 2012-08-16 14:41 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Aug 16 2012, Eric Schulte wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> On Thu, Aug 16 2012, Eric Schulte wrote:
>>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>
>>>> On Thu, Aug 16 2012, Eric Schulte wrote:
>>>>
>>>>>>> Every time I edited a block and clicked "save", it just deleted the
>>>>>>> whole block. I got these errors in ~/.elnodelogs/elnode-error:
>>>>>>>
>>>>>>
>>>>>> I'm not sure what could be causing this problem.  Did the test suite run
>>>>>> successfully for you?
>>>>>
>>>>> I've now added a POST test to the test suite.  So if your problem
>>>>> persists you should now see a failing test, and conversely if you are
>>>>> now passing the test suite this problem should be eliminated.
>>>>
>>>> So yes, I did run the tests the first time, and you're right that,
>>>> without the "post" test, they went just fine. The documents were also
>>>> altered on-disk (ie, the chunks really were deleted).
>>>
>>> Interesting.
>>
>> [...]
>>
>>> Even thought this test is failing, it does show that your elnode server
>>> is returning the HTML in response to your POST requests.  It looks like
>>> it only fails because your Emacs exports *foo* as <em>foo</em> instead
>>> of as <i>foo</i>.
>>>
>>>>
>>>> Then I restarted emacs -Q and used your batch.el file. I'm still getting
>>>> the same problem, unfortunately: the editable blocks disappear when I
>>>> hit "save". I realized I don't actually know whether this is supposed to
>>>> edit the simple.org or simple.html files:
>>>
>>
>> [...]
>>
>>> I've just pushed up some changes to the git repository which add new
>>> require statements.  Hopefully the errors above were caused by some
>>> required functions not being loaded at run time.  If the newest from git
>>> doesn't work fix these problems, please try running
>>>
>>>   emacs -Q -l batch.el
>>>
>>> with this updated version of batch.el, and let me know what is printed
>>> in the *Messages* buffer in the line which starts as "params:".
>>
>> The same test failed in the same way,
>
> Fair enough, this must be a legitimate difference in our HTML export,
> I'll make the test appropriately more permissive.
>
>> so I loaded up the new batch.el file, and here's the "params" line:
>>
>> params:(("path" . "/simple.org") ("end" . "577") ("beg" . "156") ("org"
>> . ""))
>>
>> Hope that's enlightening!
>>
>
> Yes, very enlightening.  It means that the server-side and Emacs Lisp
> side are working as expected.  However, for some reason, when you hit
> [SAVE] the information submitted by your browser includes an empty text
> field (this is the "org" pair above).
>
> This must be a JavaScript issue related to some difference between
> browsers.  Can I ask, what browser you are using?  I've done all of my
> testing with browsers in the Firefox family (Firefox and conkeror).

I'm using the version of Chrome provided by Arch linux, it tells me
Version 21.0.1180.79 (151411). I just tried the test server in Firefox,
and it worked perfectly.

Much as I like Chrome, I've occasionally seen it make websites fail in
ways you wouldn't think a browser should be capable of.


-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.11) of
 2012-08-14 on pellet 7.8.11

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 14:41               ` Eric Abrahamsen
@ 2012-08-16 15:08                 ` Eric Schulte
  0 siblings, 0 replies; 35+ messages in thread
From: Eric Schulte @ 2012-08-16 15:08 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

>>
>> This must be a JavaScript issue related to some difference between
>>browsers.  Can I ask, what browser you are using?  I've done all of my
>>testing with browsers in the Firefox family (Firefox and conkeror).
>
> I'm using the version of Chrome provided by Arch linux, it tells me
> Version 21.0.1180.79 (151411). I just tried the test server in Firefox,
> and it worked perfectly.
>
> Much as I like Chrome, I've occasionally seen it make websites fail in
> ways you wouldn't think a browser should be capable of.

Good to know thanks.  I'll make a note of this and take a look at it
when next I have some free time.  My Java Script is not strong, so maybe
there is a more inter-operable way to write this file.  If anyone has
Java Script and JQuery experience and wants to take a look the problem
is around line 14 of src/org-ehtml-client.js.

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16  6:31   ` Eric Schulte
@ 2012-08-16 15:58     ` Ista Zahn
  2012-08-16 16:36       ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Ista Zahn @ 2012-08-16 15:58 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

On Thu, Aug 16, 2012 at 2:31 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Ista Zahn <istazahn@gmail.com> writes:
>
>> Hi Eric,
>>
>> Sounds really cool, I'd love to try it out. But when I run (ert
>> "org-ehtml") I get errors like
>>
>> Selector: "org-ehtml"
>> Passed: 0
>> Failed: 5 (5 unexpected)
>> Total:  5/6
>>
>> Started at:   2012-08-15 22:00:20-0400
>> Finished.
>> Finished at:  2012-08-15 22:00:50-0400
>>
>> FFQFFF
>>
>> F org-ehtml-elnode-serve-all-editable
>>     (void-function cl-flet)
>>
>> F org-ehtml-elnode-serve-complex
>>     (void-function cl-flet)
>>
>> Q org-ehtml-elnode-serve-simple
>>     (quit)
>>
>> F org-ehtml-export-file
>>     (void-variable org-export-with-LaTeX-fragments)
>>
>> F org-ehtml-post-request
>>     (error "Shell command in progress")
>>
>> F org-ehtml-simple-export
>>     (void-variable org-export-with-LaTeX-fragments)
>>
>> This is with the git version of org and emacs 24.1.1
>>
>> Any ideas what I might have missed?
>>
>> Thanks,
>> Ista
>>
>
> Ah, thanks for sharing this output, it looks like I wasn't careful
> enough about ensuring that cl-lib was loaded.  I've added a number of
> require statements which should fix the error you pointed out above.
>
> Please grab the latest from git, and let me know if these problems
> persist or any new issues assert themselves.

With the current git version I now get "File error: Cannot open load
file, cl-lib" on start up.

find / -name cl-lib.el does not produce any results on my machine, nor
have I been able to find it in elpa/marmalade etc. Google search
suggests it is built in with emacs, but I'm pretty sure I don't have
it...

Best,
Ista

>
> Thanks,
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 15:58     ` Ista Zahn
@ 2012-08-16 16:36       ` Eric Schulte
  2012-08-16 17:44         ` Achim Gratz
  2012-08-16 19:43         ` Ista Zahn
  0 siblings, 2 replies; 35+ messages in thread
From: Eric Schulte @ 2012-08-16 16:36 UTC (permalink / raw)
  To: Ista Zahn; +Cc: Org Mode Mailing List

Ista Zahn <istazahn@gmail.com> writes:

> On Thu, Aug 16, 2012 at 2:31 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
>> Ista Zahn <istazahn@gmail.com> writes:
>>
>>> Hi Eric,
>>>
>>> Sounds really cool, I'd love to try it out. But when I run (ert
>>> "org-ehtml") I get errors like
>>>
>>> Selector: "org-ehtml"
>>> Passed: 0
>>> Failed: 5 (5 unexpected)
>>> Total:  5/6
>>>
>>> Started at:   2012-08-15 22:00:20-0400
>>> Finished.
>>> Finished at:  2012-08-15 22:00:50-0400
>>>
>>> FFQFFF
>>>
>>> F org-ehtml-elnode-serve-all-editable
>>>     (void-function cl-flet)
>>>
>>> F org-ehtml-elnode-serve-complex
>>>     (void-function cl-flet)
>>>
>>> Q org-ehtml-elnode-serve-simple
>>>     (quit)
>>>
>>> F org-ehtml-export-file
>>>     (void-variable org-export-with-LaTeX-fragments)
>>>
>>> F org-ehtml-post-request
>>>     (error "Shell command in progress")
>>>
>>> F org-ehtml-simple-export
>>>     (void-variable org-export-with-LaTeX-fragments)
>>>
>>> This is with the git version of org and emacs 24.1.1
>>>
>>> Any ideas what I might have missed?
>>>
>>> Thanks,
>>> Ista
>>>
>>
>> Ah, thanks for sharing this output, it looks like I wasn't careful
>> enough about ensuring that cl-lib was loaded.  I've added a number of
>> require statements which should fix the error you pointed out above.
>>
>> Please grab the latest from git, and let me know if these problems
>> persist or any new issues assert themselves.
>
> With the current git version I now get "File error: Cannot open load
> file, cl-lib" on start up.
>
> find / -name cl-lib.el does not produce any results on my machine, nor
> have I been able to find it in elpa/marmalade etc. Google search
> suggests it is built in with emacs, but I'm pretty sure I don't have
> it...
>

Ugh, this is more headache related to the renaming of all cl-* functions
between the released version of Emacs 24 and the development head of
Emacs (which I'm using).  I've just pushed up a change after which all
tests are passing on both the development head and the released version
of Emacs 24.

Thanks for your help in running this down.

Best,

>
> Best,
> Ista
>
>>
>> Thanks,
>>
>> --
>> Eric Schulte
>> http://cs.unm.edu/~eschulte
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 16:36       ` Eric Schulte
@ 2012-08-16 17:44         ` Achim Gratz
  2012-08-16 20:05           ` Eric Schulte
  2012-08-16 19:43         ` Ista Zahn
  1 sibling, 1 reply; 35+ messages in thread
From: Achim Gratz @ 2012-08-16 17:44 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte writes:
> Ugh, this is more headache related to the renaming of all cl-* functions
> between the released version of Emacs 24 and the development head of
> Emacs (which I'm using).  I've just pushed up a change after which all
> tests are passing on both the development head and the released version
> of Emacs 24.

Note that there's yet a new wrinkle with the upcoming release of the
24.2 version (which hasn't made the change yet), so 24.1.50 and
24.2.50 and later have new-style cl libraries...


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 16:36       ` Eric Schulte
  2012-08-16 17:44         ` Achim Gratz
@ 2012-08-16 19:43         ` Ista Zahn
  2012-08-16 20:11           ` Eric Schulte
  1 sibling, 1 reply; 35+ messages in thread
From: Ista Zahn @ 2012-08-16 19:43 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

On Thu, Aug 16, 2012 at 12:36 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Ista Zahn <istazahn@gmail.com> writes:
>
>> On Thu, Aug 16, 2012 at 2:31 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
>>> Ista Zahn <istazahn@gmail.com> writes:
>>>
>>>> Hi Eric,
>>>>
>>>> Sounds really cool, I'd love to try it out. But when I run (ert
>>>> "org-ehtml") I get errors like
>>>>
>>>> Selector: "org-ehtml"
>>>> Passed: 0
>>>> Failed: 5 (5 unexpected)
>>>> Total:  5/6
>>>>
>>>> Started at:   2012-08-15 22:00:20-0400
>>>> Finished.
>>>> Finished at:  2012-08-15 22:00:50-0400
>>>>
>>>> FFQFFF
>>>>
>>>> F org-ehtml-elnode-serve-all-editable
>>>>     (void-function cl-flet)
>>>>
>>>> F org-ehtml-elnode-serve-complex
>>>>     (void-function cl-flet)
>>>>
>>>> Q org-ehtml-elnode-serve-simple
>>>>     (quit)
>>>>
>>>> F org-ehtml-export-file
>>>>     (void-variable org-export-with-LaTeX-fragments)
>>>>
>>>> F org-ehtml-post-request
>>>>     (error "Shell command in progress")
>>>>
>>>> F org-ehtml-simple-export
>>>>     (void-variable org-export-with-LaTeX-fragments)
>>>>
>>>> This is with the git version of org and emacs 24.1.1
>>>>
>>>> Any ideas what I might have missed?
>>>>
>>>> Thanks,
>>>> Ista
>>>>
>>>
>>> Ah, thanks for sharing this output, it looks like I wasn't careful
>>> enough about ensuring that cl-lib was loaded.  I've added a number of
>>> require statements which should fix the error you pointed out above.
>>>
>>> Please grab the latest from git, and let me know if these problems
>>> persist or any new issues assert themselves.
>>
>> With the current git version I now get "File error: Cannot open load
>> file, cl-lib" on start up.
>>
>> find / -name cl-lib.el does not produce any results on my machine, nor
>> have I been able to find it in elpa/marmalade etc. Google search
>> suggests it is built in with emacs, but I'm pretty sure I don't have
>> it...
>>
>
> Ugh, this is more headache related to the renaming of all cl-* functions
> between the released version of Emacs 24 and the development head of
> Emacs (which I'm using).  I've just pushed up a change after which all
> tests are passing on both the development head and the released version
> of Emacs 24.
>
> Thanks for your help in running this down.


All is working as expected, and as expected it's really cool. Thank you!

Now if I could just edit babel source blocks and have the results
blocks update on the fly I would be in R workshop presenter heaven.
Any chance of this sort of thing down the road?

>
> Best,
>
>>
>> Best,
>> Ista
>>
>>>
>>> Thanks,
>>>
>>> --
>>> Eric Schulte
>>> http://cs.unm.edu/~eschulte
>>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 17:44         ` Achim Gratz
@ 2012-08-16 20:05           ` Eric Schulte
  0 siblings, 0 replies; 35+ messages in thread
From: Eric Schulte @ 2012-08-16 20:05 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Eric Schulte writes:
>> Ugh, this is more headache related to the renaming of all cl-* functions
>> between the released version of Emacs 24 and the development head of
>> Emacs (which I'm using).  I've just pushed up a change after which all
>> tests are passing on both the development head and the released version
>> of Emacs 24.
>
> Note that there's yet a new wrinkle with the upcoming release of the
> 24.2 version (which hasn't made the change yet), so 24.1.50 and
> 24.2.50 and later have new-style cl libraries...
>

Ah, good to know thanks.  I guess I should catch up on my emacs-dev
reading.

Cheers,

>
>
> Regards,
> Achim.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 19:43         ` Ista Zahn
@ 2012-08-16 20:11           ` Eric Schulte
  2012-08-16 20:50             ` Ista Zahn
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-08-16 20:11 UTC (permalink / raw)
  To: Ista Zahn; +Cc: Org Mode Mailing List

>
>
> All is working as expected, and as expected it's really cool. Thank you!
>

Great, happy its working.

>
> Now if I could just edit babel source blocks and have the results
> blocks update on the fly I would be in R workshop presenter heaven.
> Any chance of this sort of thing down the road?
>

Yea, I haven't implemented an edit interface for code blocks yet.  As
you suggest I think that they could benefit from a customized edit
interface, luckily Nicolas' org-export makes element-specific exports
easy to implement.

I'm not sure what sort of interaction would be best...
- would a [RUN] button be useful
- should just the body of the code block be editable, or everything
- should code block results have a re-run button

No solution has jumped out yet, so I'm just wanting till something seems
obvious.  If you have more specific ideas I'd love to hear them.  I
think something like Python's notebooks should be fairly easy to
implement.

Cheers,

>
>>
>> Best,
>>
>>>
>>> Best,
>>> Ista
>>>
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> Eric Schulte
>>>> http://cs.unm.edu/~eschulte
>>>
>>
>> --
>> Eric Schulte
>> http://cs.unm.edu/~eschulte
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-16 20:11           ` Eric Schulte
@ 2012-08-16 20:50             ` Ista Zahn
  0 siblings, 0 replies; 35+ messages in thread
From: Ista Zahn @ 2012-08-16 20:50 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

On Thu, Aug 16, 2012 at 4:11 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
>>
>>
>> All is working as expected, and as expected it's really cool. Thank you!
>>
>
> Great, happy its working.
>
>>
>> Now if I could just edit babel source blocks and have the results
>> blocks update on the fly I would be in R workshop presenter heaven.
>> Any chance of this sort of thing down the road?
>>
>
> Yea, I haven't implemented an edit interface for code blocks yet.  As
> you suggest I think that they could benefit from a customized edit
> interface, luckily Nicolas' org-export makes element-specific exports
> easy to implement.
>
> I'm not sure what sort of interaction would be best...
> - would a [RUN] button be useful
> - should just the body of the code block be editable, or everything
> - should code block results have a re-run button

Personally I would like to see it work pretty much the same as other
editable elements, except that it would re-run the code and update the
results block. So you could just

1) click to edit the source block
2) make changes to the code
3) click save

and any results block would be updated to the result of your changes in step 2.


Best,
Ista
>
> No solution has jumped out yet, so I'm just wanting till something seems
> obvious.  If you have more specific ideas I'd love to hear them.  I
> think something like Python's notebooks should be fairly easy to
> implement.
>
> Cheers,
>
>>
>>>
>>> Best,
>>>
>>>>
>>>> Best,
>>>> Ista
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> --
>>>>> Eric Schulte
>>>>> http://cs.unm.edu/~eschulte
>>>>
>>>
>>> --
>>> Eric Schulte
>>> http://cs.unm.edu/~eschulte
>>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
                   ` (3 preceding siblings ...)
  2012-08-16  2:06 ` Ista Zahn
@ 2012-10-02  5:23 ` Eric S Fraga
  2012-10-05  3:23   ` Eric Schulte
  2012-10-21 18:27 ` Simon Thum
  5 siblings, 1 reply; 35+ messages in thread
From: Eric S Fraga @ 2012-10-02  5:23 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Eric Schulte <eric.schulte@gmx.com> writes:

> Hi,
>
> I've recently put together a web server which runs in Emacs and exports
> local Org-mode files to HTML in such a way that they may be edited from
> within a web browser with the edits saved to local files on disk.  The
> code is available from github.

Eric,

I have been playing with this.  I really like it!

What I have been testing is how well it interacts with other CSS style
files.  Some work better than others but, most importantly, they all
require adding the following:

:     #+STYLE: <style> .raw-org { display: none;} </style>

to the individual org files so that the content displayed is only the
html generated by the export.  There may be a better/easier way to
handle this, of course.

More playing to be done... but I can see this being quite useful!  It
works really nicely with firefox in combination with a browser plugin
which allows me to edit the text in the boxes using emacsclient (with
org mode enabled!).

thanks (and to Nic as well for elnode),
eric
-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-360-g2a95a4

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-02  5:23 ` Eric S Fraga
@ 2012-10-05  3:23   ` Eric Schulte
  0 siblings, 0 replies; 35+ messages in thread
From: Eric Schulte @ 2012-10-05  3:23 UTC (permalink / raw)
  To: Org Mode Mailing List

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Eric Schulte <eric.schulte@gmx.com> writes:
>
>> Hi,
>>
>> I've recently put together a web server which runs in Emacs and exports
>> local Org-mode files to HTML in such a way that they may be edited from
>> within a web browser with the edits saved to local files on disk.  The
>> code is available from github.
>
> Eric,
>
> I have been playing with this.  I really like it!
>

Great, I'm happy its working for you, I've been using it myself and
enjoying it.  Hopefully now that it is ELPA installable it will be
easier for more people to try it out.

>
> What I have been testing is how well it interacts with other CSS style
> files.  Some work better than others but, most importantly, they all
> require adding the following:
>
> :     #+STYLE: <style> .raw-org { display: none;} </style>
>
> to the individual org files so that the content displayed is only the
> html generated by the export.  There may be a better/easier way to
> handle this, of course.
>

Yes, the above is needed to hide the raw Org-mode text until it is
edited.  You can customize the org-ehtml-client-style variable to set
whatever CSS you like as the default.  Similarly it should be fairly
easy for anyone fluent in JavaScript to hack org-ehtml-client-js if they
want to try different behavior.  One of my main goals in writing
org-ehtml was to keep things as small, simple and hackable as possible.

>
> More playing to be done... but I can see this being quite useful!  It
> works really nicely with firefox in combination with a browser plugin
> which allows me to edit the text in the boxes using emacsclient (with
> org mode enabled!).
>

Oh great, I used to use that same browser plugin, but for the last year
or so I've gone whole hog and switched to using conkeror as my web
browser. http://conkeror.org/

>
> thanks (and to Nic as well for elnode),
> eric

Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
                   ` (4 preceding siblings ...)
  2012-10-02  5:23 ` Eric S Fraga
@ 2012-10-21 18:27 ` Simon Thum
  2012-10-22 20:38   ` Eric Schulte
  5 siblings, 1 reply; 35+ messages in thread
From: Simon Thum @ 2012-10-21 18:27 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Hi Eric,

thank you for this very interesting thing!

I have two comments from my first testing.
1) It seems editing is eating all the whitespace in a section. They 
probably need html protection. (&nbsp; or the like)
2) I cannot use the auth handler:

signal(error ("Elnode cannot set a wrapper for /login/ on 
org-ehtml-auth-handler"))
   error("Elnode cannot set a wrapper for /login/ on 
org-ehtml-auth-handler")
   elnode-set-wrapper(org-ehtml-auth-handler #[513 "\211\302 (...junk)
   elnode--auth-define-scheme-do-wrap((org-ehtml-auth-handler #[513 " 
(...junk)
require(org-ehtml-auth)
   (progn (require (quote org-ehtml-auth)) (setq 
org-ehtml-everything-editable t org-ehtml-docroot "~/org" 
my-org-ehtml-port 3333) (elnode-start (quote org-ehtml-auth-handler) 
:port my-org-ehtml-port))
   eval((progn (require (quote org-ehtml-auth)) (setq 
org-ehtml-everything-editable t org-ehtml-docroot "~/org" 
my-org-ehtml-port 3333) (elnode-start (quote org-ehtml-auth-handler) 
:port my-org-ehtml-port)))
   org-babel-execute:emacs-lisp(";; (require 'org-ehtml)\n(require 
'org-ehtml-auth)\n;; Configure the server\n(setq\n 
org-ehtml-everything-editable t\n org-ehtml-docroot \"~/org\"\n 
my-org-ehtml-port 3333\n )\n\n;; Start the server\n(elnode-start 
'org-ehtml-auth-handler :port my-org-ehtml-port)" ((:comments . "") 
(:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") 
(:tangle . "no") (:exports . "code") (:results . "replace") (:session . 
"none") (:padnewline . "yes") (:hlines . "yes") (:colnames . "no") 
(:result-type . value) (:result-params "replace") (:rowname-names) 
(:colname-names)))
   org-babel-execute-src-block(nil ("emacs-lisp" ";; (require 
'org-ehtml)\n(require 'org-ehtml-auth)\n;; Configure the server\n(setq\n 
org-ehtml-everything-editable t\n org-ehtml-docroot \"~/org\"\n 
my-org-ehtml-port 3333\n )\n\n;; Start the server\n(elnode-start 
'org-ehtml-auth-handler :port my-org-ehtml-port)" ((:comments . "") 
(:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") 
(:tangle . "no") (:exports . "code") (:results . "replace") (:session . 
"none") (:padnewline . "yes") (:hlines . "yes") (:colnames . "no") 
(:result-type . value) (:result-params "replace") (:rowname-names) 
(:colname-names)) "" nil 0))
   org-babel-execute-src-block-maybe()
   org-babel-execute-maybe()
   org-babel-execute-safely-maybe()


Likely some oversight on my part.

HTH,

Simon


On 08/14/2012 12:28 AM, Eric Schulte wrote:
> Hi,
>
> I've recently put together a web server which runs in Emacs and exports
> local Org-mode files to HTML in such a way that they may be edited from
> within a web browser with the edits saved to local files on disk.  The
> code is available from github.
>
>           repository ---- https://github.com/eschulte/org-ehtml
>            README ------- http://eschulte.github.com/org-ehtml
>
> This is a very thin Emacs Lisp and JavaScript wrapper around Nic
> Ferrier's elnode Emacs web server [1], and Nicolas Goaziou's structured
> Org-mode file representation and export engine.  It requires Emacs 24
> and the development versions of both Org-mode and elnode.
>
> The code is fairly new so there are likely some kinks to be worked out
> (backup your files before editing them with this web-server), but the
> implementation is very simple and should be easy to modify.  See the
> README for information on how to make use of elnode's authentication
> system, or how to have web edits automatically committed to a local
> version control system.
>
> Comments and patches are welcome.
>
> Cheers,
>
> Footnotes:
> [1]  https://github.com/nicferrier/elnode
>

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-21 18:27 ` Simon Thum
@ 2012-10-22 20:38   ` Eric Schulte
  2012-10-24 19:19     ` Simon Thum
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-10-22 20:38 UTC (permalink / raw)
  To: Simon Thum; +Cc: Org Mode Mailing List

Simon Thum <simon.thum@gmx.de> writes:

> Hi Eric,
>
> thank you for this very interesting thing!
>

Happy you're finding this interesting.

>
> I have two comments from my first testing.
> 1) It seems editing is eating all the whitespace in a section. They
> probably need html protection. (&nbsp; or the like)

I'm not experiencing what I think you're describing.  When I enter say
the following into a text box.

--8<---------------cut here---------------start------------->8---
foo bar  





--8<---------------cut here---------------end--------------->8---

all of the spaces and newlines are inserted into the Org-mode file.
However, when that Org-mode file is re-exported, it uses the normal html
exporter (which *does* ignore whitespace by default).

So, if you are not having the spaces inserted into your Org-mode file
that is a problem with org-ehtml, but if you *are* having the spaces
appear in your .org file (server-side), but they are not appearing in
the exported HTML, that is expected behavior.

> 
> 2) I cannot use the auth handler:
>

Perhaps you could provide a minimal .el initialization file which shows
how you are trying to launch the server?

Hope this Helps,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-22 20:38   ` Eric Schulte
@ 2012-10-24 19:19     ` Simon Thum
  2012-10-28 15:19       ` Eric Schulte
  0 siblings, 1 reply; 35+ messages in thread
From: Simon Thum @ 2012-10-24 19:19 UTC (permalink / raw)
  To: emacs-orgmode

On 10/22/2012 10:38 PM, Eric Schulte wrote:
> Simon Thum<simon.thum@gmx.de>  writes:
> --8<---------------cut here---------------start------------->8---
> foo bar
>
>
>
>
>
> --8<---------------cut here---------------end--------------->8---
>
> all of the spaces and newlines are inserted into the Org-mode file.
> However, when that Org-mode file is re-exported, it uses the normal html
> exporter (which *does* ignore whitespace by default).
>
> So, if you are not having the spaces inserted into your Org-mode file
> that is a problem with org-ehtml, but if you *are* having the spaces
> appear in your .org file (server-side), but they are not appearing in
> the exported HTML, that is expected behavior.

I meant when editing in the HTML page via the server call-back. Changing 
the WS means all lines change, regardless of whether I edited them. From 
your description I assume the edit box content comes out of the export, 
too? I guess that needs to change for this to work reliably.


>
>>
>> 2) I cannot use the auth handler:
>>
>
> Perhaps you could provide a minimal .el initialization file which shows
> how you are trying to launch the server?

Essentially from your README - sadly with -Q it does not work, but I'll 
be back to this in a week or so.

Cheers,

Simon

>
> Hope this Helps,
>

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-24 19:19     ` Simon Thum
@ 2012-10-28 15:19       ` Eric Schulte
  2012-10-28 15:35         ` Simon Thum
  0 siblings, 1 reply; 35+ messages in thread
From: Eric Schulte @ 2012-10-28 15:19 UTC (permalink / raw)
  To: Simon Thum; +Cc: emacs-orgmode

Simon Thum <simon.thum@gmx.de> writes:

> On 10/22/2012 10:38 PM, Eric Schulte wrote:
>> Simon Thum<simon.thum@gmx.de>  writes:
>> --8<---------------cut here---------------start------------->8---
>> foo bar
>>
>>
>>
>>
>>
>> --8<---------------cut here---------------end--------------->8---
>>
>> all of the spaces and newlines are inserted into the Org-mode file.
>> However, when that Org-mode file is re-exported, it uses the normal html
>> exporter (which *does* ignore whitespace by default).
>>
>> So, if you are not having the spaces inserted into your Org-mode file
>> that is a problem with org-ehtml, but if you *are* having the spaces
>> appear in your .org file (server-side), but they are not appearing in
>> the exported HTML, that is expected behavior.
>
> I meant when editing in the HTML page via the server
> call-back. Changing the WS means all lines change, regardless of
> whether I edited them. From your description I assume the edit box
> content comes out of the export, too? I guess that needs to change for
> this to work reliably.
>

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?

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-28 15:19       ` Eric Schulte
@ 2012-10-28 15:35         ` Simon Thum
  2012-10-29  8:29           ` Nitin Agarwal
  0 siblings, 1 reply; 35+ messages in thread
From: Simon Thum @ 2012-10-28 15:35 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-28 15:35         ` Simon Thum
@ 2012-10-29  8:29           ` Nitin Agarwal
  2012-10-30  9:37             ` Nitin Agarwal
  2012-10-30 16:56             ` Eric Schulte
  0 siblings, 2 replies; 35+ messages in thread
From: Nitin Agarwal @ 2012-10-29  8:29 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

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 <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.  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 <nitinagarwal1992@gmail.com>
           *nitin.agarwal@students.iiit.ac.in*

[-- Attachment #2: Type: text/html, Size: 2316 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-29  8:29           ` Nitin Agarwal
@ 2012-10-30  9:37             ` Nitin Agarwal
  2012-10-30 16:56             ` Eric Schulte
  1 sibling, 0 replies; 35+ messages in thread
From: Nitin Agarwal @ 2012-10-30  9:37 UTC (permalink / raw)
  To: Eric Schulte, emacs-orgmode; +Cc: Venkatesh Choppella

[-- Attachment #1: Type: text/plain, Size: 9979 bytes --]

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
<nitinagarwal3006@gmail.com>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 <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.  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 <nitinagarwal1992@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 <nitinagarwal1992@gmail.com>
           *nitin.agarwal@students.iiit.ac.in*

[-- Attachment #2: Type: text/html, Size: 12305 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [ANN] Editable HTML export of Org-mode files
  2012-10-29  8:29           ` Nitin Agarwal
  2012-10-30  9:37             ` Nitin Agarwal
@ 2012-10-30 16:56             ` Eric Schulte
  1 sibling, 0 replies; 35+ messages in thread
From: Eric Schulte @ 2012-10-30 16:56 UTC (permalink / raw)
  To: Nitin Agarwal; +Cc: emacs-orgmode

Nitin Agarwal <nitinagarwal3006@gmail.com> writes:

> The edit button appears only for the content of the subheadings or
> headings of the document.

Look at the call to `org-export-define-derived-backend' in line 107 of
org-ehtml-client [1].  Notice that it defines editable versions of the
existing html export functions for each of the types listed (paragraph,
plain-list, etc...).  These types correspond to org-mode elements as
defined by org-elements.el.

To make the content of headlines editable, you should define a new
export function for headlines either using the `def-ehtml-wrap' function
or possibly using a new export function.

If you do share new code please do so either as diffs against existing
code, or as pull requests on github.  It is too difficult to find the
relevant changes in source code pasted directly into email messages.

Cheers,

Footnotes: 
[1]  https://github.com/eschulte/org-ehtml/blob/master/src/org-ehtml-client.el#L107

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2012-10-30 16:57 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13 22:28 [ANN] Editable HTML export of Org-mode files Eric Schulte
2012-08-14  7:44 ` Bastien
2012-08-14  9:40 ` Rasmus
2012-08-14 10:01   ` Bastien
2012-08-14 12:56     ` Eric Schulte
2012-08-14 21:45       ` Bastien
2012-08-15 15:31         ` Eric Schulte
2012-08-15  3:25 ` Eric Abrahamsen
2012-08-15 15:17   ` Eric Schulte
2012-08-15 23:51     ` Eric Schulte
2012-08-16  5:08       ` Eric Abrahamsen
2012-08-16  6:45         ` Eric Schulte
2012-08-16  7:27           ` Eric Abrahamsen
2012-08-16 13:36             ` Eric Schulte
2012-08-16 14:41               ` Eric Abrahamsen
2012-08-16 15:08                 ` Eric Schulte
2012-08-16  2:06 ` Ista Zahn
2012-08-16  6:31   ` Eric Schulte
2012-08-16 15:58     ` Ista Zahn
2012-08-16 16:36       ` Eric Schulte
2012-08-16 17:44         ` Achim Gratz
2012-08-16 20:05           ` Eric Schulte
2012-08-16 19:43         ` Ista Zahn
2012-08-16 20:11           ` Eric Schulte
2012-08-16 20:50             ` Ista Zahn
2012-10-02  5:23 ` Eric S Fraga
2012-10-05  3:23   ` Eric Schulte
2012-10-21 18:27 ` Simon Thum
2012-10-22 20:38   ` Eric Schulte
2012-10-24 19:19     ` Simon Thum
2012-10-28 15:19       ` Eric Schulte
2012-10-28 15:35         ` Simon Thum
2012-10-29  8:29           ` Nitin Agarwal
2012-10-30  9:37             ` Nitin Agarwal
2012-10-30 16:56             ` Eric Schulte

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.