marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Automatic `View as markdown` not working as expected

Open meditans opened this issue 9 months ago • 6 comments

Description

Hi, I usually edit marimo files as .md files from emacs (they are automatically exported from an org-mode file). When there's a bit of markdown in the .md file, and I load the file for the first time, each cell will show as code (containing a mo.md call). I can then click on the View as markdown button to change it in a markdown cell, and then I can click on the hide the source to get what I really want, i.e. the rendered markdown.

Now, I get that at the beginning, all cells, including markdown ones, are code, because I might want to interpolate values in the md cell, but the notebook is set up as run on startup (and on save). It would be nice if I could cut on the number of clicks I have to do to get to the rendered markdown (for now, 2 clicks per cell).

Suggested solution

I would suggest a configuration option that says: If the cell has been evaluated (and is now markdown), just hide the source automatically. What do you guys think?

Alternative

No response

Additional context

No response

meditans avatar Feb 21 '25 17:02 meditans

What version are you running? Because I think with the newest codeblock form this is the default?

But yup! markdown should be clean on render

dmadisetti avatar Feb 21 '25 18:02 dmadisetti

>>> marimo.__version__
'0.11.7'

which should be the latest according to pypi!

meditans avatar Feb 21 '25 19:02 meditans

As a workaround for now, — there is a hide all markdown code action in the command palette (Cmd/Ctrl+k).

akshayka avatar Feb 21 '25 21:02 akshayka

Can you send me a screenshot of opening marimo/_tutorials/markdown_format.md?

/ share what your org-mode export looks like? Cannot seem to replicate

dmadisetti avatar Feb 22 '25 17:02 dmadisetti

@meditans is this still happening to you?

mscolnick avatar Apr 23 '25 21:04 mscolnick

No, the original issue doesn't happen anymore @mscolnick, thank you. I can do hide all markdown code, but I would welcome if this happened automatically, as I have to do it again every time I create a new cell.

meditans avatar Apr 30 '25 11:04 meditans

@meditans we now do auto-hide markdown when created (after interacting with it once)

mscolnick avatar Jul 24 '25 14:07 mscolnick

I'm a bit confused about this feature. This is what I see on first load when I run in edit mode. It is not rendering markdown.

Image

The following is what I WANT to see -- but I can only see it by pressing "play" on each markdown cell. Is this because my notebook is set to lazy evaluation?

Image
  • I do NOT want automatic evaluation (this would trigger all kinds of side effects I don't want)
  • i DO want markdown interspersed with code, by default.

sandover avatar Aug 11 '25 20:08 sandover

@sandover yes, this is because markdown is not run during lazy-evaluation. there is this ticket which you might be interested in following: https://github.com/marimo-team/marimo/issues/5942

mscolnick avatar Aug 11 '25 22:08 mscolnick