Work on client modes
This commit is contained in:
@@ -4,7 +4,10 @@ release.
|
||||
---
|
||||
|
||||
## Next
|
||||
* Another heavy behind-the-scenes refactoring release, refactoring the large “core” plug into multiple smaller ones, documentation to be updated to reflect this.
|
||||
This release brings a new default [[Client Modes|client mode]] to SilverBullet: online mode, which does not sync content to the client but keeps it all at the server. More information: [[Client Modes]].
|
||||
|
||||
Other notable changes:
|
||||
* Massive reshuffling of built-in [[🔌 Plugs]], splitting the old “core” plug into [[🔌 Editor]], [[🔌 Template]] and [[🔌 Index]].
|
||||
* Removed [[Cloud Links]] support in favor of [[Federation]]
|
||||
|
||||
---
|
||||
@@ -63,7 +66,7 @@ release.
|
||||
* Initial work on [[Attributes]] (inline [[Metadata]]) such as this [importance:: high]
|
||||
* Added {[Debug: Reset Client]} command that flushes the local databases and caches (and service worker) for debugging purposes.
|
||||
* Added {[Editor: Center Cursor]} command.
|
||||
* New template helper `replaceRegexp`, see [[🔌 Core/Templates@vars]]
|
||||
* New template helper `replaceRegexp`, see [[🔌 Template@vars]]
|
||||
* **Bug fix**: Renaming of pages now works again on iOS
|
||||
* Big internal code refactor
|
||||
|
||||
@@ -80,7 +83,7 @@ release.
|
||||
|
||||
## 0.3.4
|
||||
|
||||
* **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 page’s name, but any page meta data. More information here: [[🔌 Core/Templates@vars]]. You will now get completion for built-in handlebars helpers after typing `{{`.
|
||||
* **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 page’s name, but any page meta data. More information here: [[🔌 Template@vars]]. You will now get completion for built-in handlebars helpers after typing `{{`.
|
||||
* **Breaking change** (for [[STYLES]] users). The [[STYLES]] page is now no longer “magic” and hardcoded. It can (and must) now be specified in [[SETTINGS]] (see example on that page) for styles to be loaded from it.
|
||||
* 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)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
SilverBullet currently supports two modes for its client:
|
||||
|
||||
1. _Online mode_ (the default): keeps all content on the server
|
||||
2. _Synced mode_ (offline capable): syncs all content to the client
|
||||
|
||||
You can toggle between these two modes by clicking the 🔄 button in the top bar.
|
||||
|
||||
You can switch modes at any time, so try them both to decide what works best for you.
|
||||
|
||||
## Online mode
|
||||
In online mode, all content in your space is kept on the server, and a lot of the heavy lifting (such as indexing of pages) happens on the server.
|
||||
|
||||
Advantages:
|
||||
* **Keeps content on the server**: this mode not synchronize all your content to your client (browser), making this a better fit for large spaces.
|
||||
* **Lighter-weight** in terms of memory and CPU use of the client
|
||||
|
||||
Disadvantages:
|
||||
* **Requires a working network connection** to the server.
|
||||
* **Higher latency**, since more interactions require calls to the server, this may be notable e.g. when completing page names.
|
||||
|
||||
## Synced mode
|
||||
In this mode, all content is synchronized to the client, and all processing happens there. The server effectively acts as “dumb data store.” All SilverBullet functionality is available even when there is no network connection available.
|
||||
|
||||
Advantages:
|
||||
* **100% offline capable**: disconnect your client from the network, shutdown the server, everything still works. Changes synchronize automatically once a network connection is re-established.
|
||||
* **Lower latency**: all actions are performed locally in the client, which in most cases will be faster
|
||||
|
||||
Disadvantages:
|
||||
* **Synchronizes all content onto your client**: using disk space and an initially large bulk of network traffic to download everything.
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ Metadata is data about data. There are a few entities you can add meta data to:
|
||||
|
||||
In addition, this metadata can be augmented in a few additional ways:
|
||||
|
||||
* [[🔌 Core/Tags]]: adds to the `tags` attribute
|
||||
* [[Tags]]: adds to the `tags` attribute
|
||||
* [[Frontmatter]]: at the top of pages, a [[YAML]] encoded block can be used to define additional attributes to a page
|
||||
* [[Attributes]]
|
||||
@@ -0,0 +1,35 @@
|
||||
So here’s a secret — [[SilverBullet]] is really just a trojan horse to test a potentially much more widely applicable idea, the idea to _make applications extensible at different levels of its stack_ in a controlled manner.
|
||||
|
||||
## Background
|
||||
I’ve long appreciated the simplicity and flexibility of [AWS’s lambda functions](https://aws.amazon.com/lambda/). The idea is simple: you write a function using some language (JavaScript, Python, Java or whatever floats your boat), package it up, and ship it to AWS (think: zip file). Then, you configure the triggers that invoke those functions (such as certain events) and that’s it. The rest is managed for you.
|
||||
|
||||
The AWS infrastructure fully manages the lifecycle of these functions: it ensures there are sufficient servers ready to invoke them, runs the code, recycles the processes when appropriate, and kills them when they misbehave. All this machinery is completely hidden from the user. It is referred to as **serverless** because it abstracts away the concept of a server.
|
||||
|
||||
Of course, this requires functions to be written in a specific way:
|
||||
|
||||
* **Stateless:** while the runtime may keep functions running and reuse an instance to perform multiple invocations, functions have to be written without this assumption. Therefore any state needs to be maintained outside of the function.
|
||||
* **Self contained:** they make limited assumptions on the environment other than a language runtime, typically.
|
||||
* **Short lived:** the assumption is that functions run for a limited amount of time, usually a few milliseconds, perhaps seconds, but a minute at most.
|
||||
|
||||
While they can perform arbitrary computations, they do have constraints:
|
||||
|
||||
1. They have to be stateless: while the runtime may keep functions running and reuse an instance to perform multiple invocations, they cannot assume this is the case. They have to assume that every invocation happens in a fresh environment.
|
||||
2. They have limited access to the host machine, such as no direct access to a (persistent) file system.
|
||||
|
||||
What can these functions do? In principle, anything, while being limited to access to the host. They generally cannot write to the host’s filesystem for instance. They also tend to be constrained in allocated run time and memory. All communication with the outside world tends to happen
|
||||
|
||||
Then, you configure when it should be triggered.
|
||||
|
||||
This concept is not only interesting in terms of **scalability** — such a function can quickly scale to millions of invocations per second when necessary, and down to zero when that demand vanishes — but also in terms of **portability**. Couldn’t such functions conceptually run _everywhere_? And indeed, recently such functions have been moving to what’s called “the edge” as well, such as [Lambda@Edge](https://aws.amazon.com/lambda/edge/), [Vercel’s Edge Functions](https://vercel.com/blog/edge-functions-generally-available), or [Netlify’s Edge Functions](https://docs.netlify.com/edge-functions/overview/). What is the “edge” here? Generally, the closest data center these providers offer near the user. The goal? Lower latency.
|
||||
|
||||
But is that is as _edgy_ as we can get? What about the _real_ edge: the user’s device?
|
||||
|
||||
## Introducing PlugOS
|
||||
PlugOS is a JavaScript (TypeScript) library that brings these concepts to _applications_: allowing applications, [[SilverBullet]] to be extended in a safe way, by allowing plugins — named “plugs” — to _hook_ into various aspects of the application, run custom code as a result, which in turn can affect the application again via _syscalls_.
|
||||
|
||||
## Concepts
|
||||
* _Functions_: are pieces of code, written in JavaScript or TypeScript that add custom functionality to a hosting application.
|
||||
* _Hooks_: are application-specific extension points, they can range from defining new commands, to timer based hooks (cron-like), to HTTP endpoints to be defined.
|
||||
* _Syscalls_: expose (often) application-specific functionality to functions, allowing it to e.g. manipulate the UI, access various data stores etc.
|
||||
* _Manifests_: wire the whole thing together, they are [[YAML]] files that define the functions and what they hook into.
|
||||
* _Sandbox_: each plug is run in its own sandbox, in the browser this is a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API), on the server as well (although Deno enables [deeper sandboxing](https://deno.land/manual@v1.36.3/runtime/workers#instantiation-permissions) than the browser). Sandboxes can, in principle, be flushed out and restarted at any time. In fact, this is how _hot reloading_ of plugs is implemented.
|
||||
@@ -1,4 +1,4 @@
|
||||
SilverBullet is an extensible, [open source](https://github.com/silverbulletmd/silverbullet), **personal knowledge management** system. Indeed, that’s fancy talk for “a note-taking app with links.” However, SilverBullet goes a bit beyond _just_ that.
|
||||
SilverBullet is an extensible, [open source](https://github.com/silverbulletmd/silverbullet), **personal knowledge management** system. Indeed, that’s fancy talk for “a note-taking app with links.” However, SilverBullet goes _a bit_ beyond just that.
|
||||
|
||||
You’ve been told there is _no such thing_ as a [silver bullet](https://en.wikipedia.org/wiki/Silver_bullet). You were told wrong.
|
||||
|
||||
@@ -7,7 +7,7 @@ Before we get to the nitty gritty, some _quick links_ for the impatient reader:
|
||||
Now that we got that out of the way let’s have a look at some of SilverBullet’s features.
|
||||
|
||||
## Features
|
||||
* Runs in any modern browser (including on mobile) as an **offline-first [[PWA]],** keeping the primary copy of your content in the browser, syncing back to the server when a network connection is available.
|
||||
* Runs in any modern browser (including on mobile) as a [[PWA]] in two potential [[Client Modes]] (_online_ and _synced_ mode), where the _synced mode_ enables **100% offline operation**, keeping a copy of content in the browser, syncing back to the server when a network connection is available.
|
||||
* Provides an enjoyable [[Markdown]] writing experience with a clean UI, rendering text using [[Live Preview|live preview]], further **reducing visual noise** while still providing direct access to the underlying markdown syntax.
|
||||
* Supports wiki-style **page linking** using the `[[page link]]` syntax, even keeping links up-to-date when pages are renamed.
|
||||
* Optimized for **keyboard-based operation**:
|
||||
|
||||
@@ -6,7 +6,7 @@ Tags in SilverBullet can be added in two ways:
|
||||
For instance, by using the #core-tag in this page, it has been tagged and can be used in a [[🔌 Directive/Query]]:
|
||||
|
||||
<!-- #query page where tags = "core-tag" render [[template/page]] -->
|
||||
* [[🔌 Core/Tags]]
|
||||
* [[Tags]]
|
||||
<!-- /query -->
|
||||
|
||||
Similarly, tags can be applied to list **items**:
|
||||
@@ -16,9 +16,9 @@ Similarly, tags can be applied to list **items**:
|
||||
and be queried:
|
||||
|
||||
<!-- #query item where tags = "core-tag" -->
|
||||
|name |tags |page |pos|
|
||||
|-------------------------------|--------|------------|---|
|
||||
|This is a tagged item #core-tag|core-tag|🔌 Core/Tags|493|
|
||||
|name |tags |page|pos|
|
||||
|-------------------------------|--------|----|---|
|
||||
|This is a tagged item #core-tag|core-tag|Tags|494|
|
||||
<!-- /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@804]] This is a tagged task #core-tag
|
||||
* [ ] [[Tags@808]] This is a tagged task #core-tag
|
||||
<!-- /query -->
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
---
|
||||
|
||||
The core plug implements foundational functionality for SilverBullet. It covers the following areas:
|
||||
|
||||
* [[🔌 Core/Indexing]]
|
||||
* [[🔌 Core/Templates]]
|
||||
* [[🔌 Core/Tags]]
|
||||
* [[🔌 Core/Full Text Search]]
|
||||
* [[🔌 Core/Slash Commands]]
|
||||
* [[🔌 Core/Edit Commands]]
|
||||
* [[🔌 Core/Plug Management]]
|
||||
* [[🔌 Core/Link Unfurl]]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
The [[🔌 Core]] plug provides various useful edit commands, such as:
|
||||
The [[🔌 Editor]] plug provides various useful edit commands, such as:
|
||||
|
||||
* {[Text: Bold]} {[Text: Italic]} {[Text: Marker]} to respectively make text bold, italic or mark it.
|
||||
* {[Text: Listify Selection]} to turn each line in the selection into a (bullet) list
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
SilverBullet has a generic indexing infrastructure. Pages are reindexed upon saving, so about every second. Manual reindexing can be done running the {[Space: Reindex]} command.
|
||||
|
||||
The [[🔌 Core]] plug indexes the following:
|
||||
|
||||
* Page metadata encoded in [[Frontmatter]] (queryable via the `page` query source)
|
||||
* Page backlinks (queryable via the `link` query source), this information is used when renaming a page (automatically updating pages that link to it). Renaming can be done either by editing the page name in the header and hitting `Enter`, or using the {[Page: Rename]} command.
|
||||
* List items, such as bulleted and numbered lists (queryable via the `item` query source)
|
||||
@@ -1,10 +1,10 @@
|
||||
Plug management using the [[PLUGS]] file is also implemented in the [[🔌 Core]] plug.
|
||||
Plug management using the [[PLUGS]] file is also implemented in the [[🔌 Editor]] plug.
|
||||
|
||||
The optional [[PLUGS]] file is only processed when running the {[Plugs: Update]} command, in which case it will fetch all the listed plugs and copy them into the (hidden) `_plug/` folder in the user’s space. SilverBullet loads these files on boot (or on demand after running the {[Plugs: Update]} command).
|
||||
|
||||
You can also use the {[Plugs: Add]} to add a plug, which will automatically create a [[PLUGS]] if it does not yet exist.
|
||||
|
||||
The [[🔌 Core]] plug has support for the following URI prefixes for plugs:
|
||||
The [[🔌 Editor]] 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.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Slash commands are built-in to SilverBullet. You can trigger them by typing a `/` in your text (after whitespace).
|
||||
|
||||
The [[🔌 Core]] plug provides a few helpful ones:
|
||||
The [[🔌 Editor]] plug provides a few helpful ones:
|
||||
|
||||
* `/h1` through `/h4` to turn the current line into a header
|
||||
* `/hr` to insert a horizontal rule (`---`)
|
||||
* `/table` to insert a markdown table (whoever can remember this syntax without it)
|
||||
* `/snippet` see [[🔌 Core/Templates@snippets]]
|
||||
* `/snippet` see [[🔌 Template@snippets]]
|
||||
* `/today` to insert today’s date
|
||||
* `/tomorrow` to insert tomorrow’s date
|
||||
|
||||
@@ -47,7 +47,7 @@ So, for instance, a template can take a tag name as an argument:
|
||||
$eval
|
||||
The `#eval` directive can be used to evaluate arbitrary JavaScript expressions. It’s also possible to invoke arbitrary plug functions this way.
|
||||
|
||||
**Note:** This feature is experimental and will likely evolve.
|
||||
**Note:** ==This feature is experimental== and will likely evolve.
|
||||
|
||||
A simple example is multiplying numbers:
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ The best part about data sources: there is auto-completion. 🎉
|
||||
|
||||
Start writing `<!— #query` or simply use `/query` slash command, it will show you all available data sources. 🤯
|
||||
|
||||
Additionally there are [[🔌 Core/Templates@vars|special variables]] you can use in your queries.
|
||||
Additionally there are [[🔌 Template@vars|special variables]] you can use in your queries.
|
||||
|
||||
For example, if you wanted a query for all the tasks from a previous day's daily note, you could use the following query:
|
||||
`<!-- #query task where page = "📅 {{yesterday}}" -->`
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
---
|
||||
|
||||
The `editor` plug implements foundational editor functionality for SilverBullet.
|
||||
|
||||
## Commands
|
||||
|
||||
* {[Editor: Toggle Dark Mode]}: toggles dark mode
|
||||
* {[Editor: Toggle Vim Mode]}: toggle vim mode, see: [[Vim]]
|
||||
* {[Stats: Show]}: shows some stats about the current page (word count, reading time etc.)
|
||||
* {[Help: Getting Started]}: Open getting started guide
|
||||
* {[Help: Version]}: Show version number
|
||||
|
||||
### Pages
|
||||
* {[Page: New]}: Create a new (untitled) page. Note that usually you would create a new page simply by navigating to a page name that does not yet exist.
|
||||
* {[Page: Delete]}: delete the current page
|
||||
* {[Page: Copy]}: copy the current page
|
||||
|
||||
### Navigation
|
||||
* {[Navigate: Home]}: navigate to the home (index) page
|
||||
* {[Navigate To page]}: navigate to the page under the cursor
|
||||
* {[Navigate: Center Cursor]}: center the cursor at the center of the screen
|
||||
* {[Navigate: Move Cursor to Position]}: move cursor to a specific (numeric) cursor position (# of characters from the start of the document)
|
||||
|
||||
### Text editing
|
||||
* {[Text: Quote Selection]}: turns the selection into a blockquote (`>` prefix)
|
||||
* {[Text: Listify Selection]}: turns the lines in the selection into a bulleted list
|
||||
* {[Text: Number Listify Selection]}: turns the lines in the selection into a numbered list
|
||||
* {[Text: Link Selection]}: turns the selection into a link.
|
||||
#ProTip You can can also select text and paste a URL on it via `Ctrl-v`/`Cmd-v` to turn it into a link)
|
||||
* {[Text: Bold]}: make text **bold**
|
||||
* {[Text: Italic]}: make text _italic_
|
||||
* {[Text: Marker]}: mark text with a ==marker color==
|
||||
* {[Link: Unfurl]}: “Unfurl” a link, see [[🔌 Editor/Link Unfurl]]
|
||||
|
||||
### Folding commands
|
||||
* {[Fold: Fold]}: fold current section (list, header)
|
||||
* {[Fold: Unfold]}: unfold current section
|
||||
* {[Fold: Fold All]}: fold all sections
|
||||
* {[Fold: Unfold All]}: unfold all sections
|
||||
|
||||
## Debug
|
||||
Commands you shouldn’t need, but are nevertheless there:
|
||||
|
||||
* {[Debug: Reset Client]}: clean out all cached data on the client and reload
|
||||
* {[Debug: Reload UI]}: reload the UI (same as refreshing the page)
|
||||
* {[Account: Logout]}: (when using built-in [[Authentication]]) Logout
|
||||
|
||||
@@ -2,4 +2,4 @@ SilverBullet has infrastructure to “unfurl” — that is: replace with somet
|
||||
|
||||
Plugs can provide custom unfurls for specific URL patterns. For instance the [[🔌 Twitter]] plug provides the ability to unfurl tweets, and pull in their content.
|
||||
|
||||
[[🔌 Core]] provides a generic URL unfurl, adding a title for a url.
|
||||
[[🔌 Editor]] provides a generic URL unfurl, adding a title for a url.
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
---
|
||||
SilverBullet has a generic indexing infrastructure. Pages are reindexed upon saving, so about every second.
|
||||
|
||||
The [[🔌 Index]] plug also defines syntax for [[Tags]]
|
||||
|
||||
## Content indexing
|
||||
The [[🔌 Index]] plug indexes the following:
|
||||
|
||||
* [[Metadata]]
|
||||
* [[Tags]]
|
||||
* Page backlinks (queryable via the `link` query source), this information is used when renaming a page (automatically updating pages that link to it).
|
||||
* List items, such as bulleted and numbered lists (queryable via the `item` query source)
|
||||
|
||||
## Commands
|
||||
* {[Space: Reindex]}: reindex the entire
|
||||
* {[Page: Rename]}: Rename a page
|
||||
#ProTip Renaming is more conveniently done by editing the page name in the header and hitting `Enter`.
|
||||
* {[Page: Batch Rename Prefix]}: Rename a page prefix across the entire space
|
||||
* {[Page: Extract]}: Extract the selected text into its own page
|
||||
+5
-4
@@ -1,6 +1,6 @@
|
||||
SilverBullet at its core is bare bones in terms of functionality, most of its power it gains from **plugs**.
|
||||
|
||||
Plugs are an extension mechanism (implemented using a library called PlugOS that’s part of the silverbullet repo) that runs “plug” code in the browser using [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).
|
||||
Plugs are an extension mechanism (implemented using a library called [[PlugOS]] that’s part of the silverbullet repo) that runs “plug” code in the browser using [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).
|
||||
|
||||
Plugs can hook into SB in various ways:
|
||||
|
||||
@@ -17,12 +17,14 @@ 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]] -->
|
||||
* [[🔌 Core]]
|
||||
* [[🔌 Directive]]
|
||||
* [[🔌 Editor]]
|
||||
* [[🔌 Emoji]]
|
||||
* [[🔌 Index]]
|
||||
* [[🔌 Markdown]]
|
||||
* [[🔌 Share]]
|
||||
* [[🔌 Tasks]]
|
||||
* [[🔌 Tasks]]
|
||||
* [[🔌 Template]]
|
||||
<!-- /query -->
|
||||
|
||||
## Third-party plugs
|
||||
@@ -85,7 +87,6 @@ Within seconds (watch your browser’s JavaScript console), your plug should be
|
||||
Since plugs run in your browser, you can use the usual browser debugging tools. When you console.log things, these logs will appear in your browser’s JavaScript console.
|
||||
|
||||
## Distribution
|
||||
|
||||
Once you’re happy with your plug, you can distribute it in various ways:
|
||||
|
||||
- You can put it on github by simply committing the resulting `.plug.js` file there and instructing users to point to by adding
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ Tasks in SilverBullet are written using semi-standard task syntax:
|
||||
|
||||
* [ ] This is a task
|
||||
|
||||
Tasks can also be annotated with [[🔌 Core/Tags]]:
|
||||
Tasks can also be annotated with [[Tags]]:
|
||||
|
||||
* [ ] This is a tagged task #my-tag
|
||||
|
||||
@@ -27,6 +27,6 @@ This metadata is extracted and available via the `task` query source to [[🔌 D
|
||||
|name |done |page |pos|tags |deadline |
|
||||
|-----------------------------|-----|--------|---|------|----------|
|
||||
|This is a task |false|🔌 Tasks|213| | |
|
||||
|This is a tagged task #my-tag|false|🔌 Tasks|287|my-tag| |
|
||||
|This is due |false|🔌 Tasks|573| |2022-11-26|
|
||||
|This is a tagged task #my-tag|false|🔌 Tasks|279|my-tag| |
|
||||
|This is due |false|🔌 Tasks|565| |2022-11-26|
|
||||
<!-- /query -->
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
The core plug implements a few templating mechanisms.
|
||||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
---
|
||||
|
||||
The [[🔌 Template]] plug implements a few templating mechanisms.
|
||||
|
||||
### Page Templates
|
||||
|
||||
The {[Template: Instantiate Page]} command enables you to create a new page based on a page template.
|
||||
|
||||
Page templates, by default, are looked for in the `template/page/` prefix. So creating e.g. a `template/page/Meeting Notes` page will create a “Meeting Notes” template. You can override this prefix by setting the `pageTemplatePrefix` in `SETTINGS`.
|
||||
@@ -64,6 +68,16 @@ 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.
|
||||
|
||||
## Slash commands
|
||||
* `/front-matter`: Insert [[Frontmatter]]
|
||||
* `/h1` - `/h4`: turn the current line into a header
|
||||
* `/code`: insert a fenced code block
|
||||
* `/hr`: insert a horizontal rule
|
||||
* `/table`: insert a table
|
||||
* `/page-template`: insert a page template
|
||||
* `/today`: insert today’s date
|
||||
* `/tomorrow`: insert tomorrow’s date
|
||||
|
||||
### Template helpers
|
||||
$vars
|
||||
Currently supported (hardcoded in the code):
|
||||
Reference in New Issue
Block a user