Skip to content

Commit

Permalink
fix: improve bookmarklet functionality for GitHub notebook URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleshot committed Jan 11, 2025
1 parent 3214e5f commit 10690ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guides/publishing/playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ navigate to `https://marimo.app/path/to/notebook.py`. For example:
For a convenient way to create notebooks from GitHub, drag and drop the
following button to your bookmarks bar:

<a href="javascript:(function(){let url=window.location.href.replace(/^https:\/\//,'');window.open('https://marimo.app/' + url, '_blank');})();"
<a href="javascript:(function(e){if(!location.hostname.includes('github.com')||!location.href.endsWith('.py')){alert('Please use this bookmarklet on a GitHub marimo notebook URL (.py file)');e.preventDefault();return;}const newUrl=location.href.replace('github.com', 'marimo.app/github.com');window.open(newUrl,'_blank');})(event);"
style="padding: 5px 10px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px; font-weight: bold;">
Open in marimo
</a>
Expand Down

0 comments on commit 10690ea

Please sign in to comment.