You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--- as slide separation markers confuses Jupyter's cell detection #8998
When using inline python code, for some reason, only some of the expressions are evaluated. I can't see any logic to which expressions work and which don't.
Side note, what's the purpose of level three headings and the use of --- (compared to the below example)? (maybe it's for the sake of the reproducible example).
---title: "Habits"author: "John Doe"format: revealjsengine: jupyter---- Turn off alarm
- Get out of bed
-`{python} 1`---- Get in bed
- Count sheep
-`{python} 2`---
Last slide to recreate the issue
what's the purpose of level three headings
Also ### means <h3> in the HTML while ## will be <h2> so not the same styling by default.
Activity
cderv commentedon Mar 7, 2024
Thanks.
This is it seems an issue with how the intermediate ipynb is formatted due to the
---slide delimiterIntermediate ipynb
{ "cells": [ { "cell_type": "raw", "id": "430ab9f1", "metadata": {}, "source": [ "---\n", "title: Test\n", "subtitle: test\n", "format: revealjs\n", "slide-level: 0\n", "engine: jupyter\n", "keep-md: true\n", "keep-ipynb: true\n", "---" ] }, { "cell_type": "markdown", "id": "914d822a", "metadata": { "user_expressions": [ { "expression": "1", "result": { "data": { "text/plain": "1" }, "metadata": {}, "status": "ok" } } ] }, "source": [ "### test\n", "\n", "- `{python} 1`" ] }, { "cell_type": "raw", "id": "9581579d", "metadata": {}, "source": [ "---\n", "\n", "\n", "### test\n", "\n", "- `{python} 2`\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "3c1e6667", "metadata": { "user_expressions": [ { "expression": "3", "result": { "data": { "text/plain": "3" }, "metadata": {}, "status": "ok" } } ] }, "source": [ "### test\n", "\n", "- `{python} 3`" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3", "path": "C:\\Users\\chris\\PYENV~1\\PYENV-~2\\versions\\3.12.1\\share\\jupyter\\kernels\\python3" } }, "nbformat": 4, "nbformat_minor": 5 }especially the part with
`{python} 2`is formatted this way{ "cell_type": "raw", "id": "9581579d", "metadata": {}, "source": [ "---\n", "\n", "\n", "### test\n", "\n", "- `{python} 2`\n", "\n", "---" ] },So it is a
rawcell and not a markdown cell. Usually---are used to delimit YAML metadata block, who can be anywhere in the document. Likewould lead to raw cell too
{ "cell_type": "markdown", "metadata": {}, "source": [ "### test\n", "\n", "- `{python} 3`\n" ], "id": "85553944" }, { "cell_type": "raw", "metadata": {}, "source": [ "---\n", "title: override\n", "---" ], "id": "d87135ea" }So I think we need to account for slide delimitation also 🤔
mcanouil commentedon Mar 7, 2024
Side note, what's the purpose of level three headings and the use of
---(compared to the below example)? (maybe it's for the sake of the reproducible example).cderv commentedon Mar 7, 2024
It does not matter really here. Yes you could not use
---but the example shows the issue which is with---.here is another one adapted from our doc about using
---: https://quarto.org/docs/presentations/revealjs/#creating-slides that should make you happier 😉Also
###means<h3>in the HTML while##will be<h2>so not the same styling by default.cderv commentedon Mar 7, 2024
Anyhow, the issue is with our Markdown to Jupyter conversion which use regex
quarto-cli/src/core/jupyter/jupyter.ts
Line 305 in b222df5
and then our line processing
quarto-cli/src/core/jupyter/jupyter.ts
Lines 432 to 443 in b222df5
I don't think we account correctly for manual slide delimiter
---which can be used for slide formats[-]Inline code only partially executed[/-][+]`---` as slide separation markers confuses Jupyter's cell detection[/+]Fix YAML delimiter detection when creating intermediate notebook duri…
Add unit test for issue quarto-dev#10436: YAML delimiter detection