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

While creating new notes out of missing wiki links, sluggify the file name #770

Closed
LogeshG5 opened this issue Sep 25, 2021 · 6 comments
Closed

Comments

@LogeshG5
Copy link

LogeshG5 commented Sep 25, 2021

Scenario 1:

When I type [[Graph Visualisation]] and if this file is not present, let Foam create a file Graph-Visualisation.md instead of "Graph Visuailsation.md"

Let the [[wiki links]] have spaces.
Let the H1 title have spaces.
But the file names can have hyphens.
Accordingly update the reference links.

Scenario 2:

If I already have a file Graph-Visualisation.md, upon clicking [[Graph Visualisation]], Foam should know that it has to navigate to the Graph-Visualisation.md and keep the reference links appropreately updated.

This feature could be made configurable.

Example:

I'm picking an example from foam's readme.md
The wiki link is [[Graph Visualisation]]
The file name is graph-visualisation.md
References are to be generated like [Graph Visualisation]: docs/features/graph-visualisation.md "Graph Visualisation"

@ecool
Copy link

ecool commented Sep 25, 2021

This sounds like you would like the Markdown Notes extension. It sluggifies the title like you ask. Only thing that might be an issue is it has it's own note creation template.

Check it out here: https://marketplace.visualstudio.com/items?itemName=kortina.vscode-markdown-notes

@LogeshG5 LogeshG5 changed the title Create missing notes with While creating new notes out of missing wiki links, sluggify the file name Sep 26, 2021
@RVirmoors
Copy link

i have the same issue.

the Markdown Notes extension creates the nice sluggified file, but Foam doesn't link to it. Indeed, when ctrl+clicking on the new [[Wiki Link]] it creates a new Wiki Link.md file, instead of linking to the existing wiki-link.md created by Markdown Notes...

@riccardoferretti
Copy link
Collaborator

We are aware that Markdown Notes works differently from Foam in this regard, we have taken that choice some time ago on purpose.
As of 0.17.5 you can use the FOAM_SLUG template variable to achieve use the slug of a title, but keep in mind that the filename must still match the wikilink for it to resolve correctly.
At the moment there is no "transformation" of the wikilink based on the resulting filename, that might be something to consider to fully implement a more seamless transformation.
Currently it's not in the plans to allow [[Wiki Link]] to map to wiki-link.md, I am not completely against it in principle, but I am concerned about possible side effects, and conflict resolution, and there are other aspects we want to complete before considering this feature.

I hope this provides some context and some sort of workaround

@zomars
Copy link
Contributor

zomars commented Jul 4, 2022

I thought this was already resolved. I've stopped use foam for a year and I'm trying to retake it and many of my previously created links seems broken now. (Many had accents and mixed casing)

@riccardoferretti
Copy link
Collaborator

There is no immediate plan to support this in Foam, but you can use Markdown Notes to keep compatibility with your previous wikilinks

@zomars
Copy link
Contributor

zomars commented Jul 18, 2022

Using markdown notes creates a "double note creation" conflict with foam. We should reopen this.

Edit: related to #1023 and #1035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants