On Tuesday, October 29, 2024 at 6:39:20 AM UTC-4 Edward K. Ream wrote: The fruitful collaboration with Thomas continues. This Engineering Notebook post discusses adapting Thomas's prototype script to enhance how Leo handles @jupytext nodes.
Some nodes of the hierarchy may be missing, but that's not a problem. The importer will create organizer nodes for each missing level. This scheme "just works" because *organizer nodes are invisible to the .ipynb file.* I see this part a little differently. I don't think there is any need for dummy organizer nodes. And what headline would they be given, anyway? Let's start with an itemized list that we will convert to a Leo tree of nodes: 1.0 Intro 1.1 Context 1.2 Goals 2.0 Approach 2.1 Requirements 2.1.1 User requirements 2.1.2 Maintenance requirements 2.1.2.1 Scheduled 2.1.2.2 Unplanned 3.0 Schedule Note that there is are indentation jumps, e.g., from level 4 indentation (2.1.2.2) to level 0 indentation( 3.0). The natural translation into nodes is (denoting a node with the "-" character"): - 1.0 Intro - 1.1 Context - 1.2 Goals - 2.0 Approach - 2.1 Requirements - 2.1.1 User requirements - 2.1.2 Maintenance requirements - 2.1.2.1 Scheduled - 2.1.2.2 Unplanned - 3.0 Schedule See? We don't need any extra organizer nodes, even where the indentation jumps back several levels. Each cell of the jupytext markdown cells either starts with a heading of some level or it doesn't. My script uses those headings to create the headline for the cell. If it doesn't, just the plain text of the first line should be used (I forget whether my script does this last bit or not). (I only take the first 6 words of the header line - you wouldn't want the whole line). -- 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 leo-editor+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/leo-editor/aa7d8387-5e67-4add-bf7a-01b26d6d8e46n%40googlegroups.com.