pajoma / vscode-journal

Lightweight journal and simple notes support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal
GNU General Public License v3.0
233 stars 40 forks source link

Better Wiki Links #92

Open pajoma opened 3 years ago

pajoma commented 3 years ago

Test to support simple wiki links, e.g. [[a-link-is-here]] or [[A Link Is here]] (with snake case normalization)

Required features:

pajoma commented 3 years ago

Problem here: we lose markdown compatibility.

Current syntax is:

- a file [link](../../notes/some-note.md)

Proposed syntax is (for the same file)

- a file link [[../../notes/some-note.md]]

and if we are able to guarantee uniquess of filenames in all scopes it could be

- a file link [[some-note]]

Uniquess is an issue, though. Journal entries might just be named after day in month (e.g. 12.md in /2021/08), which means a lot of 12.md in the workspace.

Alternative solution

A code action is provided (as Refactor), which detects the QuickLink-Syntax and converts it to a proper link.

  1. User enters: a file link to [[workshop notes]]
  2. Code Action triggered: Create note and transform to link
  3. [[workshop notes]] is transformed to [workshop-notes](../notes/202108-workshop-notes.md). The file name follows the pattern in the configuration
  4. A new file is created with the title # Workshop Notes

Open Questions:

How to deal with scopes? [[workshop notes]] : The new file is created in default path for notes [[workshop notes #projA]] : The new file is created in scope path for notes

pajoma commented 3 years ago

The text within the brackets [[]] is resolved like the text in the magic input. The following should be possible