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

wikilinks #54

Closed
namjul opened this issue Aug 5, 2022 · 9 comments
Closed

wikilinks #54

namjul opened this issue Aug 5, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@namjul
Copy link

namjul commented Aug 5, 2022

Maybe this should not be part of tree-sitter-markdown since its not part of CommonMark Spec or Github flavored markdown so just opening up the question of supporting wikilinks.

@namjul namjul added the enhancement New feature or request label Aug 5, 2022
@namjul namjul changed the title Wikilinks wikilinks Aug 5, 2022
@MDeiml
Copy link
Collaborator

MDeiml commented Aug 6, 2022

It could definitely be implemented in a way that it can be conditionally enabled (as an extension). To me it seems like a there would be a few people who would want this.

@boltlessengineer
Copy link
Contributor

@MDeiml Just curious, what do you mean by conditionally enabled? Does tree-sitter parser can be configured?

@MDeiml
Copy link
Collaborator

MDeiml commented Nov 12, 2022

Once the parser is compiled it can't be configured, but I added some code to configure it at compile time (using environment variables). You can see it in the common/grammar.js

@vicrdguez
Copy link

vicrdguez commented May 23, 2023

+1 for the feature, ideally given that wikilinks are becoming more and more common, alias text support would make it compatible with multiple tools:

[[wikilink]]
[[wikilink|alias]]

This could allow mainly for concealing where just [[alias]] or [alias] is shown

MDeiml added a commit that referenced this issue Jun 4, 2023
@mscott99
Copy link

I am trying to enable this feature and am having trouble (new to vim/neovim). How do I set the variable in the readme? Is it in vim.g ?

@MDeiml
Copy link
Collaborator

MDeiml commented Jul 22, 2023

This is not really supported that well yet in neovim. See nvim-treesitter/nvim-treesitter#3076. I think the only solution is to build the parser yourself. For this clone the repo, and run the command EXTENSION_WIKI_LINK=1 npm run build. This assumes you are using either linux or macos.

Then you have to point nvim-treesitter to this local version. See their documentation on how to do that.

@MDeiml
Copy link
Collaborator

MDeiml commented Nov 5, 2023

Closing this as wiki links are now supported (but hidden behind a compilation time flag).

@MDeiml MDeiml closed this as completed Nov 5, 2023
@ryanpeach
Copy link

@MDeiml how do we enable these in rust bindings?

@MDeiml
Copy link
Collaborator

MDeiml commented Nov 3, 2024

Sadly, at the moment this is not possible when using the rust bindings as a normal cargo dependency. You would have to clone this repository locally and run EXTENSION_WIKI_LINK=1 node scripts/build.js, then point the other project to this version of the bindings. A system where this is configured through a cargo feature would be better, but this would somehow require the treesitter cli as a build dependency.

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
None yet
Development

No branches or pull requests

6 participants