jupyter-book / jupyter-book

Create beautiful, publication-quality books and documents from computational content.

Home Page:http://jupyterbook.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notebook %psource magic command not displaying

ivanistheone opened this issue · comments

Describe the bug

context
I'm using the %psource magic command to display the source code of a helper function, but the output doesn't show up in the .html build of this notebook.

expectation
I expected the source to be printed below just like in JupyuterLab:
Screen Shot 2024-01-20 at 10 30 00 AM

bug
But instead nothign appears below the cell:

Screen Shot 2024-01-20 at 10 30 23 AM

see online version here: https://nobsstats.com/examples/one_sample_t-test.html#p-value-calculation

problem
This is a problem for people trying to use magic commands as part of educational notebooks.
I'm a big fan of %pdef and %psource and I want students to learn to use these powerful tools.

Reproduce the bug

  1. Create notebook that uses %psource command
  2. Use jupyter-book build . to build html
  3. Inspect the notebook html built version

List your environment

I'm on mac running Python 3.9.4

jupyter-book --version
Jupyter Book      : 0.13.2
External ToC      : 0.3.1
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.2
Sphinx Book Theme : 0.3.3
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.13

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉