vscode-markdown-notes icon indicating copy to clipboard operation
vscode-markdown-notes copied to clipboard

Relative path for file in same directory

Open krry opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. When I create a wiki-link to a file in the same directory, it starts with the filename. This is nice and readable. But when I publish using NextJS, the link is interpreted to be absolute (from the root), so the link breaks.

with files like:

/foo_dir/
-- bar.md
-- baz.md

and bar.md:

[[baz]]

<!-- becomes -->
[baz]: baz.md

<!-- rather than -->
[baz]: ./baz.md

Describe the solution you'd like If there were a leading ./ on the wiki-link, this would work perfectly. Notably, when a file is in the directory above, the wiki-link uses this relative syntax: ../example.md.

Could we set this behavior as an option? e.g., "makeRelativePathsExplicit": true?

Describe alternatives you've considered I've tried unsuccessfully to determine if I can tell NextJS to interpret bare filenames as relative. If anyone knows how to do that I'm all ears.

Additional context I'm using Markdown Notes in combination with Foam which I believe uses this extension to create Link References as wiki-links at the foot of a given file.

krry avatar Mar 17 '21 22:03 krry

This is a good point -- I like your solution, "makeRelativePathsExplicit": true -- and I would probably default this true if relative paths option is on.

kortina avatar Mar 19 '21 18:03 kortina