quarto convert: treat headers as sepate cells #11691
Replies: 3 comments
-
It looks like the way a lua extension sees the AST of the qmd file is similar what I have describe above. |
Beta Was this translation helpful? Give feedback.
-
We want I appreciate your articulation, but I think my conclusion here is that we won't implement this. |
Beta Was this translation helpful? Give feedback.
-
Hi, @anandology The Jupytext tool can enhance your workflow: This tool automatically converts the file you’re editing into the formats you need (e.g., If you add the following to your [tool.jupytext]
formats = "ipynb,md,qmd" it will generate When editing and saving WARNING!!! If you edit and save the A downside of this approach is the need to manage three identical files ( P.S. You can also set up automatic file conversion through the JupyterLab menu: navigate to File → Jupytext → Pair Notebook with . |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The ipynb files generated from qmd file doesn't have section headers as separate markdown cells, making it a bit difficult to work with the editing the notebook. Semantically, that doesn't sound right.
Let me explain with an example.
An Example
Consider a qmd file with the following text.
The Current Behavior
The generated ipynb file has a structure similar to what is shown below.
That is a Jupyter notebook with three cells. One markdown cell, one code cell and another markdown cell.
The Expected Behavior
I would prefer it be split like the following with each header getting its own markdown cell.
Discussion
As a teacher sharing jupyter notebooks with my students, I care about these details. I ended up hacking a small python script to convert qmd files to ipynb and I think it should be too hard to make changes to quarto qmd parser to handle this.
Also, I fell this is semantically the right way to split a markdown text into cells.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions