Hi,
I've been working on a Wysiwyg editor for Pier, (see attachment). It seems to be in a useable state and I'd love to receive some feedback The editor currently supports all the Pier markup I'm aware of, except tables. That said not all markup is possible to create in wysiwyg mode, however the editor aims to preserve all markup and allow editing of markup created in wiki mode. For example annotated paragraphs can be created in wiki mode, then edited in a Wysiwyg mode. Special Pier markup such as verbatim, embedded links etc are shown and preserved in the Wysiwyg editor, but are not editable.
To give it a spin, from a Pier image execute:
Gofer it
renggli: 'pier2addons';
package: 'Pier-Wysiwyg';
load.
Then browse to /wysiwygtest and you should see a test editor, which allows switching between wysiwyg and wiki editors with changes in either editor being reflected in both editors.
The html parser walks the browser's DOM, and translates into Pier wiki format. There's a set of tests for the parser, which can be loaded with:
Gofer it
renggli: 'pier2addons';
package: 'ConfigurationOfPierWysiwygEditor';
load.
(ConfigurationOfPierWysiwygEditor project version: #bleedingEdge) load: #('Core' 'Tests').
Then browse to /testwysiwgParser The tests are written in the Jasmine Javascript test framework [1], so run in the browser.
I'm still trying to work out the best method to integrate into Pier. If you want to try the editor within Pier modify:
PRDocumentDescription class>>defaultComponentClasses
^ Array with: PRWysiwygEditorComponent
I've yet to find a method to integrate with Pier without modifying at least one Pier method. Any thoughts? Changing the above method also results in the editor being visible blog comments, which in it's current state probably isn't desirable.
Next steps:
- add support for preserving table markup
- add a preview tab
- support enabling/disabling depending upon user permission.
Thanks
Nick