From 6897111cf903ede35715863e375341be1d11f8a0 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 19 Dec 2022 13:42:20 +0100 Subject: [PATCH] Changelog --- common/markdown_parser/parser.ts | 3 ++- plugs/core/navigate.ts | 22 +++++++++++++++++++++- website/CHANGELOG.md | 8 ++++++++ website/Silver Bullet.md | 9 ++++----- website/template/plug.md | 2 +- website/πŸ”Œ Plugs.md | 26 +++++++++++++------------- 6 files changed, 49 insertions(+), 21 deletions(-) diff --git a/common/markdown_parser/parser.ts b/common/markdown_parser/parser.ts index be1d3479..548781a8 100644 --- a/common/markdown_parser/parser.ts +++ b/common/markdown_parser/parser.ts @@ -183,8 +183,9 @@ const highlightingDirectiveParser = directiveParser.configure({ props: [ styleTags({ "Name": t.variableName, - "String PageRef": t.string, + "String": t.string, "Number": t.number, + "PageRef": ct.WikiLinkTag, "Where Limit Select Render Order OrderDirection And": t.keyword, }), ], diff --git a/plugs/core/navigate.ts b/plugs/core/navigate.ts index 37398166..c2ff18bc 100644 --- a/plugs/core/navigate.ts +++ b/plugs/core/navigate.ts @@ -23,7 +23,16 @@ async function actionClickOrActionEnter( return; } const navigationNodeFinder = (t: ParseTree) => - ["WikiLink", "Link", "Image", "URL", "NakedURL", "Link", "CommandLink"] + [ + "WikiLink", + "Link", + "Image", + "URL", + "NakedURL", + "Link", + "CommandLink", + "PageRef", + ] .includes( t.type!, ); @@ -49,6 +58,17 @@ async function actionClickOrActionEnter( await editor.navigate(pageLink, pos, false, inNewWindow); break; } + case "PageRef": { + const bracketedPageRef = mdTree.children![0].text!; + await editor.navigate( + // Slicing off the initial [[ and final ]] + bracketedPageRef.substring(2, bracketedPageRef.length - 2), + 0, + false, + inNewWindow, + ); + break; + } case "NakedURL": await editor.openUrl(patchUrl(mdTree.children![0].text!)); break; diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index af1a78cc..2319f095 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -3,6 +3,14 @@ release. --- +## Next +* Changed styling for [[Frontmatter]], fenced code blocks and directives to avoid vertical jumping when moving the cursor around. +* Clicking the URL (inside of an image `![](url)` or link `[text](link)`) no longer navigates there, you need to click on the anchor text to navigate there now (this avoids a lot of weird behavior). +* Long page name in title now no longer overlap with action buttons +* Clicking on a page reference in a `render` clause (inside of a directive) now navigates there (use Alt-click to just move the cursor) + +--- + ## 0.2.4 * Vim mode is here! This mode can be enabled on a per-client basis (its state is stored in the browser). To toggle Vim mode on or off use the {[Editor: Toggle Vim Mode]} command. * Security update: SB now binds to `127.0.0.1` by default, allowing just connections via `localhost`. To allow outside connections, pass the `--hostname 0.0.0.0` flag (and ideally combine it with a `--user username:password` flag to add basic authentication). diff --git a/website/Silver Bullet.md b/website/Silver Bullet.md index a45adda4..9d871f22 100644 --- a/website/Silver Bullet.md +++ b/website/Silver Bullet.md @@ -1,9 +1,9 @@ Silver Bullet is an extensible, [open source](https://github.com/silverbulletmd/silverbullet), **personal -knowledge management** application. Indeed, fundamentally that’s fancy talk for β€œa note-taking app with links.” However, Silver Bullet goes a bit beyond just that. +knowledge management** system. Indeed, that’s fancy talk for β€œa note-taking app with links.” However, Silver Bullet goes a bit beyond just that. -You thought there was no such thing as a [silver bullet](https://en.wikipedia.org/wiki/Silver_bullet). You were wrong. +You’ve been told there is _no such thing_ as a [silver bullet](https://en.wikipedia.org/wiki/Silver_bullet). You were told wrong. -Let’s have a look at some of its features. +Let’s have a look at some of Silver Bullet’s features. ## Features * Runs in any modern browser (including on mobile) and is installable as a [PWA](https://web.dev/progressive-web-apps/). @@ -123,7 +123,6 @@ And restart Silver Bullet. You should be good to go. ## Support -If you (hypothetically) find bugs or have feature requests, post them in -[our issue tracker](https://github.com/silverbulletmd/silverbullet/issues). Want to contribute? [Check out the code](https://github.com/silverbulletmd/silverbullet). +If you (hypothetically) find bugs or have feature requests, post them in [our issue tracker](https://github.com/silverbulletmd/silverbullet/issues). Want to contribute? [Check out the code](https://github.com/silverbulletmd/silverbullet). Want to chat with us? [We have a Mattermost instance](https://silverbullet.cloud.mattermost.com/), join us! diff --git a/website/template/plug.md b/website/template/plug.md index fb7813ab..8fa0a9af 100644 --- a/website/template/plug.md +++ b/website/template/plug.md @@ -1 +1 @@ -* [[{{name}}]] {{#if author}}by **{{author}}** ([repo]({{repo}})){{/if}} \ No newline at end of file +* [[{{name}}]] {{#if author}}by **{{author}}** ([repo]({{repo}})){{/if}} \ No newline at end of file diff --git a/website/πŸ”Œ Plugs.md b/website/πŸ”Œ Plugs.md index 211547cd..e93cf330 100644 --- a/website/πŸ”Œ Plugs.md +++ b/website/πŸ”Œ Plugs.md @@ -17,24 +17,24 @@ Plugs are distributed as self-contained JSON files (ending with `.plug.json`). U ## Core plugs These plugs are distributed with Silver Bullet and are automatically enabled: -* [[πŸ”Œ Collab]] -* [[πŸ”Œ Core]] -* [[πŸ”Œ Directive]] -* [[πŸ”Œ Emoji]] -* [[πŸ”Œ Markdown]] -* [[πŸ”Œ Share]] +* [[πŸ”Œ Collab]] +* [[πŸ”Œ Core]] +* [[πŸ”Œ Directive]] +* [[πŸ”Œ Emoji]] +* [[πŸ”Œ Markdown]] +* [[πŸ”Œ Share]] * [[πŸ”Œ Tasks]] ## Third-party plugs These plugs are written either by third parties or distributed separately from the main SB distribution: -* [[πŸ”Œ Backlinks]] by **Guillermo VayΓ‘** ([repo](https://github.com/Willyfrog/silverbullet-backlinks)) -* [[πŸ”Œ Ghost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-ghost)) -* [[πŸ”Œ Git]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github)) -* [[πŸ”Œ Github]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github)) -* [[πŸ”Œ Graph View]] by **Bertjan Broeksema** ([repo](https://github.com/bbroeksema/silverbullet-graphview)) -* [[πŸ”Œ Mattermost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mattermost)) -* [[πŸ”Œ Serendipity]] by **Pantelis Vratsalis** ([repo](https://github.com/m1lt0n/silverbullet-serendipity)) +* [[πŸ”Œ Backlinks]] by **Guillermo VayΓ‘** ([repo](https://github.com/Willyfrog/silverbullet-backlinks)) +* [[πŸ”Œ Ghost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-ghost)) +* [[πŸ”Œ Git]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github)) +* [[πŸ”Œ Github]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github)) +* [[πŸ”Œ Graph View]] by **Bertjan Broeksema** ([repo](https://github.com/bbroeksema/silverbullet-graphview)) +* [[πŸ”Œ Mattermost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mattermost)) +* [[πŸ”Œ Serendipity]] by **Pantelis Vratsalis** ([repo](https://github.com/m1lt0n/silverbullet-serendipity)) * [[πŸ”Œ Twitter]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet-twitter)) ## How to develop your own plug