I need some guidance on edge cases before I can get the script to indent
beyond one level.
1. If the first cell has no markdown header level, it should only be
indented one level, right? There's nowhere else for it to go.
2. If the first cell has a markdown header level > 1, the indentation
should just be one, right? Again, a cell can't be indented more than one
level from the previous one.
3. If a later cell has no markdown header level, at what level should it be
indented? Choices are, as best I can see:
a. The same level as the previous cell;
b. One indent level from the root.
4. Code cells should be indented at the same level as the previous cell,
except that the minimum indent level for any cell is 1. Yes?
5. What should the script do if the markdown header level is not consistent
with the indent level? Example:
# %% [markdown]
# ### A level-three cell
# %% [markdown]
# ##### Seems to be a level-5 cell but the next cell after the level-3
can only be indented to level-4 at most.
6. Any other edge cases that you know about.
On Monday, October 28, 2024 at 3:43:23 AM UTC-4 [email protected] wrote:
> Thanks Thomas, It works great!
>
> Although for `jupyter lab`, its ToC is displayed according to the markdown
> level in the document, I think it is not a big problem to extract nodes
> according to cells like you did, anyway, nodes are easy to operate in Leo.
>
> Thanks for your script!
>
> [image: SCR-20241028-nwcw.png]
>
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/leo-editor/f8d911b1-3af7-4d11-adb9-8904d4aea9d5n%40googlegroups.com.