Skip to content

Create new notebook based on user-defined templates #7744

@LioSergent

Description

@LioSergent

Description

As a convenience feature, it would be nice to be able to define notebook templates and create new notebooks based on those user-defined templates.

Suggested solution

Templates could be store as .py files in a folder referenced in the marimo.toml. Like snippets are defined.

If templates are detected, add a button "Create new notebook from templates" after :

Image

Are you willing to submit a PR?

  • Yes

Alternatives

Another way would be to use 2 or 3 snippets. Main issue for me here is that I could not make a snippet work for the setup cell (and I like having a setup cell because it makes the raw .py file a lot more readable to me).

Additional context

Personally I currently do this with a little click CLI and it is quite practical as I perform a lot of analyses that often start the same way (same db/csv connections, the same code imports, same first steps of data exploration...).
But it requires extra clicks/keypresses (go to terminal, write command, go back to marimo, refresh the file explorer in marimo, click the new file). And it would feel better to stay in the marimo UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions