As an old user of leo who has started again with current versions, is it still possible to use <<section>> definitions and references everywhere with tangle and untangle. These commands are still available but I can't seem to seem to find documentation for section use.
In my recent experiments with sections there is no issue for a <<section id>> which is defined in a child node, but if I try to re-use the definition through the outline (for a repeatable pattern for example), it doesn't work so well. Indeed, I recently got stuck trying, in an @clean file, to re-use a section definition above @others in the the @others nodes, which didn't work.
In my recent experiments with sections there is no issue for a <<section id>> which is defined in a child node, but if I try to re-use the definition through the outline (for a repeatable pattern for example), it doesn't work so well. Indeed, I recently got stuck trying, in an @clean file, to re-use a section definition above @others in the the @others nodes, which didn't work.The typical way is to clone the "reused" definition and move a clone as a child of each node containing a section reference. Does this work for you?
The typical way is to clone the "reused" definition and move a clone as a child of each node containing a section reference. Does this work for you?This works, but frankly I find it a little unintuitive. If I define a section at any point in the tree, I would expect that in any body of a child of the section definition node you can naturally refer to the content of the section without having to clone.
It's the other way around. If you refer to a section, the definition of the section must appear in one of the node's descendants. This behavior is never going to change.
...perhaps one can conceive conceive of an (analogous/orthogonal?) features that fit how programmers already think:
- <<section>> : use abstraction, define later- [[WikiWord]] two-way wiki references- {{variable}} variable substitution -- define once, user later- ((includes)) transclusion -- define once, include laterIn each of the above the double-bracket type is a headline, and then the magic happens in the bodies.
That functionality was present in old Leo versions (around 4.3) with @root-code directive.