I’m looking for a few different kinds of feedback here:
- Bugs?
- Format Options
- File formats for rich text
- Anything else you think is relevant
Format Options
I want format options to be useful and strait forward in this release.
For example “Bold”, “Italic” seem right. On the other hand adding a “Highlight” formatting option doesn’t seem right. (Maybe in future, but not for this release). My logic for saying “Highlight” wasn’t right is because I saw no direct mapping to HTML, but now I see that HTML has a <mark>
element that seems pretty direct mapping for highlight. So maybe that would be good… anyway I don’t want to add a “ton” of formatting options at start, but I would like to add once that would be useful to you now in Bike.
With that in mind what additional formatting options would you like to see?
Note: I’m not talking about styling options. Longer term I’ll add stylesheets to bike so that you can customize what exactly “Bold” and “Italic” look like when displayed. Right now I’m just looking for model level formatting options.
And really Bold maps to “strong” and “Italic” maps to “em” in the file format. I just figured best to use normal terms for the menu items.
Format Options (Links)
Links are a special case formatting option. I think rich text links (where link is hidden behind text) is a really important feature for Bike, but I don’t think they should be added to this release. There are a lot of UI options to consider for links and I think better to have a “Links” only release where that’s the focus.
File formats for rich text (.bike)
How is rich text get encoded into .bike?
First I use the libxml2 parser in XML mode (with recover option enabled) to read and write Bike files. Generally Bike files follow XML (not HTML) conventions.
In particular whitespace is significant. And in Bike’s case it preserves whitespace in leaf elements. For example to encode " Hello world " in Bike (note double spaces) I encode directly as:
<p> hello world </p>
To encode: “hello world” Bike 1.4 uses:
<p>
<strong>hello</strong>
<span> </span>
<em>hello</em>
</p>
Whitespace is preserved in leaf elements and discarded everywhere else. Generally I think this works pretty well, makes it pretty simple to read/write Bike files, and follows XML format conventions.
Web Browser viewing
A nice feature of Bike’s file format is that it’s “mostly” a subset of HTML.
The nice to have goal is that you can open a .bike file in your browser and you see all information. Unfortunately I don’t know how to make this above XML encoding approach also show exact whitespace in a web browser without javascript pre-processing.
For example in the above example the web browser will insert a space between each spanning element… and will collapse any extra spaces. I haven’t been able to find a set of css styles to fully correct for this.
I think I can correct for everything with some Javascript preprosessing that for each <p>
:
- Delete all whitespace text nodes that are not part of a leaf element. (Basically remove the pretty-print formatting)
- Add style
p { white-space: pre-wrap; }
But that seems messy. Thoughts or better ideas welcome!
File formats for rich text (.opml, .txt)
Right now if you save to these formats rich text attributes are lost. Hope to fix this before final 1.4 release, but focus right now is getting .bike working properly.