lukesmurray / linked-notes-vscode

vscode extension for taken Zettelkasten inspired markdown notes.
https://marketplace.visualstudio.com/items?itemName=lukesmurray.linked-notes-vscode
0 stars 0 forks source link

add file references to markdownit #46

Closed lukesmurray closed 4 years ago

lukesmurray commented 4 years ago

This is related to #29 but we can focus on adding file references first, then adding a bibliography. I think the best strategy is to use a position based approach. We have to modify the inline tokenizer so we shouldl look at the link tokenizer from markdownit https://github.com/markdown-it/markdown-it/blob/1093e68e51c9b3104289c3cfbaffbb1fa4039d59/lib/rules_inline/link.js

But we have to use a plugin approach so we can look at the ins plugin https://github.com/markdown-it/markdown-it-ins/blob/master/index.js

From the link example it looks like pos is the offset into the src. We can match pos and offset from unist point to determine ranges to replace with custom rendering.

lukesmurray commented 4 years ago

not as simple as I hoped, extendMarkdownIt does not have access to the currently opened file. So we actually will most likely need to do parsing within the markdownit extension. Will have to pass csldata by reference.

lukesmurray commented 4 years ago

I'm labeling this as out of scope based on #49. I've decided that rendering any form of output is out of scope. The only form of output I want to try and tackle is materializing a workspace for use in pandoc.