MoinMoin 2.0 Content Editable
In addition, or as an alternative to section editing, CKedit, or double-click to edit, should moin2 implement whole page HTML5 ContentEditable?
- or just google "html5 contenteditable"
One of the obstacles of doing so is dealing with all the expanded output from macros and transclusions. A possibility:
- add a data-source attribute to macro and transclusions
<<TableOfContents>> generates <div class="table-of-contents" data-source="<<TableOfContents>>">...
- when viewing an editable page, clicking the edit button is optional; if clicked, it would trigger a Javascript function to:
- find all data-source attributes
- generate a p-tag or span-tag sibling before the macro/transclusion output
- these become visible and can be edited
- gray the background of macro and transclusion generated output so the user knows not to edit those areas (these could be edited, but the edits will be discarded)
- note: all these functions are performed on the client-side
- user edits the moin-content area of wiki page
- clicking the save button:
- triggers a javascript function that:
- if the edit button was not clicked, performs the required edit button functions
- deletes the generated output of macros and transclusions from the html dom (raw macros and transclusions remain)
- submits (posts) wiki page content to the (modified?) html-in converter that:
- converts and saves the page in original wiki format
- triggers a javascript function that:
Given that a user may edit a wiki page, and the local wiki has set the content editable option, and the user has selected the content editable option, then any wiki page may be edited by clicking within the page moin-content DIV and typing.
Unlike the CKeditor, there is no edit area or toolbar. The entire moin-content DIV is editable. Normal wiki markup is used to add new content to the page.