I have been working on updating Bike settings. I know I should use SwiftUI for this, I started doing that, I got stuck, and then my mind wandered…
I ended up at row types and containers, and that’s been a lot more fun!
It’s a bigger job, but I think more useful in the end. Also I’ve been able to get things up on the screen pretty quick, so that helps. There is still lots of work on details (probably most of the summer)… but screenshot was exciting enough to me that I decided to share:
The design is intended to map nicely into Bike and Markdown. First goal is nice for Bike, second goal is nice serialize to Markdown, third is nice reading from Markdown. I expect I can meet goals one and two quite well. Nicely reading all possible Markdown into an outline would be nice, but I’m not sure if that’s reachable without making everything really complicated.
The structures that I have are:
struct Row
type: RowType
containers: [RowContainer]
enum RowType
case paragraph
case heading(level)
case horizontalRuler
enum RowContainer
case taskList
case orderedList
case unorderedList
case blockquote
There are a number of decisions to be made when mapping row types into an outline:
-
Row handles stay the same, they don’t take on any UI from the row type or containers.
-
More generally outline structure and row types/containers are separate and don’t interact except when calculating ordered list numbers.
-
Row containers are an ordered list…
-
Row containers would be quite a bit simpler if we only had to support one, instead of a list. The list is to handle cases such as a single row with a number, a checkbox, and block quoted content. Any thoughts on how necessary handling that case is?
-
Each row container indents the text content by the outline indentation level… but each row container does NOT change the outline level. This means we can create a list item that contains other rows and the text indents match. You can see this in the “Structure” item above.
-
Headings also have a level that’s used for formatting, but also do not change the outline structure.
Another bit of summer schedule is that I’ll be mostly away for next two weeks from Saturday. Will try to keep up with email and forums, but likely will be a bit slow. Summer fun!