mystmd
mystmd copied to clipboard
Documented method to enable/disable in-page computation for single page doesn't seem to work
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
Interesting. Do you have a minimal example that you can share?
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)
jupyter is a field only for the project frontmatter (see ref https://mystmd.org/guide/frontmatter)
I can't remember whether we can disable Binder for a single page.
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 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.
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 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!")
```
@zmoon The kernelspec part seems to be the problem. Did some testing:
- no
kernelspec(and thus no build time execution):jupyter: falseworks - with
kernelspecbut no build time execution:jupyter: falseseems to be ignored - with
kernelspecand build time execution:jupyter: falseseems 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.