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 wiki links titles #136

Closed
gmcusaro opened this issue Jan 8, 2023 · 7 comments · Fixed by #221
Closed

Support wiki links titles #136

gmcusaro opened this issue Jan 8, 2023 · 7 comments · Fixed by #221
Labels
enhancement New feature or request

Comments

@gmcusaro
Copy link

gmcusaro commented Jan 8, 2023

As mentioned in docs:

By default Marksman uses a document title's slug when referencing a document, however there is an configuration setting to use a file name or a file path instead.

and in this reply, like in Obsidian and Foam it could be really useful to add a | for a title/alias to the slug or filename/path:

[[destination|title]]

Example:
Check my [[short-bio|bio]]

Preview:
Check my bio

@artempyanykh artempyanykh changed the title Wiki links title Support wiki links titles Jan 10, 2023
@artempyanykh
Copy link
Owner

Thanks for raising this @gmcusaro. Supporting titles in wiki-links definitely makes sense.

@artempyanykh artempyanykh added the enhancement New feature or request label Jan 10, 2023
@tjex
Copy link

tjex commented May 17, 2023

ooooh man. this would make my year!! 🥲

@eguiraud
Copy link
Contributor

eguiraud commented May 25, 2023

Hello, I don't know much F# but I wouldn't mind giving this a shot if it's just a matter of changing a regex or similar and you can point me to the relevant section of the code 😬

...because Obsidian often automatically creates notes with titles/aliases, e.g. to hide .. in [[../somenote.md|somenote]], so this feature is what's missing for me to use marksman with Obsidian-generated notes.

@artempyanykh
Copy link
Owner

artempyanykh commented May 30, 2023

@eguiraud sounds good! Not quite "tweaking a regex" experience, because the parsing library wants to do it in a 'char-by-char matching' way, but the relevant section of the parser is this one And you would probably want to tweak this definition of a wiki link to also include the title node.

LMK if you decide to give it a shot!

@eguiraud
Copy link
Contributor

eguiraud commented Jun 5, 2023

Hello, yes I can try to give this a shot either this week or the next.

eguiraud added a commit to eguiraud/marksman that referenced this issue Jun 15, 2023
With this patch wikilinks of the form [[doc#heading|title]]
are correctly recognized as links to doc#heading.
Also go-to-definition works as normal.

This fixes artempyanykh#136.
eguiraud added a commit to eguiraud/marksman that referenced this issue Jun 15, 2023
With this patch wikilinks of the form [[doc#heading|title]]
are correctly recognized as links to doc#heading.
Also go-to-definition works as normal.

This fixes artempyanykh#136.
artempyanykh pushed a commit that referenced this issue Jun 20, 2023
With this patch wiki links of the form [[doc#heading|title]]
are correctly recognized as links to doc#heading.
Also go-to-definition works as normal.

This fixes #136.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Marksman backlog Jun 20, 2023
@tjex
Copy link

tjex commented Jun 20, 2023

year made ✅. thanks @eguiraud

@eguiraud
Copy link
Contributor

Happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants