Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linking using full path relative to repo root #791

Open
ais opened this issue Oct 19, 2021 · 6 comments
Open

Support linking using full path relative to repo root #791

ais opened this issue Oct 19, 2021 · 6 comments
Labels
foam-core Related to API, core model or feature
Milestone

Comments

@ais
Copy link

ais commented Oct 19, 2021

Links that start with / leave placeholders in the graph. Users in our org use a web tool to create files, and links in this tool are expected to be absolute. We would like to use the graph to get an overview of our knowledge and improve the structure of our documentation.

image

@riccardoferretti
Copy link
Collaborator

are those links absolute in the file system or "relative" to the repo root?

@ais
Copy link
Author

ais commented Oct 20, 2021

relative to the repo root

@riccardoferretti riccardoferretti changed the title Support absolute links in the graph Support linking using full path relative to repo root Oct 28, 2021
@riccardoferretti riccardoferretti added the foam-core Related to API, core model or feature label Oct 28, 2021
@riccardoferretti
Copy link
Collaborator

related conversation: #806 (comment)

@riccardoferretti riccardoferretti added this to the 1.0.0 milestone Dec 2, 2021
@SHiLLySiT
Copy link

I'd also like to see this work in Foam, since out-of-the-box paths that start with / in a Markdown link are interpreted as paths relative to the project root.

From the VS Code docs:

Paths starting with / are resolved relative to the current workspace root, while paths staring with ./ or without any prefix are resolved relative to the current file.

As a work around, Foam correctly links a file instead of adding a placeholder in the graph if you add .. in the path to navigate up folder(s).

Current, undesired behavior:
image

Workaround:
image

@stereobooster
Copy link

IMO links should work the same as in VSCode and Github e.g. [Readme.md](/Readme.md) should be supported. Related Portable markdown links

@riccardoferretti
Copy link
Collaborator

Thanks for the comment and pointer @stereobooster and @SHiLLySiT - this is actually a good reference point.

I agree Foam should follow the VS Code convention, which is also compatible with @stereobooster 's portable md links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
foam-core Related to API, core model or feature
Projects
None yet
Development

No branches or pull requests

4 participants