Skip to content

feat: support markdown in file tree notebook creation#8770

Merged
mscolnick merged 3 commits intomarimo-team:mainfrom
daizutabi:fix-create-markdown-notebook
Mar 23, 2026
Merged

feat: support markdown in file tree notebook creation#8770
mscolnick merged 3 commits intomarimo-team:mainfrom
daizutabi:fix-create-markdown-notebook

Conversation

@daizutabi
Copy link
Copy Markdown
Contributor

📝 Summary

This is a follow-up PR to #8412 ("Add Create notebook in file tree").

While #8412 introduced the ability to create new marimo notebooks directly from the file explorer, it defaults to Python boilerplate even when the user specifies a .md or .qmd extension.

This PR enhances the "Create notebook" functionality to:

  • Detect the file extension during creation.
  • Automatically generate the appropriate boilerplate using MarimoConvert if the extension is .md or .qmd.

🔍 Description of Changes

  • Modified marimo/_server/files/os_file_system.py: Update create_file_or_directory to handle Markdown-based notebook initialization.
  • Updated tests/_server/files/test_os_file_system.py: Added test cases to verify the generated boilerplate content for .py, .md, and .qmd files.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 21, 2026 6:23am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances server-side “Create notebook” behavior in the file explorer so that new notebooks created with .md / .qmd extensions are initialized with Markdown/Quarto boilerplate instead of Python boilerplate, aligning backend creation with supported notebook formats.

Changes:

  • Updated notebook creation to generate .md/.qmd boilerplate via MarimoConvert (from IR) and keep .py generation via Python conversion.
  • Added parametrized tests to validate the created boilerplate differs across .py, .md, and .qmd.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
marimo/_server/files/os_file_system.py Detects extension on notebook creation and uses MarimoConvert to emit Markdown/Quarto vs Python boilerplate.
tests/_server/files/test_os_file_system.py Adds parametrized coverage to confirm correct boilerplate markers for .py, .md, .qmd notebook creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

daizutabi and others added 3 commits March 21, 2026 06:21
Enhance the "Create notebook" functionality in the file explorer to support .md and .qmd extensions by generating appropriate marimo boilerplates using MarimoConvert.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@daizutabi daizutabi force-pushed the fix-create-markdown-notebook branch from bf81889 to 3af27c2 Compare March 21, 2026 06:22
@mscolnick mscolnick added the enhancement New feature or request label Mar 23, 2026
@mscolnick mscolnick merged commit 90fc851 into marimo-team:main Mar 23, 2026
39 of 41 checks passed
@daizutabi daizutabi deleted the fix-create-markdown-notebook branch March 23, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants