kalekundert / stepwise

Modular, command-line scientific protocols
GNU General Public License v3.0
3 stars 0 forks source link

More sophisticated formatting objects #35

Closed kalekundert closed 3 years ago

kalekundert commented 4 years ago

Right now, Step and Footnote are the only classes to help with formatting steps in python code. I think it might be useful to have broader set of such classes:

I like the idea of kinda using the names of the corresponding HTML tags. The one unfortunate thing is that I widely use p as the variable name for the protocol, but I'm sure I can figure something out with that.

I'll have to think a bit more about when to treat strings as verbatim.

kalekundert commented 4 years ago

I would probably keep something like Step, which is designed for the common case of having a single paragraph followed by an unordered list. But it would be composed of these primitives.

kalekundert commented 4 years ago

I'd want the list classes to have an option for whether the list items should be separated with blank lines or not.

kalekundert commented 4 years ago

It'd also be nice to have a wrap object that would basically look for list and paragraphs in a monolithic string, and wrap them properly. This might mean pulling in some sort of markdown parser.

kalekundert commented 4 years ago

The ol and ul objects should support an option to specify if list items should be separated by blank lines.