As mentioned in my last post, I want sync. I looked at Trunk Notes export format, and it looks nice. It uses clean UTF-8 encoding, and a simple syntax. The basic syntax is:
Header: Data
Header: Date
Wiki text ...
So the headers look just like HTTP headers, separated by colon and terminated by new lines.
However, I am not entriely sure how the engine know where the real content starts, i.e., what happens if I start a page with:
Today: Big goals ahead
Tomorrow: The world :-)
Next I looked into ways of creating an online wiki with Markdown syntax. Finally I stumbled over this sentence on the markdown page: "The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible." That is certainly a nice design goal and markdown syntax reads really nice in a text editor, but I don't want to have to type this on my iPhone.
So, what would be a good wiki syntax for the iPhone? Having researched many wiki syntaxes and written many converters, I have settled for STIF. STIF is a subset of HTML that contains only the essential elements. No wiki syntax needs to support more, but most wiki syntax should at least support STIF. That is my opinion after having looked into many wiki syntax.
Ok, so here are the next two steps that should be taken for an iPhone wiki syntax:
- Analyse the iPhone text entry capabilities
- Map them to STIF
- Reachable with 1 click: A-Z (at the begin of a sentence), a-z within a word. Equally easy: " " (space).
- With 2 clicks: 0-9, "-", "/", ":", ";", "(", ")", "€", "&", "@" '"', ".", ",", "?", "!", "'"
- With 3 clicks: "[]{}#%^*+=_\|~<>$",(pound sign), (yen sign), (bullet), ".,?!'"
The fastest way would be to create a wiki syntax from letters only, e.g., write
XXX my headline
here we list fruits
o Apple
o Banana
to mean
my headline
here we list fruits
- Apple
- Banana
However, we see already that using "XXX" (or "Xxx", or "xxx") might (a) conflict with other syntax and (b) already requires to tap three times. Obviously we need to find out what the most frequently used formatting instructions are. For me, they are in order of appearance:
- Bulleted lists (also nested ones)
- WikiLinks -- are perfectly handled by the iPhone keyboard
- http:// links (usually created by copy and paste)
- Strong (to find stuff easier in long wiki pages)
- Headlines (one or two types suffice for me)
First ideas are (alwys starting at the begin of a line):
ReplyDelete'qqtitle' {space} {title} => title of web page - it's always nice to have meta-date embedded in the text syntax.
'qq' {text} ==> <h4>text</h4>
'qqq' {text} ==> <h3>text</h3>
'o' {text] => item in an unordered list
The 'o' can also be 'O' or '-' or '*'.
Inline formatting:
{url} 'qq'{text}'pp' => <a href={url}>text<a>
I think using 'qq' and 'pp' as delimiters is clever. They can be used with two key taps and one stays on the alphabetic view, so text entry is faster for more text. Furthermore, 'qq' and 'pp' almost like like matching paranthesis, if you have some fantasy ;-)
The url detection regex should automatically add an 'http://' if no schema is present.
Detection of all patterns should be case-insensitive.