Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try-nbsphnix #881

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

try-nbsphnix #881

wants to merge 7 commits into from

Conversation

eroell
Copy link
Collaborator

@eroell eroell commented Mar 13, 2025

test rtd build for nbsphinx link

@github-actions github-actions bot added the chore label Mar 13, 2025
@eroell eroell requested a review from flying-sheep March 13, 2025 14:36
docs/conf.py Outdated
@@ -8,6 +8,7 @@

HERE = Path(__file__).parent
sys.path[:0] = [str(HERE.parent), str(HERE / "extensions")]
sys.path.append(str(HERE / "tutorials" / "notebooks"))

Choose a reason for hiding this comment

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

what’s this for? sys.path is for importing python packages, why would you want to do that from the notebook folder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A leftover thing I wanted to delete again!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will remove

@flying-sheep
Copy link

OK, so you’re using nbsphinx’ thumbnail gallery which doesn’t exist for myst-nb, otherwise I’d have recommended replacing it for simplicity.

@flying-sheep
Copy link

OK, got it, the issue is the cell_type. If "cell_type": "markdown", nbsphinx won’t interpret rST syntax as rST. You need "cell_type": "raw".

@eroell
Copy link
Collaborator Author

eroell commented Mar 14, 2025

Awesome, this works!
Thanks soo much @flying-sheep!

To summarize what @flying-sheep did here:
a) set the notebook cell type to raw
b) set the cell metadata "raw_mimetype" to "text/restructuredtext"

Should look like this:

   "cell_type": "raw",
   "metadata": {
     "raw_mimetype": "text/restructuredtext"
   },

@flying-sheep
Copy link

flying-sheep commented Mar 14, 2025

Yeah! nbsphinx has docs for this, but they assume you can just do that from UI and don’t have to manually hack around in JSON: https://nbsphinx.readthedocs.io/en/0.2.7/raw-cells.html

I filed microsoft/vscode-jupyter#16490 for the ability to do it in VS Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants