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

Add support for ID-based links #3

Merged
merged 17 commits into from
May 23, 2020
Merged

Conversation

wgslr
Copy link
Contributor

@wgslr wgslr commented May 22, 2020

Implement functionality inspired by Zettlr -- the ability to store ids in files and link to them with wiki-style links. For example:

file1.md

# This is a file having an id
This is its id: 20200522225822
file2.md

# This is a file linking to another
See the other file: [[20200522225822]]

The file id is the first match of a (configurable) regex in its contents.

@wgslr wgslr force-pushed the id-based-links branch from 5dbc1d2 to a1fb2b1 Compare May 22, 2020 21:25
@wgslr wgslr marked this pull request as draft May 22, 2020 21:34
@wgslr wgslr changed the title WIP Add support for ID-based links Add support for ID-based links May 22, 2020
Copy link
Owner

@tchayen tchayen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware it is WIP, but I thought some things could be improved.

src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
@wgslr wgslr force-pushed the id-based-links branch 2 times, most recently from b8cac89 to 9035e6d Compare May 22, 2020 22:32
@wgslr wgslr marked this pull request as ready for review May 22, 2020 23:02
Copy link
Owner

@tchayen tchayen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last batch of requests.

BTW, please remove package-lock.json. The extension will be published with yarn-downloaded dependencies anyway, so it only creates a confusion with two of those files. Especially that I won't be using it so the contents will quickly get outdated.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
wgslr added 3 commits May 23, 2020 01:19
Did not take into account file ids.
- as the default value use \d{14} which is also the default in Zettlr
- adjust ids in wiki-links examples to match this expression
@wgslr wgslr force-pushed the id-based-links branch from 1f8ac43 to 090a945 Compare May 22, 2020 23:19
wgslr and others added 3 commits May 23, 2020 01:20
Co-authored-by: Tomasz Czajęcki <tomek.czajecki@gmail.com>
This allows usage of ^ and $ to match line start and end.
@tchayen tchayen merged commit d3254f6 into tchayen:master May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants