crossnote
crossnote copied to clipboard
@import and absolute paths
It seems to be the case that @import
command only works with relative paths/directories, is it possible to use absolute paths in some cases?
(Perhaps one easy fix would just be to check the first character of the path to see if it's "/".)
Absolut Paths seem to work
@import "/chapters/convex-analysis/KonvexeProbleme.md"
in https://github.com/gabyx/TechnicalMarkdown
works relative to the root folder of the workspace.
What does not work is
@import "file:///home/.../Desktop/Repository/TechnicalMarkdown/chapters/convex-analysis/KonvexeProbleme.md"
@import should be able to handle Urls (only https://
is implemented) and relative "./bla" (relative to the source of the .md
) and absolute file paths "/bla/bla" relative to the working/project directory of the engine. This is already implemented
Maybe a replacement variable would be good such that behavior is predictable:
- @import "${workingDir}/..."
- @import "${basePath}/...."
- @import "${currentFile}/..."
- @import "/..." -> same as 2.
- @import "./..." -> same as 3.
So far your request works. I would prefer that other urls file://
is also supported such that we can reference any path on a disk locally...