thank you!
today I tried seeing if I could publish a Bike outline as a note on by website, and it turns out the answer is yes. I ran a post-processing step on the HTML to insert a few extra HTML tags into the header (such as a stylesheet and a meta tag for a nicer appearance on mobile devices), and after that the markup gave me all the hooks I needed to style the node types differently (eg. li[data-type=note] { ... }
). I also ran a regex replacement over my outline, replacing [[[img: foo.png]]]
with <img src='foo.png' />
. Everything worked really well!
Though now I think of it, there was one difficulty I ran into, which is figuring out how to style numbered lists with numbers. I think there’s a way to do it with CSS counters, but I never figured it out. The trouble is that the list element is a <ul>
rather than an <ol>
. I can see the argument for keeping the node type uniform so it seems acceptable to work around this with CSS, long as that’s possible.
Another thing I noticed in the process is that Bike can emit invalid HTML in the form of self-closing tags that the HTML spec does not allow to be self-closing, such as <p/>
instead of <p></p>
. Browsers probably do the right thing with this, but I think It’s an annoying feature of the HTML spec that only a limited set of tags can be self-closing. For example, as a consequence, web components need to always be written as <my-component></my-component>
rather than <my-component />
even when they have no content…
And another thing I noticed is that pasting code into a code block will create indented nodes rather than prefixing the lines with spaces. This made lining things up difficult when rendering in a browser. In particular, I was actually trying to render a diagram:
which I eventually got working by adding the spaces back myself. but it would have been really nice if the default paste mode for code would paste code into a code block as code (leading spaces/tabs and all) rather than as nested list items.