Links and Pointers
Syntax
The link syntax links one node to another. It opens with the pipe character and a space |
and ends with a space and a right angle bracket >
. Between these is a node ID. Links receive syntax highlighting:
Linking does not require a filename or any other information, only the node ID. See Node IDs for more information.
Opening a Link
ctrl
+ shift
+ /
on a line containing a link will open the link. Urtext will scroll to and center the starting point of the destination node. If there is more than one link on a line, the link containing the cursor, or the cursor is not in a link, the first link after the cursor, will be opened.
Links are Dynamic
Whenever the ID of a node is modified, Urtext will attempt to update all links in the project to that node to the new ID. In rare cases, manually updating may be required.
Pointers
Pointers look like links, but with two right angle brackets at the end >>
.
Pointers act as aliases to their destination node and behave as if copy of the entire destination node is included at the pointers’ position. For uses of this syntax, see Dynamic Definitions.
Link Modifiers
Links are user- or system-modified by adding a character immediately following the opening pipe |
:
File Links
To link to a file, use the file link syntax, which is a single forward slash /
immediately following the opening pipe character. File paths may be relative or absolute, depending on whether the path contains a leading slash:
|/ /absolute/path-to-file/file.txt >
A recommended practice is to include all file assets particular to a single Urtext project either in the same folder or in files
subfolder so they can be linked easily.
Urtext resolves the tilde (~
) character UNIX paths to the user’s home folder:
File links are opened using the system default for the file type or extension. Urtext imposes no default behavior. To open the file in Sublime Text (i.e. if it is a text or other human-readable file), set your operating system to open that file type in Sublime Text.
Missing Node Links
If a linked node cannot be located in the current project, it will be assigned the question mark ?
modifier:
Action Links
The exclamation mark !
modifier makes an action link. It can be used to cause a link to execute code in a node rather than open a node. See Dynamic Definitions for more information.
URIs
URIs such as web links are recognized automatically and do not require link wrappers. They are opened with the system default browser or application.
Sublime Text Link Commands
Two Sublime Command Palette commands can make linking quick and easy:
Urtext : Link To …
Links from the currently viewed node to another node which you can select in the selection panel. When you select a node in the quick panel, a link to that node will be inserted at the cursor.
Urtext: Link From …
Links TO the current node FROM another node. When you select this command, a link to the current node will be copied to the clipboard. You can then paste the reference into the node you open in the quick panel.