marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Admonitions?

Open dmadisetti opened this issue 1 year ago • 3 comments

Description

I noticed you all do this in the docs quite a bit, and I'm a fan of them too.

I think github native supports them:

[!NOTE]
Highlights information that users should take into account, even when skimming.

[!TIP] Optional information to help a user be more successful.

[!IMPORTANT]
Crucial information necessary for users to succeed.

[!WARNING]
Critical content demanding immediate user attention due to potential risks.

[!CAUTION] Negative potential consequences of an action.

mkdocs has the following notation:

!!! note
    Hello

which is what the markdown extension triggers on: https://github.com/Python-Markdown/markdown/blob/ec8c305fb14eb081bb874c917d8b91d3c5122334/markdown/extensions/admonition.py#L53

but also has ??? for collapsable.

Looks like the implementation in the docs.marimo.io actually comes from rst support?

Suggested solution

Something to consider; callouts by themselves are a little loud

callout(title="", body="", kind="", foladable=False) could make a admonition

Alternative

callouts are cool- and they're left as is

Additional context

Was just converting a notebook and thought about it again. I sort of put the beginnings of md interop in exporter/utils, but forgot to strip to out

dmadisetti avatar May 08 '24 17:05 dmadisetti

Yea I've thought about this too.

  1. We can improve callout styling.
  2. I support extending callout in a backward compat way, adding title as an optional parameter. Do we need foldable or can we leave that out for now?

akshayka avatar May 08 '24 22:05 akshayka

We can have 2 callout stylings if we want - for example Chakra has 4: subtle, solid, left-accent or top-accent..

We can at least have 2: subtle and left-accent maybe

image

mscolnick avatar May 08 '24 22:05 mscolnick

I'm a fan of folding- but get if it's a won't fix. Might be possible to replicate the fold as a user with <details>.

dmadisetti avatar May 09 '24 02:05 dmadisetti