Add support for 4 plainb formats#48
Conversation
|
you need to update this https://github.com/notebook-link/specta/actions/runs/26754522649/job/78853130650#step:4:1211 |
|
Thanks @trungleduc CI is green now. |
|
does this mean |
Only for this feature to work, otherwise if jupyter-plainb isn't installed nothing happens and specta works as usual. |
|
hmm it does not sound practical since you need to know about |
|
and please verify if the stanalone specta app also works |
|
Hey @trungleduc I've made some changes to the plainb library by adding format detection in this PR and I used it in jupyter-plainb in this PR and now I also updated this PR to use it. The reason I made this change, is because in the standalone specta app, files open directly when clicking on them, so having the extension know what format a plaintext file is in, would allow it to use the correct parser. Screencast.from.2026-06-03.14-27-06.mp4 |
trungleduc
left a comment
There was a problem hiding this comment.
The specta metadata still works with the plainb file?
Yes, I've added different specta metadata configurations for the 5 plain demo examples. Here is a screencast of the examples being viewed in the Specta standalone app: Screencast.from.2026-06-05.15-25-59.mp4 |
| ? plainbFileType.name | ||
| : fileTypes[0]?.name; | ||
|
|
||
| if (PathExt.extname(path) === '.ipynb' || isPlainb) { |
There was a problem hiding this comment.
looks copy-pasted from previous block, could we refactor it?
There was a problem hiding this comment.
Thanks for the suggestion, I refactored duplicated code into helper functions getSpectaDocInfo and openDocument in tool.ts
This PR addresses issue #46 by adding support for the 4 formats supported by jupyter-plainb:
Supported formats
parsePy.pyparseSphinxGallery.pyparseClassicMd.mdparseMystMd.md{code-cell}directivesI also added a
plainbsubdirectory under demo/files which contains the examples from jupyter-plainb.This needs jupyter-plainb to be installed in the testing environment.
Similar to jupyter-plainb, Specta options are added to the "Open With" context menu.
Here is a screencast:
Screencast.from.2026-06-01.14-18-26.mp4
I'm not sure why the output cells in the specta view (dashboard mode I believe) are aligned to the left and I'm currently investigating it.
EDIT: This seems to be a general specta problem for which I opened issue #49