PR #4138 (@jupytext improvements) is ready for review. All tests pass and the generated code looks reasonable to me.
This PR causes Leo to split @jupytext nodes into a flat list of child nodes. This splitting happens only the first time Leo reads such a node. You can inhibit this action by adding any child node (including an empty node) to the @jupytext tree.
The algorithm follows Thomas's prototype script closely, but not exactly. This PR does not attempt to determine the indentation level of markdown nodes. Any such enhancements must wait until Leo 6.8.3 or later. It's time to test what we have.
Edward
I do have two suggestions, though, both trivial to implement.1. Only use the first 6 words of the first line for the headline, the way my script did.
2. Put an @nocolor directive at the top of each markdown cell.
PR #4138 (@jupytext improvements) is ready for review. All tests pass and the generated code looks reasonable to me.
2. Put an @nocolor directive at the top of each markdown cell.I'm not going to do this because @nocolor suppresses all coloring.
I do have two suggestions, though, both trivial to implement.1. Only use the first 6 words of the first line for the headline, the way my script did.The new jtm.compute_headline method does a much better job of computing headlines. You'll like it.
I don't love seeing the leading "#"s in the headline, though. E.g., ## 1. Specifying element type.
Then add @color to code cells. They are the ones that should be colorized.
I don't love seeing the leading "#"s in the headline, though. E.g., ## 1. Specifying element type.The starting point of my suggestion is that since all our nodes are at the same level, we can only know which level it is through the `#` in the markdown heading, which is convenient for quickly finding the location when switching between jupyter lab and Leo. In addition, this mark can also be distinguished from ordinary cells.