2025-05-05
Norgolith
Continue implementing .ul-docs macro.
Some interesting problems I found on link system design:
What should we do with
{/posts/foo}? I mean,<a href="/posts/foo">is a valid anchor.
Ideas:
We can force user to use
file:///to explicitly state for absolute path from filesystemWe can implement dedicated apis to create relative/absolute(from workspace) links:
(neorg/create-relative-target origin path)(neorg/create-absolute-target path)
Both
originandpathshould be absolute path from filesystemBut what should these apis return?
Link Sytnax design
linkables starting with
{: local linkA local link can be resolved in single-file mode because it will always pointing somewhere in same document like
* headingor using raw url like/posts/fooorhttps://example.comA local link can be exported without need of Neorg-like application
linkables starting with
{:: app linkAn app link can only be resolved when a workspace is defined. It can point to somewhere else in current workspace or even from external workspaces e.g.
:foo,:/aboutor:$foo:pathAn app link can only be exported from Neorg-like application
:/pathpoints topath.norgorpath/index.norgin current workspace root.:$foo:pathis same to:$foo:/path
{ : $foo : path/to/file : * heading }
^ ^^^^ ^ ^^^^^^^^^^^^ ^ ^^^^^^^^^
| | | file path | local scope
| | | |
| | |--------------'
| | |
| | scope delimiter
| |
| workspace name
|
app link prefix
So now I fixed my mind with user-perspective, but how can I make link system modular?
Like, I can convert absolute path to correct target and vice versa, but how can I convert rich target to actual link in different markup language / export targets? Is JanetString a type capable of handling every export targets?