This post explains why PR #3215 
<https://github.com/leo-editor/leo-editor/pull/3215> (gnx-based unls) is a 
milestone in Leo's history.


gnx-based unls are a fundamental resource comparable in importance to 
@clean and cff:


- Unls won't break if you rename or move a node.

- Leo supports *platform-independent* cross-file unls.

- Creating gnx-based unls is dead easy.


Leo now contains significant new resources related to gnx-based unls:


*@data unl-path-prefixes* helps resolve unls to different paths on 
different platforms. *Most users need to know only about this setting.*


Leo provides two other resources for plugins:


*g.parsePathData* parses such @data nodes to a python dict.


*g.openUNLFile(c, s)* resolves s (the file part of an unl) to a commander, 
defaulting to c if no resolution is possible. This function contains an 
Easter Egg. It will return c immediately if s specifies the active outline.


Plugins can monkey-patch g.openUNLFile to gain *complete *control over how 
Leo resolves unls.


*Summary*


gnx-based unls are a fundamental resource comparable in importance to 
`@clean` and cff. Creating unbreakable cross-file unls is dead easy.


Leonistas will likely find creative new uses for unls. For example, a 
script could scan a document, possibly contained in different outlines, 
converting unls to links for markup/reStructuredText.


Most users need to know only about the *@data unl-path-prefixes* setting. 
*g.parsePathData* parses such @data nodes to a python dict.


Plugins can monkey-patch *g.openUNLFile* to gain complete control over how 
Leo resolves unls.


All of your questions and comments are welcome.


Edward


P.S. Plugins can also alter @data unl-path-prefixes *programmatically *by 
calling *c.config.set*. Like this:


c.config.set(kind='data', name='unl-path-prefixes', val=lines)


Unit tests for leoGlobals do this using *LeoUnitTest._set_setting*. Take a 
look :-)


EKR

-- 
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 on the web visit 
https://groups.google.com/d/msgid/leo-editor/07f49a7e-f9f1-455d-8a04-c158181f6b58n%40googlegroups.com.

Reply via email to