Get help from the marimo community

Updated last week

cell bookmarks

At a glance

The post asks if the Marimo platform has "jump to cell" bookmarks or a table of contents widget. The community members discuss the existing table of contents functionality, which can be created using Markdown headers. They also suggest having the table of contents open by default in "app mode" and an auto-generated table of contents using mo.toc(), which they think would be a great addition to the platform.

Does marimo have "jump to cell" bookmarks? (that can be used from markdown or mo.md(f'''Jump to {target}... ) Or a table of contents widget?
M
m
l
13 comments
we show the table of contents on the right-hand side of the notebook. you can create entries with markdown:
Plain Text
# header
## subheader
### third header
oh, that's what those lines are for!
that's subtle. I can see how it's often desirable, but is there way in app mode to default to open the ToC, and have a collapse control instead?
An open Outline on left side would by default would work better for app mode (for our audience).
you can't currently. you can have the open outline in edit mode, but not app mode.
you could also try mo.sidebar
Plain Text
mo.sidebar(
    [
        mo.md("# logo"),
        mo.nav_menu(
            {
                "#home": f"{mo.icon('lucide:home')} Home",
                "#about": f"{mo.icon('lucide:user')} About",
                "#contact": f"{mo.icon('lucide:phone')} Contact",
            },
            orientation="vertical",
        ),
    ]
)
but those #anchors would need to match up with your document. it wouldnt be auto-generated
we could add mo.toc() which would be the auto-generated.
(if you are open to making the contribution, i think it would be a great addition)
mo.toc would be very nice! I can look into this too, @Myles Scolnick could you give me a pointer into how to parse cells that have markdown content?
we have the outline in App Mode now floating on the right-hand side, so not sure if mo.toc is that valuable. what is your use-case? would it look weird with two table of contents?
my use case is for export, like when creating a PDF or HTML export (though HTML might work fine with the floating one) or also to make it more explicit than the side one for app users not familiar with marimo
got it. that does make sense. it should be fairly easy to impelment and can just re-use the FloatingOutline component to render it
let me know if you need pointers getting set up or adding a new StatelessPlugin
Add a reply
Sign up and join the conversation on Discord