Description
HTML is much more than just ASCII and there are lots of characters that should be used (both for typographic correctness and ease of reading), but are hard to input from keyboard. HTML allows you to insert them as entities, like &emdash;, but MoinMoin won't allow it.
Method 1
This is used by some Wikis and Blogs, the idea is similar to that with smileys, only instead of inserting images, an HTML entity is inserted.
There's a filter that does this pretty well: http://daringfireball.net/projects/smartypants/
An exmaple:
expression |
gets transformed into |
" -- " |
– |
" --- " |
— |
" (C) " |
© |
" (R) " |
® |
" (TM) " |
™ |
" (= " |
€ |
" (- " |
£ |
"... " |
… |
" "\b" |
<q> |
"\b" " |
</q> |
" --> " |
→ |
" <-- " |
← |
" <-> " |
↔ |
" ==> " |
⇒ |
" <== " |
⇐ |
" <=> " |
⇔ |
" o-o " |
∞ |
" . " |
· |
" !\b" |
¡ |
" ?\b" |
¿ |
" >> " |
» |
" << " |
« |
" 1/4 " |
¼ |
" 1/2 " |
½ |
" 3/4 " |
¾ |
" >< " |
× |
"^o " |
°ree; |
This method is pretty convenient, but has some drawbacks. The combinations of characters are not normally used in normal text, but it might happend that they get used without the {{{ }}} or backticks, leading to strange behaviour. The quotation marks should be matched first, and then transformed into HTML markup. Also, there's additional markup to learn.
Method 2
Just list the symbols along the top or bottom of textarea, with JavaScript to insert them. The same could be done for smileys.
This is rather inconvenient (but you don't use those characters often) and requires JavaScript.
Discussion
Probably a tool box in the gui should be added to select grphical such a sign.
- I found a partial solution. Just modified the editor page to list the most common characters. Then they can be copy-pasted pretty easily.
As per method 2, I wrote patches up through 1.3 which did this fully (I'm working on a 1.5 patch). See Character inserter patch -- DeronMeranda 2006-01-12 18:16:14
It'd be nice if you could insert such characters into text using some mechanism provided by the MoinMoin itself.
- You can use numerical entities and the character itself.
- That must be very convenient indeed — how to use numerical entities anyways?
� the no. is the appropriate decimal number of the unicode character
Ok, the decimal notation, like — to insert a — works, the other method (entity name) doesn't — shound't it be mentioned somehwere in HelpOnEditing? Now all I've got to do is to learn a bunch of numbers by heart. And it looks really cute in source too... Maybe I'll write myself a plugin to render all the text like this.
Feel free to add it (see EditingOnMoinMaster) and note that the ellipsis is "…".
See, if the MoinMoin used the smiley-like substitution of Method 1, then it would allow to type as if you typed it in e-mail or an ASCII document, and display it correctly in HTML. This is true for the most common out-of-keyboard characters, like "—", "…", etc. There's little probability somebody would want to type two minus characters or three dots in normal text -- and if it's code, it should be quoted anyways.
Yes, it would be *very* useful. One would rather write --- but neither Q(mdash) nor — nor —, surely. --dor
- That must be very convenient indeed — how to use numerical entities anyways?
How about generating proper HTML markup for the quotations, so that "abc" would turn into <q>abc</q>? Is it possible with the default MoinMoin markup parser?
It would give too many false hits, I think. How about writing [[Q(abc)]]?
It's not pretty. How about ``abc`` or ""abc""? Or maybe some foreign quotes >>abc<< or ,,abc'' or ``abc''?
Something like this?
And also a second macro could be useful: