amyjko / bookish

A simple framework for publishing online books.
MIT License
69 stars 14 forks source link

Unclear how to create multi-line code snippets #343

Closed rbohrer closed 1 year ago

rbohrer commented 1 year ago

I have tried the following:

amyjko commented 1 year ago

There is multiline code block support, but it's actually a different type of content than inline code in a paragraph. You can find it next to the callout, quote, image, and table icons in the toolbar, with the <> icon.

image

This is a design and usability problem though: there's no interactive reason to distinguish between inline and block code. The reason it's currently this way is primarily because they have different formatting behavior: inline has no line breaks and is embedded in formatted text, whereas a multiline code block is a border and a caption. So it's primarily a typographic distinction.

A few ideas to improve the conceptual clarity of this:

Other ideas, or preferences between the two above?

rbohrer commented 1 year ago

I like your first recommendation best. Although it could be jarring, it will make sure users know which options are available to them, and I think that outweighs the jarring aspect.

Excited to hear that multiline support is actually there :D time to go clean up some code snippets