48 - Better Path Handling #3506
kevinslin
started this conversation in
RFCs/Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Better path handling for links to regular files inside of Dendron
Context
The path handling today isn't portable or intuitive in a multi-vault setting
File Layout
This file layout will be used for subsequent examples
Legend
Current Behavior
Both absolute and relative paths are anchored to the directory where the topmost
dendron.yml
resides in.The downsides of this approach is that links inside of sub-vaults are not portable because they depend on a specific workspace configuration.
The relative path behavior is also not intuitive as it is not relative to the note but relative to the vault.
from
root/notes/root.md
[[/dendron.yml]]
: root/dendron.yml[[./dendron.yml]]
: dendron.ymlfrom
root/a/notes/root.md
[[/dendron.yml]]
: root/dendron.yml[[./dendron.yml]]
: dendron.ymlProposal
Example
Given the same file layout as the previous example, paths should resolve as follows:
from
root/notes/root.md
[[/dendron.yml]]
: root/dendron.yml[[./dendron.yml]]
: notes/dendorn.yml (this would point to a non-existing file because there is nodendron.yml
file innotes
)from
root/a/notes/root.md
[[/dendron.yml]]
: root/a/dendron.yml[[./dendron.yml]]
: dendron.yml (invalid link, similar to the above)Tradeoffs
The treatment of relative paths might still be easier to use if it were relative to the directory where the
dendron.yml
of the given vault was (same treatment as the absolute path). This is because linked to files are most likely going to lie outside of thenotes
folder which means most relative links will start with../
to go outside of thenotes
folder.Discussion
Beta Was this translation helpful? Give feedback.
All reactions