Format() with style

Following the discovery of big buttons, I was tempted to see if something similar was possible with Format() — namely if one could supply a Big Cell formatted content as a template for the Format() function.

Answer: YES! although a bit limited.

What is preserved when the text is pasted into the {1} {2} etc templates:

  • Paragraph formatting: headers, lists, code blocks, text alignment etc

What is NOT preserved:

  • Span formatting: text color and highlight, bold/italic/etc. It gets overwritten with the formatting of the inserted value.
    So if you want to make inserted values e.g. bold, you’ll have to use hidden functions like _Bold() and _Color() to style the template arguments explicitly.

Demo:

Yes I have been experimenting with this. Another thing to note is that you don’t seem to be able to mix and match formatting style on a line, atleast when it comes to Headings - you can’t have an H3 - description text on the same line.

Yeah, you can’t — paragraph styling is stored separately from span (character-level) styling. There’s a way to inspect this by force-rendering cells into their inner object representations