tree-sitter-markdown icon indicating copy to clipboard operation
tree-sitter-markdown copied to clipboard

wikilinks

Open namjul opened this issue 2 years ago • 1 comments

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 avatar Aug 05 '22 22:08 namjul

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.

MDeiml avatar Aug 06 '22 10:08 MDeiml

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

boltlessengineer avatar Nov 12 '22 16:11 boltlessengineer

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

MDeiml avatar Nov 12 '22 17:11 MDeiml

+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

vicrdguez avatar May 23 '23 17:05 vicrdguez

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 ?

mscott99 avatar Jun 16 '23 14:06 mscott99

This is not really supported that well yet in neovim. See https://github.com/nvim-treesitter/nvim-treesitter/issues/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 avatar Jul 22 '23 11:07 MDeiml

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

MDeiml avatar Nov 05 '23 21:11 MDeiml