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

Links to documentation in CohortTracker Tutorial with nbsphinx #881

Merged
merged 10 commits into from
Mar 17, 2025

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

@eroell eroell added documentation Improvements or additions to documentation and removed chore labels Mar 17, 2025
@eroell eroell changed the title try-nbsphnix Links to documentation in CohortTracker Tutorial with nbsphinx Mar 17, 2025
@eroell eroell marked this pull request as ready for review March 17, 2025 16:10
@github-actions github-actions bot added the chore label Mar 17, 2025
@eroell eroell removed the chore label Mar 17, 2025
@eroell eroell merged commit 9d2d2d1 into main Mar 17, 2025
11 checks passed
@eroell eroell deleted the docs/try-nbsphinx branch March 17, 2025 16:37
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.

2 participants