Skip to content

Commit

Permalink
📌 Fix location to executable .md files in Thebe (#505)
Browse files Browse the repository at this point in the history
* fix: match any file extension

* chore: add changeset
  • Loading branch information
agoose77 authored Dec 10, 2024
1 parent 722b84d commit ceb8196
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-students-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@myst-theme/jupyter': patch
---

Fix path of non-ipynb files in thebe
3 changes: 2 additions & 1 deletion packages/jupyter/src/execute/leaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ export function SessionStarter({
// in order to allow for multiple independent sessions of the same notebook
let path = `/${pageSlug}-${notebookSlug}.ipynb`;
console.debug('session starter path:', path);
const match = location?.match(/(.*)\/.*.ipynb$/) ?? null;
const match = location?.match(/(.*)\/.*/) ?? null;
if (match) {
console.debug('session starter match:', match);
// Choose an arbitrary suffix, not important
path = `${match[1]}/${pageSlug}-${notebookSlug}.ipynb`;
console.debug('session starter path (modified):', path);
}
Expand Down

0 comments on commit ceb8196

Please sign in to comment.