Big refactors and fixes

* Query regen
* Fix anchor completion
* Dependency fixes
* Changelog update
This commit is contained in:
Zef Hemel
2023-07-02 11:25:32 +02:00
committed by GitHub
parent fee2c5928e
commit 7c825348b2
74 changed files with 935 additions and 567 deletions
+13 -8
View File
@@ -4,7 +4,12 @@ release.
---
## Next
* Folding is here (at least with commands, not much UI): {[Fold: Fold]}, {[Fold: Unfold]}, {[Fold: Fold All]} and {[Fold: Unfold All]}.
* **Breaking change (for some templates):** Template in various places allowed you to use `{{variables}}` and various handlebars functions. There also used to be a magic `{{page}}` variable that you could use in various places, but not everywhere. This has now been unified. And the magical `{{page}}` now has been replaced with the global `@page` which does not just expose the pages name, but any page meta data. More information here: [[🔌 Core/Templates@vars]]. You will now get completion for built-in handlebars helpers after typing `{{`.
* Folding is here (at least with commands, not much UI): {[Fold: Fold]}, {[Fold: Unfold]}, {[Fold: Toggle Fold]}, {[Fold: Fold All]} and {[Fold: Unfold All]}.
* {[Broken Links: Show]} command (not complete yet, but already useful)
* The `Daily Note` template now supports setting a caret position with `|^|`.
* Explicit {[Sync: Now]} command for those who are impatient
---
@@ -63,7 +68,7 @@ Besides these architectural changes, a few other breaking changes were made to s
## 0.2.12
* Added support to override CSS styles on a per-space basis. This replaces the previous `fontFamily` setting. See [[STYLES]] for hints on how to use this new experimental feature.
* [[Sync]]: Support to exclude prefixes (via [[SETTINGS]])
* Sync: Support to exclude prefixes (via [[SETTINGS]])
* Reverted behavior of using up/down arrow keys to move between the page title and page content (and rename based on it). This resulted in undesirable behavior too often. You can now rename a page by clicking/tapping on the title, changing the name and hitting Enter or clicking anywhere outside the page title to apply the rename.
* Documentation updates (on https://silverbullet.md):
* [[Special Pages]]
@@ -95,16 +100,16 @@ Besides these architectural changes, a few other breaking changes were made to s
---
## 0.2.9
* Fixed copy & paste, drag & drop of attachments in the [[Desktop]] app
* Continuous [[Sync]]
* Fixed copy & paste, drag & drop of attachments in the Desktop app
* Continuous Sync
* Support for embedding [[Markdown/Code Widgets]].
* ~~Ability to set the editor font via the `fontFamily` setting~~ in [[SETTINGS]] (restart the app/reload the page to make it go into effect). **Update**: now done via [[STYLES]]
---
## 0.2.8
* [[Sync]] should now be usable and is documented
* Windows and Mac [[Desktop]] apps now have proper icons (only Linux left)
* [[Mobile]] app for iOS in TestFlight
* Sync should now be usable and is documented
* Windows and Mac Desktop apps now have proper icons (only Linux left)
* Mobile app for iOS in TestFlight
* New onboarding index page when you create a new space, pulling content from [[Getting Started]].
* Various bug fixes
@@ -229,7 +234,7 @@ Besides these architectural changes, a few other breaking changes were made to s
* New directive `#eval` see [[🔌 Directive@eval]]
* New PlugOS feature: redirecting function calls. Instead of specifying a `path` for a function, you can now specify `redirect` pointing to another function name, either in the same plug using the `plugName.functionName` syntax.
* `Cmd-click` or `Ctrl-click` now opens page references in a new window. You can `Alt-click` to put your cursor at the target without navigation.
* New {[Open Weekly Note]} command (weeks start on Sunday by default, to allow for planning, but you can change this to Monday by setting the `weeklyNoteMonday` to `true` in [[Settings]]). Like for {[Open Daily Note]} you can create a template in `template/page/Weekly Note`.
* New {[Open Weekly Note]} command (weeks start on Sunday by default, to allow for planning, but you can change this to Monday by setting the `weeklyNoteMonday` to `true` in [[SETTINGS]]). Like for {[Open Daily Note]} you can create a template in `template/page/Weekly Note`.
* The `Create page` option when navigating pages now always appears as the _second_ option. Let me know how you like it.
* New `Preview` using a custom markdown renderer offering a lot of extra flexibility (and a much smaller file size). New thing it does:
* Render front matter in a table
-35
View File
@@ -1,35 +0,0 @@
Work on the `mattermost-plugin` — integration of SB into Mattermost as a
product/plugin as a proof of concept.
To do:
- [ ] Bundle backend with node.js as part of plugin
- Various options investigated, including [nexe](https://github.com/nexe/nexe)
and [pkg](https://github.com/vercel/pkg) but neither of these will work
great due to dynamically loading and resolving of modules in the node.js
sandbox implementation.
- Most straight-forward option is to simply bundle the `node` binary per
platform + a trimmed down `node_modules` modeled how `npx` does this. Once
per platform.
- [ ] Fix CSS styling issues
- [ ] Store pages in DB instead of text files (general SB feature, not MM
specific)
- [ ] Switch over SB plugin to use MM database (MySQL, Postgres) as backing
store rather than SQLite
- [ ] Freeze plug configuration (dont allow anybody or at most admins) to
update plugs for security reasons. We may simply remove the `PLUGS` page.
- What about `SETTINGS`?
- Easy option: disable, dont use
- Fancier option: make them user specific with a layer on top of the FS
- What about `SECRETS`?
To deliberate on:
- Consider page locking mechanisms, or re-implement real-time collaboration
(would require introducing web sockets again and OT) — big project.
- Consider page revision options
- Scope of spaces, tied to:
- Personal (default SB PKMS use case, no permission, collaboration issues)
- Channel (old Boards model)
- Team
- Server
+4
View File
@@ -25,4 +25,8 @@ spaceIgnore: |
dist
largefolder
*.mp4
# Federation
#federate:
#- someserver
```
+1 -1
View File
@@ -11,4 +11,4 @@
access-control-allow-headers: *
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS
access-control-allow-origin: *
access-control-expose-headers: *
access-control-expose-headers: *
-1
View File
@@ -1,5 +1,4 @@
{{#each .}}
{{@key}}: {{.}}
{{/each}}
---
+1
View File
@@ -0,0 +1 @@
* |^|
+1 -1
View File
@@ -1 +1 @@
* [[{{name}}]] {{#if author}}by **{{author}}** ([repo]({{repo}})){{/if}}
* [[{{name}}]] {{#if author}}by **{{author}}** ([repo]({{repo}})){{/if}}
+1 -1
View File
@@ -1 +1 @@
* [{{#if done}}x{{else}} {{/if}}] [[{{page}}@{{pos}}]] {{name}} {{#if deadline}}📅 {{deadline}}{{/if}}
* [{{#if done}}x{{else}} {{/if}}] [[{{page}}@{{pos}}]] {{name}}
-1
View File
@@ -9,4 +9,3 @@ The [[🔌 Core]] plug has support for the following URI prefixes for plugs:
* `https:` loading plugs via HTTPS, e.g. `[https://](https://raw.githubusercontent.com/silverbulletmd/silverbullet-github/main/github.plug.json)`
* `github:org/repo/file.plug.json` internally rewritten to a `https` url as above.
* `ghr:org/repo/version` to fetch a plug from a Github release
*
+2 -2
View File
@@ -18,7 +18,7 @@ and be queried:
<!-- #query item where tags = "core-tag" -->
|name |tags |page |pos|
|-------------------------------|--------|------------|---|
|This is a tagged item #core-tag|core-tag|🔌 Core/Tags|485|
|This is a tagged item #core-tag|core-tag|🔌 Core/Tags|486|
<!-- /query -->
and **tags**:
@@ -28,5 +28,5 @@ and **tags**:
And they can be queried this way:
<!-- #query task where tags = "core-tag" render [[template/task]] -->
* [ ] [[🔌 Core/Tags@533]] This is a tagged task #core-tag
* [ ] [[🔌 Core/Tags@783]] This is a tagged task #core-tag
<!-- /query -->
+11 -4
View File
@@ -19,7 +19,7 @@ For instance:
$name: "📕 "
---
# {{page}}
# {{@page.name}}
As recorded on {{today}}.
## Introduction
@@ -64,8 +64,8 @@ with a 🗓️ emoji by default, but this is configurable via the `weeklyNotePre
The {[Quick Note]} command will navigate to an empty page named with the current date and time prefixed with a 📥 emoji, but this is configurable via the `quickNotePrefix` in `SETTINGS`. The use case is to take a quick note outside of your current context.
### Template placeholders
### Template helpers
$vars
Currently supported (hardcoded in the code):
- `{{today}}`: Todays date in the usual YYYY-MM-DD format
@@ -73,4 +73,11 @@ Currently supported (hardcoded in the code):
- `{{yesterday}}`: Yesterdays date in the usual YYY-MM-DD format
- `{{lastWeek}}`: Current date - 7 days
- `{{nextWeek}}`: Current date + 7 days
- `{{page}}`: The name of the current page
- `{{escapeRegexp "hello/there"}}` to escape a regexp, useful when injecting e.g. a page name into a query — think `name =~ /{{escapeRegexp @page.name}}/`
- `{{json @page}}` translate any (object) value to JSON, mostly useful for debugging
- `{{relativePath @page.name}}` translate a path to a relative one (to the current page), useful when injecting page names, e.g. `{{relativePath name}}`.
- `{{translateAbsoluteLinks "text"}}` translates all absolute page links in the argument string to relative ones.
- `{{substring "my string" 0 3}}` performs a substring operation on the first argument, which in this example would result in `my `
- `{{prefixLines "my string\nanother" " "}}` prefixes each line (except the first) with the given prefix.
- `{{niceDate @page.lastModified}}` translates any timestamp into a “nice” format (e.g. `2023-06-20`).
- The `@page` variable contains all page meta data (`name`, `lastModified`, `contentType`, as well as any custom [[Frontmatter]] attributes). You can address it like so: `{{@page.name}}`
+26 -26
View File
@@ -163,11 +163,11 @@ For the sake of simplicity, we will use the `page` data source and limit the res
**Result:** Look at the data. This is more than we need. The query even gives us template pages. Let's try to limit it in the next step.
<!-- #query page limit 3 -->
|name |lastModified |contentType |size |perm|tags|
|-----------|-------------|-------------|-----|--|----|
|CHANGELOG |1684497544505|text/markdown|23605|rw|tags|
|Cloud Links|1676121406519|text/markdown|1177 |rw| |
|Frontmatter|1676121406519|text/markdown|1090 |rw| |
|name |lastModified |contentType |size |perm|tags|
|--------------|-------------|-------------|-----|--|----|
|Authentication|1686682290943|text/markdown|1730 |rw| |
|BROKEN LINKS |1688066558009|text/markdown|196 |rw| |
|CHANGELOG |1687348511871|text/markdown|27899|rw|tags|
<!-- /query -->
@@ -178,13 +178,13 @@ For the sake of simplicity, we will use the `page` data source and limit the res
**Result:** Okay, this is what we wanted but there is also information such as `perm`, `type` and `lastModified` that we don't need.
<!-- #query page where type = "plug" order by lastModified desc limit 5 -->
|name |lastModified |contentType |size|perm|type|uri |repo |author |
|--|--|--|--|--|--|--|--|--|
|🔌 Git |1676639116714|text/markdown|943 |rw|plug|github:silverbulletmd/silverbullet-git/git.plug.json |https://github.com/silverbulletmd/silverbullet-git |Zef Hemel |
|🔌 Share |1676121406530|text/markdown|711 |rw|plug| |https://github.com/silverbulletmd/silverbullet | |
|🔌 Tasks |1676121406530|text/markdown|1229|rw|plug| |https://github.com/silverbulletmd/silverbullet | |
|🔌 Twitter |1676121406530|text/markdown|1269|rw|plug|github:silverbulletmd/silverbullet-twitter/twitter.plug.json|https://github.com/silverbulletmd/silverbullet-twitter|SilverBullet Authors|
|🔌 Graph View|1676121406529|text/markdown|1041|rw|plug|github:bbroeksema/silverbullet-graphview/graphview.plug.json|https://github.com/bbroeksema/silverbullet-graphview |Bertjan Broeksema |
|name |lastModified |contentType |size|perm|type|uri |repo |author |share-support|
|--|--|--|--|--|--|--|--|--|--|
|🔌 KaTeX |1687099068396|text/markdown|1342|rw|plug|github:silverbulletmd/silverbullet-katex/katex.plug.js |https://github.com/silverbulletmd/silverbullet-katex |Zef Hemel | |
|🔌 Core |1687094809367|text/markdown|402 |rw|plug| |https://github.com/silverbulletmd/silverbullet | | |
|🔌 Collab |1686682290959|text/markdown|2969|rw|plug| |https://github.com/silverbulletmd/silverbullet | |true|
|🔌 Twitter|1685105433212|text/markdown|1266|rw|plug|github:silverbulletmd/silverbullet-twitter/twitter.plug.js|https://github.com/silverbulletmd/silverbullet-twitter|SilverBullet Authors| |
|🔌 Mermaid|1685105423879|text/markdown|1096|rw|plug|github:silverbulletmd/silverbullet-mermaid/mermaid.plug.js|https://github.com/silverbulletmd/silverbullet-mermaid|Zef Hemel | |
<!-- /query -->
#### 6.3 Query to select only certain fields
@@ -195,14 +195,14 @@ and `repo` columns and then sort by last modified time.
**Result:** Okay, this is much better. However, I believe this needs a touch
from a visual perspective.
<!-- #query page select name author repo uririrririrririrririrririrririrririri where type = "plug" order by lastModified desc limit 5 -->
|name |author |repo |ririrririrririrririrririri|
|--|--|--|--|
|🔌 Git |Zef Hemel |https://github.com/silverbulletmd/silverbullet-git ||
|🔌 Share | |https://github.com/silverbulletmd/silverbullet ||
|🔌 Tasks | |https://github.com/silverbulletmd/silverbullet ||
|🔌 Twitter |SilverBullet Authors|https://github.com/silverbulletmd/silverbullet-twitter||
|🔌 Graph View|Bertjan Broeksema |https://github.com/bbroeksema/silverbullet-graphview ||
<!-- #query page select name, author, repo where type = "plug" order by lastModified desc limit 5 -->
|name |author |repo |
|--|--|--|
|🔌 KaTeX |Zef Hemel |https://github.com/silverbulletmd/silverbullet-katex |
|🔌 Core | |https://github.com/silverbulletmd/silverbullet |
|🔌 Collab | |https://github.com/silverbulletmd/silverbullet |
|🔌 Twitter|SilverBullet Authors|https://github.com/silverbulletmd/silverbullet-twitter|
|🔌 Mermaid|Zef Hemel |https://github.com/silverbulletmd/silverbullet-mermaid|
<!-- /query -->
#### 6.4 Display the data in a format defined by a template
@@ -211,12 +211,12 @@ from a visual perspective.
**Result:** Here you go. This is the result we would like to achieve 🎉. Did you see how I used `render` and `template/plug` in a query? 🚀
<!-- #query page select name author repo uririrririrririrririrririrririrririri where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
* [[🔌 Git]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-git))
* [[🔌 Share]]
* [[🔌 Tasks]]
* [[🔌 Twitter]] by **SilverBullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet-twitter))
* [[🔌 Graph View]] by **Bertjan Broeksema** ([repo](https://github.com/bbroeksema/silverbullet-graphview))
<!-- #query page where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
* [[🔌 KaTeX]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-katex))
* [[🔌 Core]]
* [[🔌 Collab]]
* [[🔌 Twitter]] by **SilverBullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet-twitter))
* [[🔌 Mermaid]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mermaid))
<!-- /query -->
PS: You don't need to select only certain fields to use templates. Templates are
+15 -16
View File
@@ -17,27 +17,27 @@ Plugs are distributed as self-contained JavaScript bundles (ending with `.plug.j
## Core plugs
These plugs are distributed with SilverBullet and are automatically enabled:
<!-- #query page where type = "plug" and uri = null order by name render [[template/plug]] -->
* [[🔌 Collab]]
* [[🔌 Core]]
* [[🔌 Directive]]
* [[🔌 Emoji]]
* [[🔌 Markdown]]
* [[🔌 Share]]
* [[🔌 Collab]]
* [[🔌 Core]]
* [[🔌 Directive]]
* [[🔌 Emoji]]
* [[🔌 Markdown]]
* [[🔌 Share]]
* [[🔌 Tasks]]
<!-- /query -->
## Third-party plugs
These plugs are written either by third parties or distributed separately from the main SB distribution:
<!-- #query page where type = "plug" and uri != null order by name render [[template/plug]] -->
* [[🔌 Backlinks]] by **Guillermo Vayá** ([repo](https://github.com/silverbulletmd/silverbullet-backlinks))
* [[🔌 Ghost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-ghost))
* [[🔌 Git]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-git))
* [[🔌 Github]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github))
* [[🔌 Graph View]] by **Bertjan Broeksema** ([repo](https://github.com/bbroeksema/silverbullet-graphview))
* [[🔌 KaTeX]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-katex))
* [[🔌 Mattermost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mattermost))
* [[🔌 Mermaid]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mermaid))
* [[🔌 Serendipity]] by **Pantelis Vratsalis** ([repo](https://github.com/m1lt0n/silverbullet-serendipity))
* [[🔌 Backlinks]] by **Guillermo Vayá** ([repo](https://github.com/silverbulletmd/silverbullet-backlinks))
* [[🔌 Ghost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-ghost))
* [[🔌 Git]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-git))
* [[🔌 Github]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github))
* [[🔌 Graph View]] by **Bertjan Broeksema** ([repo](https://github.com/bbroeksema/silverbullet-graphview))
* [[🔌 KaTeX]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-katex))
* [[🔌 Mattermost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mattermost))
* [[🔌 Mermaid]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mermaid))
* [[🔌 Serendipity]] by **Pantelis Vratsalis** ([repo](https://github.com/m1lt0n/silverbullet-serendipity))
* [[🔌 Twitter]] by **SilverBullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet-twitter))
<!-- /query -->
@@ -93,4 +93,3 @@ Once youre happy with your plug, you can distribute it in various ways:
`- github:yourgithubuser/yourrepo/yourplugname.plug.js` to their `PLUGS` file
- Add a release in your github repo and instruct users to add the release as `- ghr:yourgithubuser/yourrepo` or if they need a specific release `- ghr:yourgithubuser/yourrepo/release-name`
- You can put it on any other web server, and tell people to load it via https, e.g., `- https://mydomain.com/mypugname.plug.js`.