Haddock Plain Editor #

The Haddock Template has an enhanced plain editor to make entering markup more easy. Many of the enhancements were inspired by posteditor[1], TextMate[2], MarkItUp[3] and smarkup[4].


TAB key support
Use the TAB key to increase indentation of a line: the tab key is expanded to 4 spaces.
When selecting multiple lines, the TAB key increases the indentation of all selected lines.
Use Shift+TAB to decrease the indentation level.
Use the DEL key to remove the next 4 spaces.
Insert line-breaks
Use shift+Enter to insert line-breaks . (\\)
When entering a new line, it will automatically get the same indentation as the previous line.
Section editing
Section editing allows to either edit the whole document, or a particular section. A section starts with a heading. (!,!!,!!!)
When viewing a page you can hover the mouse over a section heading to reveal the Edit button. Click it to directly open the editor for that section.
Find & Replace
The find & replace UI is a floating dialog which operates either on the whole document, on a section of the page or on the selected text. While entering the find string, you see immediately the number of matched strings. You can also use regular expressions for more complex find and replace patterns. And you can choose to replace either the first occurance or all the matched strings.

Advanced features#

The advanced features can be turned on/off via the configuration menu. These settings are saved in a cookie.
Suggestion dialogs are small context sensitive popup dialogs which appear when you type or move the cursor or make a text selection. These dialogs assist in the entry of wiki markup.
Suggestion dialogs are available when entering [links] (with on-the-fly ajax-based lookup of existing pages and attachements)), %%styles, hexadecimal colors, fonts, special symbols (aka html entities), icons, plugins, images, and more.
Your wiki administrator can add other suggestion dialogs, by extending the snippet file Wiki.Snips.js.
TAB Completion
Predefined keywords followed by the TAB key will expand to a text-snippet.
E.g. toc followed by TAB will expand to [{TableOfContents }].
Check out the snippets tab for a list of available keywords and the expanded text.
Smart Typing Pairs
With smart typing pairs, certain characters ( ", ', (, {, [, [{ ) will automatically be balanced with their closing counterparts. When you first select a word or set of words, the pair characters will be inserted around the selection.
Live Preview
Live Preview will render on the fly the wiki markup so you can preview the page while you are editing. The preview is rendered on the server via a AJAX call.
You can display the live-preview either side-by-side, or stacked vertically below the editor textarea.


Overview of supported snippets and the expanded wiki markup. You can add your own snippets, by extending the snippet file Wiki.Snips.js.

Keyword +TAB expands to...
toc [{TableOfContents }]
link [link text|pagename]
code %%prettify {{{ ... }}} /%
pre {{{ ... }}}
br, shift+Enter \\
bold __some bold text__
italic ''some italic text''
h1 !!! Heading 1 title
h2 !! Heading 2 title
h3 ! Heading 3 title
dl ;term:definition text
mono {{ some monospaced text }}
hr ----
sub %%sub subscript text /%
sup %%sup superscript text /%
strike %%strike strikethrough text /%
tab example snippet with tabs
table example table
img [{Image src='img.jpg' ..and other plugin parameters.. }]
quote %%quote ... /%
%% %%wikistyle ... /%
sign \\
<~UserName>, 25 Sep 07
date today's timestamp
lorem Lorem Ipsum ...