mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Documented method to enable/disable in-page computation for single page doesn't seem to work

Open zmoon opened this issue 1 month ago • 8 comments

I tried using a top-level jupyter key in the frontmatter, like described in https://mystmd.org/guide/in-page-execution#enable-or-disable-in-page-computation-on-a-single-page, but I get 'frontmatter' extra key ignored: jupyter

zmoon avatar Oct 17 '25 15:10 zmoon

Interesting. Do you have a minimal example that you can share?

rowanc1 avatar Oct 17 '25 15:10 rowanc1

This is with JB2 btw.

---
jupyter: true
---

Hi.
> jupyter book init
...
? Would you like to run jupyter book start now? Yes
⚠️  page.md 'frontmatter' extra key ignored: jupyter (at page.md)

zmoon avatar Oct 17 '25 19:10 zmoon

jupyter is a field only for the project frontmatter (see ref https://mystmd.org/guide/frontmatter)

Image

I can't remember whether we can disable Binder for a single page.

agoose77 avatar Oct 18 '25 19:10 agoose77

Well it seems you can't currently. But the docs section I linked suggests otherwise, complete with an example. Not sure if the docs need to be updated or the functionality is yet to be added, but that's why I opened the issue.

zmoon avatar Oct 18 '25 21:10 zmoon

@zmoon ah I wrote this as I was putting done my phone - these were notes for @rowanc1! Your confusion is entirely reasonable: our docs say one thing but our reference says another. We should sort that out.

agoose77 avatar Oct 19 '25 05:10 agoose77

I think the doc is correct. Enabling JupyterLite for in-page execution in project frontmatter and disabling in a page frontmatter works as expected (not tested with Binder aso.). The warning is missleading and shouldn't be there.

jeflem avatar Oct 20 '25 04:10 jeflem

@jeflem Are you doing anything different from the below? For me, with JB2, when I try to disable for a page everything is still enabled (Binder link and power button).

# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
  id: 7c1eb63e-2ea4-481f-a9d0-6a19fdb90008
  # title:
  # description:
  # keywords: []
  # authors: []
  # github:
  # To autogenerate a Table of Contents, run "jupyter book init --write-toc"
  jupyter:
    lite: true
site:
  template: book-theme
  # options:
  #   favicon: favicon.ico
  #   logo: site_logo.png
---
jupyter: false
kernelspec:
  name: python3
  display_name: Python 3
---

```{code-cell} python
print("Hello, world!")
```
Image

zmoon avatar Oct 20 '25 14:10 zmoon

@zmoon The kernelspec part seems to be the problem. Did some testing:

  • no kernelspec (and thus no build time execution): jupyter: false works
  • with kernelspec but no build time execution: jupyter: false seems to be ignored
  • with kernelspec and build time execution: jupyter: false seems to be ignored

Seems that at the moment it's not possible to have build time execution (myst build --execute) but no power button, because build time execution requires kernelspec.

jeflem avatar Oct 20 '25 15:10 jeflem