Skip to content

Fix documentation and argument-parsing for thumbnails export#8301

Open
snooze92 wants to merge 2 commits intomarimo-team:mainfrom
snooze92:thumbnail_fixes
Open

Fix documentation and argument-parsing for thumbnails export#8301
snooze92 wants to merge 2 commits intomarimo-team:mainfrom
snooze92:thumbnail_fixes

Conversation

@snooze92
Copy link

📝 Summary

As discussed on Discord, I started by simply replacing marimo tools thumbnails generate with marimo export thumbnail in the relevant documentation pages (OpenGraph previews or Thumbnails).

Unfortunately, I found a more sneaky issue when trying to verify the passing of notebook arguments:

marimo export thumbnail notebook.py -- --foo 123

🔍 Description of Changes

The Markdown updates are very straightforward.

The support of notebook arguments took a while to get my head around! I have left a bunch of parameterised tests to show the complex way different binary choices we have to make interact with each other...

In short, we can allow interspersed arguments or not(+i / -i below), we can split paths out of the arguments or not (+s / -s below), but we can't support all 3 features:

Feature +i +s +i -s -i +s -i -s
Export options after path
Multiple paths
Notebook arguments

My initial commit uses _SPLIT_PATH_AND_ARGS and _ALLOW_INTERSPERSED_ARGS boolean flags to highlight where this is configured; as well as some illustrating tests.

I would recommend that we simplify by leaving interspersed arguments enabled, but removing the logic to split path and args. We would lose the ability to have multiple paths, but get the simplest solution possible, also the most consistent with other export commands.

📋 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.

@snooze92 snooze92 requested a review from akshayka as a code owner February 13, 2026 15:14
@vercel
Copy link

vercel bot commented Feb 13, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 17, 2026 11:27am

Request Review

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 13, 2026
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@snooze92
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

There was a refactor where `marimo tools thumbnails generate` was
replaced with `marimo export thumbnail`. The documentation still
showed outdated example commands.

I also found a missing ``` which broke a lot of the page. Fixed
that as well.
@mscolnick
Copy link
Contributor

docs look great, thank you! i'll let @peter-gy chime in here regarding the split CLI arguments

@peter-gy peter-gy self-requested a review February 14, 2026 06:47
Copy link
Contributor

@peter-gy peter-gy left a comment

Choose a reason for hiding this comment

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

Thank you for this & apologies for the late review!

I'm aligned with the direction you already suggested to settle on a single positional target (notebook or folder) for export thumbnail, and keep notebook args forwarding.

Before merge, I’d just tighten the implementation around the final test contract so that CI becomes green.

_assert_success(p)


class TestSplitPathArgs:
Copy link
Contributor

Choose a reason for hiding this comment

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

It's really useful to see how the different combinations behave. Could we convert this exploratory matrix into a smaller suite to test for the single positional target support?

Copy link
Author

Choose a reason for hiding this comment

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

I'll take a shot at that!

Copy link
Author

Choose a reason for hiding this comment

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

I have left some tests, although it tests Click more than Marimo. I'm not convinced that it would be worth mocking a lot out to be testing the actual Click decorators used in Marimo without "duplicating" in a test.

Specifically for the thumbnails, special logic was used to support
multiple paths as arguments. Unfortunately, that logic broke when using
notebook arguments. Since `--` is not passed through by click when
interspersed args are allowed, and every argument is wrongly extracted
as a path.

Removing the logic to split paths out of the arguments drops the
support for multiple paths at once, restores the support to forward
notebook arguments, while retaining the ability to put export options
before or after the path. It makes things most consistent with other
export commands.

I added two tests that do run the command and assert that it completes
successfully, only when the required dependencies are present and
without verifying the output.

I am also leaving some simple tests that test Click more than they test
actual Marimo code, but might be useful as illustration/sandbox anyways.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants