Massive documentation bump
parent
94127c41f0
commit
e926b7ba47
|
@ -44,7 +44,7 @@ export async function updateDirectivesOnPageCommand(arg: any) {
|
|||
const currentNode = nodeAtPos(tree, index + 1);
|
||||
if (currentNode?.type !== "CommentBlock") {
|
||||
// If not a comment block, it's likely a code block, ignore
|
||||
// console.log("Not comment block, ingoring", fullMatch);
|
||||
// console.log("Not comment block, ignoring", fullMatch);
|
||||
return fullMatch;
|
||||
}
|
||||
replacements.push(replacement);
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
This file lists all plugs that SilverBullet will load. Run the {[Plugs: Update]} command to update and reload this list of plugs.
|
||||
|
||||
```yaml
|
||||
# Insert a list of plugs here, one per line, e.g.
|
||||
- github:silverbulletmd/silverbullet-git/git.plug.json
|
||||
```
|
|
@ -1,5 +1,7 @@
|
|||
Silver Bullet is extensible, [open source](https://github.com/silverbulletmd/silverbullet), **personal
|
||||
knowledge management** software. Indeed, that’s fancy language for “a note taking app with links.” Beside providing a nice [markdown](https://en.wikipedia.org/wiki/Markdown) editing experience (with live preview), it also enables annotating your content with additional metadata (using [[Frontmatter]]), which can then be queried using a query [[🔌 Directive]].
|
||||
knowledge management** software. Indeed, that’s fancy language for “a note taking app with links.”
|
||||
|
||||
Besides providing a nice [markdown](https://en.wikipedia.org/wiki/Markdown) editing experience (with live preview), and the ability to cross-link pages using the `[[page link]]` format, it also enables annotating your content with additional metadata (using [[Frontmatter]]), which can then be queried using a query [[🔌 Directive]]. Silver Bullet is highly extensible, and a lot of its functionality is proved via [[🔌 Plugs]].
|
||||
|
||||
Here is a screenshot of Silver Bullet in PWA mode (Silver Bullet can be installed as a PWA on Chromium-based browsers):
|
||||
|
||||
|
@ -16,7 +18,7 @@ But here’s the kicker:
|
|||
|
||||
That’s right, this very website is powered by a quasi-read-only version of Silver Bullet itself. 🤯
|
||||
|
||||
Quasi-read-only because everything is editable as in a regular copy of Silver Bullet, just none of it persists.
|
||||
Quasi-read-only because everything is editable as in a regular copy of Silver Bullet, just none of it persists (the back-end is read-only).
|
||||
|
||||
## Try it out
|
||||
* Click on the page picker (folder tree) icon at the top right, or hit `Cmd-k` (Mac) or `Ctrl-k` (Linux and Windows) to open the **page switcher**. Type the name of a nonexistent page to create it (although it won’t save in this environment).
|
||||
|
@ -28,11 +30,11 @@ Quasi-read-only because everything is editable as in a regular copy of Silver Bu
|
|||
* Start typing `:party` to trigger the emoji picker 🎉
|
||||
* Type `/` somewhere in the text to invoke a **slash command**.
|
||||
* Hit `Cmd-p` (Mac) or `Ctrl-p` (Windows, Linux) to show a live preview for the current page on the side, if your brain doesn’t speak native Markdown yet.
|
||||
* Open this site on your phone or tablet and… it just works!
|
||||
* Open this site on your phone or tablet and... it just works!
|
||||
* Are you using a browser with **PWA support** (e.g. any Chromium-based
|
||||
browser)? Click on that little icon to the right of your location bar that says “Install Silver Bullet” to give SB its own window frame and desktop icon, like it is a stand-alone app (not particularly useful on silverbullet.md, but definitely do this once you install it yourself).
|
||||
|
||||
Oh yeah, you can use fancy things like tables:
|
||||
Oh yeah, and you can use fancy things like tables:
|
||||
|
||||
| Page | Comment |
|
||||
|----------|----------|
|
||||
|
@ -54,9 +56,7 @@ name: Silver Bullet
|
|||
rating: 5
|
||||
```
|
||||
|
||||
Click into any of these and edit them.
|
||||
|
||||
There are a few features you don’t get to fully experience in this environment, because they rely on a working back-end, such as:
|
||||
There are a few [[🤯 Features]] you don’t get to fully experience in this environment, because they rely on a working back-end, such as:
|
||||
|
||||
* Using Silver Bullet [[🔌 Directive]]s where part of pages are automatically rendered and kept up to date by querying various data sources (such as pages and their metadata, back links, tasks embedded in pages, and list items) with an SQL like syntax, rendered with handlebars templates.
|
||||
* Intelligent **page renaming**, automatically updating any pages that link to it.
|
||||
|
@ -64,8 +64,7 @@ There are a few features you don’t get to fully experience in this environment
|
|||
* **Extending** and updating SB’s functionality by installing additional [[🔌 Plugs]] (SB parlance for plug-ins) and writing your own.
|
||||
|
||||
|
||||
## Explain more, please
|
||||
Silver Bullet is a Markdown editor that stores _pages_ (notes) as plain markdown files in a folder referred to as a _space_. Pages can be cross-linked using the `[[link to other page]]` syntax. However, once you leverage its various extensions (called _plugs_) it can feel more like a _knowledge platform_, allowing you to annotate, combine and query your accumulated knowledge in creative ways, specific to you.
|
||||
## Demo video
|
||||
![Screencast screenshot](demo-video-screenshot.png)
|
||||
Some things are just [better explained in a video](https://youtu.be/VemS-cqAD5k).
|
||||
|
||||
|
@ -79,15 +78,6 @@ in-depth:
|
|||
* [[🔌 Plugs]]
|
||||
* [[🔨 Development]]
|
||||
|
||||
## Principles
|
||||
Some core principles that underly Silver Bullet’s philosophy:
|
||||
|
||||
- **Free and open source**. Silver Bullet is MIT licensed.
|
||||
- **The truth is in the markdown.** Markdown is simply text files, stored on disk. Nothing fancy. No proprietary formats or lock in. While SB uses a database for indexing and caching some data, all of that can be rebuilt from its markdown source at any time. If SB would ever go away, you can still read your pages with any text editor.
|
||||
- **Single, distraction-free mode.** SB doesn’t have a separate view and edit mode. It doesn’t have a “focus mode.” You’re always in focused edit mode, why wouldn’t you?
|
||||
- **Keyboard oriented**. You can use SB fully using the keyboard, typin’ the keys.
|
||||
- **Extend it your way**. SB is highly extensible with [[🔌 Plugs]], and you can customize it to your liking and your workflows.
|
||||
|
||||
## Installing Silver Bullet
|
||||
This consists of two steps (unless Deno is already installed:
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
* [[{{name}}]]
|
|
@ -21,7 +21,7 @@ you want me to spoil the fun: it is an extensible note taking app with markdown
|
|||
Open (`cmd+k`) your `PLUGS` note in SilverBullet and add this plug to the list:
|
||||
|
||||
```yaml
|
||||
- https://github.com/Willyfrog/silverbullet-backlinks/releases/download/v0.2/backlinks.plug.json
|
||||
- https://github.com/Willyfrog/silverbullet-backlinks/releases/download/v0.3/backlinks.plug.json
|
||||
```
|
||||
|
||||
Then run the `Plugs: Update` command and off you go!
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
share-support: true
|
||||
---
|
||||
|
||||
The Collab plug implements real-time “Google Doc” style collaboration with other Silver Bullet users using the [Yjs](https://yjs.dev) library. It supports:
|
||||
|
||||
* Real-time editing
|
||||
* Showing other participant’s cursors
|
||||
|
||||
To use it:
|
||||
|
||||
1. Open a page you would like to collaborate on
|
||||
2. Run the {[Share: Collab]} command and select the collab server to use (an open one runs at `wss://collab.silverbullet.md`)
|
||||
3. Copy & paste the `collab:...` URI that is injected into the `$share` [[Frontmatter]] and send it to a collaborator **or** if your collaborator is not (yet) a Silver Bullet user, you can use the silverbullet.md website (which is an SB instance) directly via the `https://silverbullet.md/collab:...` URL scheme.
|
||||
4. If your collaborator is an SB user, have them use the {[Share: Join Collab]} command, or directly open the `collab:...` URI as a page in Silver Bullet (both do the same).
|
||||
5. If the collaborator wants to keep a persistent copy of the page collaborated page, they can simply _rename_ the page to something not prefixed with `collab:`. Everything will keep working for as long as the `collab:` will appear in the `$share` attribute of [[Frontmatter]]
|
||||
|
||||
If you prefer not to rely on the public `wss://collab.silverbullet.md` server (which will keep persistent copies of all pages shared potentially forever), you can **deploy your own** [following these instructions](https://github.com/yjs/y-websocket).
|
|
@ -1,88 +1,17 @@
|
|||
---
|
||||
type: plug
|
||||
uri: builtin:core
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
---
|
||||
|
||||
This documentation is still a WIP.
|
||||
The core plug implements foundational functionality for Silver Bullet. It covers the following areas:
|
||||
|
||||
## Templating
|
||||
* [[🔌 Core/Indexing]]
|
||||
* [[🔌 Core/Templates]]
|
||||
* [[🔌 Core/Tags]]
|
||||
* [[🔌 Core/Full Text Search]]
|
||||
* [[🔌 Core/Slash Commands]]
|
||||
* [[🔌 Core/Edit Commands]]
|
||||
* [[🔌 Core/Plug Management]]
|
||||
* [[🔌 Core/Link Unfurl]]
|
||||
|
||||
The core 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`.
|
||||
|
||||
Page templates have one “magic” type of page metadata that is used during
|
||||
instantiation:
|
||||
|
||||
* `$name` is used as the default value for a new page based on this template
|
||||
|
||||
In addition, any standard template placeholders are available (see below)
|
||||
|
||||
For instance:
|
||||
|
||||
---
|
||||
$name: "📕 "
|
||||
---
|
||||
|
||||
# {{page}}
|
||||
As recorded on {{today}}.
|
||||
|
||||
## Introduction
|
||||
## Notes
|
||||
## Conclusions
|
||||
|
||||
Will prompt you to pick a page name (defaulting to “📕 “), and then create the following page (on 2022-08-08) when you pick “📕 Harry Potter” as a page name:
|
||||
|
||||
# 📕 Harry Potter
|
||||
As recorded on 2022-08-08.
|
||||
|
||||
## Introduction
|
||||
## Notes
|
||||
## Conclusions
|
||||
|
||||
### Snippets
|
||||
|
||||
Snippets are similar to page templates, except you insert them into an existing page with the `/snippet` slash command. The default prefix is `snippet/` which is configurable via the `snippetPrefix` setting in `SETTINGS`.
|
||||
|
||||
Snippet templates do not support the `$name` page meta, because it doesn’t apply.
|
||||
|
||||
However, snippets do support the special `|^|` placeholder for placing the cursor caret after injecting the snippet. If you leave it out, the cursor will simply be placed at the end, but if you like to insert the cursor elsewhere, that position can be set with the `|^|` placeholder.
|
||||
|
||||
For instance to replicate the `/query` slash command as a snippet:
|
||||
|
||||
<!-- #query |^| -->
|
||||
|
||||
<!-- /query -->
|
||||
|
||||
Which would insert the cursor right after `#query`.
|
||||
|
||||
### Daily Note
|
||||
|
||||
The {[Open Daily Note]} command navigates (or creates) a daily note prefixed
|
||||
with a 📅 emoji by default, but this is configurable via the `dailyNotePrefix` setting in `SETTINGS`. If you have a page template (see above) named `templates/page/Daily Note` it will use this as a template, otherwise, the page will just be empty.
|
||||
|
||||
### Weekly Note
|
||||
|
||||
The {[Open Weekly Note]} command navigates (or creates) a weekly note prefixed
|
||||
with a 🗓️ emoji by default, but this is configurable via the `weeklyNotePrefix` setting in `SETTINGS`. If you have a page template (see above) named `templates/page/Weekly Note` it will use this as a template, otherwise, the page will just be empty.
|
||||
|
||||
### Quick Note
|
||||
|
||||
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
|
||||
|
||||
Currently supported (hardcoded in the code):
|
||||
|
||||
- `{{today}}`: Today’s date in the usual YYYY-MM-DD format
|
||||
- `{{tomorrow}}`: Tomorrow’s date in the usual YYY-MM-DD format
|
||||
- `{{yesterday}}`: Yesterday’s 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
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
The [[🔌 Core]] 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
|
||||
* {[Text: Number Listify Selection]} to turn each line in the selection into a numbered list
|
|
@ -0,0 +1 @@
|
|||
All pages are indexed using SQLite’s FTS5 mechanism. This functionality can be much improved, but it works. You can use it via the {[Search Space]} command.
|
|
@ -0,0 +1,7 @@
|
|||
Silver Bullet has a generic indexing infrastructure. Pages are reindexed upon save, 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)
|
|
@ -0,0 +1,5 @@
|
|||
Silver Bullet has infrastructure to “unfurl” — that is: replace with something nice — various types of URLs. Unfurling can be triggered by putting your cursor on any “naked” URL, and running the {[Link: Unfurl]} command.
|
||||
|
||||
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.
|
|
@ -0,0 +1,12 @@
|
|||
Plug management using the [[PLUGS]] file is also implemented in the [[🔌 Core]] 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. Silver Bullet 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:
|
||||
|
||||
* `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
|
||||
*
|
|
@ -0,0 +1,8 @@
|
|||
Slash commands are built-in to Silver Bullet, the [[🔌 Core]] 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]]
|
||||
* `/today` to insert today’s date
|
||||
* `/tomorrow` to insert tomorrow’s date
|
|
@ -0,0 +1,32 @@
|
|||
Tags in Silver Bullet can be added in two ways:
|
||||
|
||||
1. Through the `tags` attribute in [[Frontmatter]]
|
||||
2. By putting a `#tag` at the top level (to tag a page), or at the task or item level to tag those blocks specifically.
|
||||
|
||||
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]]
|
||||
<!-- /query -->
|
||||
|
||||
Similarly, tags can be applied to list **items**:
|
||||
|
||||
* This is a tagged item #core-tag
|
||||
|
||||
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|
|
||||
<!-- /query -->
|
||||
|
||||
and **tags**:
|
||||
|
||||
* [ ] This is a tagged task #core-tag
|
||||
|
||||
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
|
||||
<!-- /query -->
|
|
@ -0,0 +1,77 @@
|
|||
The core 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`.
|
||||
|
||||
Page templates have one “magic” type of page metadata that is used during
|
||||
instantiation:
|
||||
|
||||
* `$name` is used as the default value for a new page based on this template
|
||||
|
||||
In addition, any standard template placeholders are available (see below)
|
||||
|
||||
For instance:
|
||||
|
||||
---
|
||||
$name: "📕 "
|
||||
---
|
||||
|
||||
# {{page}}
|
||||
As recorded on {{today}}.
|
||||
|
||||
## Introduction
|
||||
## Notes
|
||||
## Conclusions
|
||||
|
||||
Will prompt you to pick a page name (defaulting to “📕 “), and then create the following page (on 2022-08-08) when you pick “📕 Harry Potter” as a page name:
|
||||
|
||||
# 📕 Harry Potter
|
||||
As recorded on 2022-08-08.
|
||||
|
||||
## Introduction
|
||||
## Notes
|
||||
## Conclusions
|
||||
|
||||
### Snippets
|
||||
$snippets
|
||||
Snippets are similar to page templates, except you insert them into an existing page with the `/snippet` slash command. The default prefix is `snippet/` which is configurable via the `snippetPrefix` setting in `SETTINGS`.
|
||||
|
||||
Snippet templates do not support the `$name` page meta, because it doesn’t apply.
|
||||
|
||||
However, snippets do support the special `|^|` placeholder for placing the cursor caret after injecting the snippet. If you leave it out, the cursor will simply be placed at the end, but if you like to insert the cursor elsewhere, that position can be set with the `|^|` placeholder.
|
||||
|
||||
For instance to replicate the `/query` slash command as a snippet:
|
||||
|
||||
<!-- #query |^| -->
|
||||
|
||||
<!-- /query -->
|
||||
|
||||
Which would insert the cursor right after `#query`.
|
||||
|
||||
### Daily Note
|
||||
|
||||
The {[Open Daily Note]} command navigates (or creates) a daily note prefixed
|
||||
with a 📅 emoji by default, but this is configurable via the `dailyNotePrefix` setting in `SETTINGS`. If you have a page template (see above) named `templates/page/Daily Note` it will use this as a template, otherwise, the page will just be empty.
|
||||
|
||||
### Weekly Note
|
||||
|
||||
The {[Open Weekly Note]} command navigates (or creates) a weekly note prefixed
|
||||
with a 🗓️ emoji by default, but this is configurable via the `weeklyNotePrefix` setting in `SETTINGS`. If you have a page template (see above) named `templates/page/Weekly Note` it will use this as a template, otherwise, the page will just be empty.
|
||||
|
||||
### Quick Note
|
||||
|
||||
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
|
||||
|
||||
Currently supported (hardcoded in the code):
|
||||
|
||||
- `{{today}}`: Today’s date in the usual YYYY-MM-DD format
|
||||
- `{{tomorrow}}`: Tomorrow’s date in the usual YYY-MM-DD format
|
||||
- `{{yesterday}}`: Yesterday’s 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
|
|
@ -39,15 +39,11 @@ Note that a string is also a valid JSON value:
|
|||
|
||||
* [ ] #test This is a test task
|
||||
|
||||
<!-- #use [[template/tagged-tasks]] "test" -->
|
||||
* [ ] [[🔌 Directive@1340]] This is a test task #test
|
||||
<!-- /use -->
|
||||
So, a template can take, for instance a tag name as an argument:
|
||||
|
||||
which renders as:
|
||||
|
||||
<!-- #use [[template/tagged-tasks]] "test" -->
|
||||
* [ ] [[🔌 Directive@1537]] This is a test task #test
|
||||
<!-- /use -->
|
||||
<!-- #use [[template/tagged-tasks]] "test" -->
|
||||
* [ ] [[🔌 Directive@1537]] This is a test task #test
|
||||
<!-- /use -->
|
||||
|
||||
## Eval
|
||||
$eval
|
||||
|
|
|
@ -81,10 +81,10 @@ country: Germany
|
|||
|
||||
Example:
|
||||
<!-- #query data where age > 20 and country = "Italy" -->
|
||||
|name|age|city |country|page |pos|
|
||||
|----|--|-----|-----|------------|-|
|
||||
|John|50|Milan|Italy|🔌 Directive|0|
|
||||
|Jane|53|Rome |Italy|🔌 Directive|1|
|
||||
|name|age|city |country|page |pos|
|
||||
|----|--|-----|-----|------------------|-|
|
||||
|John|50|Milan|Italy|🔌 Directive/Query|0|
|
||||
|Jane|53|Rome |Italy|🔌 Directive/Query|1|
|
||||
<!-- /query -->
|
||||
|
||||
#### 4.2 Plugs’ data sources
|
||||
|
@ -129,6 +129,8 @@ For more information on the Handlebars syntax, you can read the
|
|||
|
||||
You just need to add the `render` keyword followed by the link of the template to the query like below:
|
||||
|
||||
<!-- #query page where type = "plug" render [[template/plug]] -->
|
||||
<!-- /query-->
|
||||
`#query page where type = "plug" render [[template/plug]]`
|
||||
|
||||
You can see the usage of our template in example 6.4 below.
|
||||
|
@ -138,49 +140,39 @@ You can see the usage of our template in example 6.4 below.
|
|||
We will walk you through a set of examples starting from a very basic one
|
||||
through one formatting the data using templates.
|
||||
|
||||
Our goal in this exercise is to (i) get all plug pages (ii) ordered by last
|
||||
modified time and (iii) display in a nice format.
|
||||
Our goal in this exercise is to (i) get all plug pages (ii) ordered by last modified time and (iii) display in a nice format.
|
||||
|
||||
For the sake of simplicity, we will use the `page` data source and limit the
|
||||
results not to spoil the page.
|
||||
For the sake of simplicity, we will use the `page` data source and limit the results not to spoil the page.
|
||||
|
||||
#### 6.1 Simple query without any condition
|
||||
|
||||
**Goal:** We would like to get the list of all pages.
|
||||
|
||||
**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.
|
||||
**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 10 -->
|
||||
|name |lastModified |perm|tags |type|uri |repo |author |
|
||||
|--|--|--|--|--|--|--|--|
|
||||
|SETTINGS |1665558946821|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
|Silver Bullet |1666964349821|rw|protip|undefined|undefined |undefined |undefined |
|
||||
|Sandbox |1665558946826|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
|🔌 Core |1666963501687|rw|undefined|plug|builtin:core |https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors|
|
||||
|CHANGELOG |1666959942128|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
|💡 Inspiration|1665558946820|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
|🔌 Mount |1665567345520|rw|undefined|plug|github:silverbulletmd/silverbullet-mount/mount.plug.json|https://github.com/silverbulletmd/silverbullet-mount|Zef Hemel |
|
||||
|🤯 Features |1665567345521|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
|🔌 Ghost |1665558946819|rw|undefined|plug|github:silverbulletmd/silverbullet-ghost/ghost.plug.json|https://github.com/silverbulletmd/silverbullet-ghost|Zef Hemel |
|
||||
|PUBLISH |1665558946821|rw|undefined|undefined|undefined |undefined |undefined |
|
||||
<!-- #query page limit 3 -->
|
||||
|name |lastModified |contentType |size|perm|
|
||||
|-------------|-------------|-------------|----|--|
|
||||
|SETTINGS |1667053645895|text/markdown|169 |rw|
|
||||
|Silver Bullet|1669379746803|text/markdown|6823|rw|
|
||||
|YAML |1669378903144|text/markdown|199 |rw|
|
||||
<!-- /query -->
|
||||
|
||||
|
||||
#### 6.2 Simple query with a condition
|
||||
|
||||
**Goal:** We would like to get all plug pages sorted by last modified time.
|
||||
|
||||
**Result:** Okay, this is what we wanted but there is also information such as
|
||||
perm, type and lastModified that we don't need.
|
||||
**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 |perm|size |contentType |type|repo |author |uri |
|
||||
|name |lastModified |contentType |size|perm|type|repo |author |uri |
|
||||
|--|--|--|--|--|--|--|--|--|
|
||||
|🔌 Directive |1666965349992|rw|13004|text/markdown|plug|https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors|undefined |
|
||||
|🔌 Core |1666963501687|rw|undefined|undefined |plug|https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors|builtin:core |
|
||||
|🔌 Mattermost|1665567345533|rw|undefined|undefined |plug|https://github.com/silverbulletmd/silverbullet-mattermost|Zef Hemel |github:silverbulletmd/silverbullet-mattermost/mattermost.plug.json|
|
||||
|🔌 Github |1665567345532|rw|undefined|undefined |plug|https://github.com/silverbulletmd/silverbullet-github |Zef Hemel |github:silverbulletmd/silverbullet-github/github.plug.json |
|
||||
|🔌 Backlinks |1665567345530|rw|undefined|undefined |plug|https://github.com/Willyfrog/silverbullet-backlinks |Guillermo Vayá |ghr:Willyfrog/silverbullet-backlinks |
|
||||
|🔌 Directive |1669382855582|text/markdown|2572|rw|plug|https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors| |
|
||||
|🔌 Github |1669302595740|text/markdown|2202|rw|plug|https://github.com/silverbulletmd/silverbullet-github|Zef Hemel |github:silverbulletmd/silverbullet-github/github.plug.json |
|
||||
|🔌 Core |1668787355449|text/markdown|3418|rw|plug|https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors|builtin:core |
|
||||
|🔌 Ghost |1667053645897|text/markdown|1071|rw|plug|https://github.com/silverbulletmd/silverbullet-ghost |Zef Hemel |github:silverbulletmd/silverbullet-ghost/ghost.plug.json |
|
||||
|🔌 Serendipity|1667053645897|text/markdown|1179|rw|plug|https://github.com/m1lt0n/silverbullet-serendipity |Pantelis Vratsalis |github:m1lt0n/silverbullet-serendipity/serendipity.plug.json|
|
||||
<!-- /query -->
|
||||
|
||||
#### 6.3 Query to select only certain fields
|
||||
|
@ -192,13 +184,13 @@ and `repo` columns and then sort by last modified time.
|
|||
from a visual perspective.
|
||||
|
||||
<!-- #query page select name author repo uri where type = "plug" order by lastModified desc limit 5 -->
|
||||
|name |author |repo |ri |
|
||||
|name |author |repo |ri|
|
||||
|--|--|--|--|
|
||||
|🔌 Directive |Silver Bullet Authors|https://github.com/silverbulletmd/silverbullet |undefined|
|
||||
|🔌 Core |Silver Bullet Authors|https://github.com/silverbulletmd/silverbullet |undefined|
|
||||
|🔌 Mattermost|Zef Hemel |https://github.com/silverbulletmd/silverbullet-mattermost|undefined|
|
||||
|🔌 Github |Zef Hemel |https://github.com/silverbulletmd/silverbullet-github |undefined|
|
||||
|🔌 Backlinks |Guillermo Vayá |https://github.com/Willyfrog/silverbullet-backlinks |undefined|
|
||||
|🔌 Directive |Silver Bullet Authors|https://github.com/silverbulletmd/silverbullet ||
|
||||
|🔌 Github |Zef Hemel |https://github.com/silverbulletmd/silverbullet-github||
|
||||
|🔌 Core |Silver Bullet Authors|https://github.com/silverbulletmd/silverbullet ||
|
||||
|🔌 Ghost |Zef Hemel |https://github.com/silverbulletmd/silverbullet-ghost ||
|
||||
|🔌 Serendipity|Pantelis Vratsalis |https://github.com/m1lt0n/silverbullet-serendipity ||
|
||||
<!-- /query -->
|
||||
|
||||
#### 6.4 Display the data in a format defined by a template
|
||||
|
@ -209,10 +201,10 @@ from a visual perspective.
|
|||
|
||||
<!-- #query page select name author repo uri where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
|
||||
* [[🔌 Directive]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Core]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Mattermost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-mattermost))
|
||||
* [[🔌 Github]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-github))
|
||||
* [[🔌 Backlinks]] by **Guillermo Vayá** ([repo](https://github.com/Willyfrog/silverbullet-backlinks))
|
||||
* [[🔌 Core]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Ghost]] by **Zef Hemel** ([repo](https://github.com/silverbulletmd/silverbullet-ghost))
|
||||
* [[🔌 Serendipity]] by **Pantelis Vratsalis** ([repo](https://github.com/m1lt0n/silverbullet-serendipity))
|
||||
<!-- /query -->
|
||||
|
||||
PS: You don't need to select only certain fields to use templates. Templates are
|
||||
|
@ -220,10 +212,8 @@ smart enough to get only the information needed to render the data. Therefore,
|
|||
the following queries are the same in terms of end result when using the
|
||||
templates.
|
||||
|
||||
```yaml
|
||||
<!-- #query page select name author repo uri where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
|
||||
```
|
||||
<!-- #query page select name author repo uri where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
|
||||
|
||||
```yaml
|
||||
<!-- #query page where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
|
||||
```
|
||||
and:
|
||||
|
||||
<!-- #query page where type = "plug" order by lastModified desc limit 5 render [[template/plug]] -->
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
---
|
||||
|
||||
The Emoji plug provides support for auto-completion of the `:emoji:` style syntax.
|
|
@ -3,6 +3,7 @@ type: plug
|
|||
uri: github:silverbulletmd/silverbullet-github/github.plug.json
|
||||
repo: https://github.com/silverbulletmd/silverbullet-github
|
||||
author: Zef Hemel
|
||||
share-support: true
|
||||
---
|
||||
|
||||
<!-- #include [[https://raw.githubusercontent.com/silverbulletmd/silverbullet-github/main/README.md]] -->
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
type: plug
|
||||
uri: github:bbroeksema/silverbullet-graphview/graphview.plug.json
|
||||
repo: https://github.com/bbroeksema/silverbullet-graphview
|
||||
author: Bertjan Broeksema
|
||||
---
|
||||
|
||||
<!-- #include [[https://raw.githubusercontent.com/bbroeksema/silverbullet-graphview/main/README.md]] -->
|
||||
# SilverBullet plug for showing a graph view of the documents
|
||||
|
||||
This plug aims to bring similar functionality as the Obsidian Graph view to
|
||||
Silver Bullet.
|
||||
|
||||
## Installation
|
||||
|
||||
Open (`cmd+k`) your `PLUGS` note in SilverBullet and add this plug to the list:
|
||||
|
||||
```yaml
|
||||
- github:bbroeksema/silverbullet-graphview/graphview.plug.json
|
||||
```
|
||||
|
||||
Then run the `Plugs: Update` command and off you go!
|
||||
|
||||
## Usage
|
||||
|
||||
Run the `Show Graph` command to open up the graph view. Zoom and pan is
|
||||
supported by scroll and pinch gestures with the mouse(pad).
|
||||
|
||||
## For offline development
|
||||
|
||||
To ease development of the visual part, the offline folder contains a copy of
|
||||
the html and custom javascritpt. As well as a simple graph model.
|
||||
|
||||
```bash
|
||||
$ cd offline
|
||||
$ python -m http.server
|
||||
```
|
||||
<!-- /include -->
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
share-support: true
|
||||
---
|
||||
|
||||
The Emoji plug provides support for various advanced Markdown features, specifically:
|
||||
|
||||
* {[Markdown Preview: Toggle]} preview
|
||||
* Sharing via the `file:` [[🔌 Share]] provider
|
|
@ -2,18 +2,32 @@ Silver Bullet at its core is bare bones in terms of functionality, most of its p
|
|||
|
||||
Plugs are an extension mechanism (implemented using a library called `plugos` that runs plug code on the server in a sandboxed v8 Deno web worker, and in the browser using web workers). Plugs can hook into SB in various ways: plugs can extend the Markdown parser and its syntax, define new commands and keybindings, respond to various events triggered either on the server or client side, as well as run recurring and background tasks. Plugs can even define their own extension
|
||||
mechanisms through custom events. Each plug runs in its own sandboxed
|
||||
environment and communicates with SB via _syscalls_ that expose a vast range of functionality. Plugs can be loaded, unloaded and updated without having to restart SB itself.
|
||||
environment and communicates with SB via _syscalls_ that expose a vast range of functionality. Plugs can be loaded, unloaded, and updated without having to restart SB itself.
|
||||
|
||||
## Directory
|
||||
<!-- #query page where type = "plug" order by name render [[template/plug]] -->
|
||||
* [[🔌 Backlinks]] by **Guillermo Vayá** ([repo](https://github.com/Willyfrog/silverbullet-backlinks))
|
||||
## Core plugs
|
||||
These plugs are distributed with Silver Bullet and are automatically enabled:
|
||||
<!-- #query page where type = "plug" and uri = null order by name render [[template/plug]] -->
|
||||
* [[🔌 Collab]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Core]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Directive]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Emoji]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Markdown]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Share]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
* [[🔌 Tasks]] by **Silver Bullet Authors** ([repo](https://github.com/silverbulletmd/silverbullet))
|
||||
<!-- /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/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))
|
||||
<!-- /query -->
|
||||
|
||||
## How to develop your own plug
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
---
|
||||
|
||||
The Share plug provides infrastructure for sharing pages outside of your space. It standardizes the {[Share: Publish]} (bound to `Cmd-s` or `Ctrl-s`) to publish the current page to all share providers specified under the `$share` key in [[Frontmatter]].
|
||||
|
||||
Specific implementations for sharing are implemented in other plugs, specifically:
|
||||
<!-- #query page where share-support = true render [[template/page]] -->
|
||||
* [[🔌 Github]]
|
||||
* [[🔌 Markdown]]
|
||||
* [[🔌 Collab]]
|
||||
<!-- /query -->
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
type: plug
|
||||
repo: https://github.com/silverbulletmd/silverbullet
|
||||
author: Silver Bullet Authors
|
||||
---
|
||||
|
||||
The Tasks plug implements a lot of the task support in Silver Bullet.
|
||||
|
||||
Tasks in Silver Bullet are written using semi-standard task syntax:
|
||||
|
||||
* [ ] This is a task
|
||||
|
||||
Tasks can also be annotated with [[🔌 Core/Tags]]:
|
||||
|
||||
* [ ] This is a tagged task #my-tag
|
||||
|
||||
You can _toggle_ a task state either by putting in an `x` or `X` inside the box, or by simply clicking/tapping on the box, alternatively you can use the {[Task: Toggle]} command to toggle the task you’re currently in.
|
||||
|
||||
Tasks can specify deadlines:
|
||||
|
||||
* [ ] This is due 📅 2022-11-26
|
||||
|
||||
When the cursor is positioned inside of a due date, the {[Task: Postpone]} command can be used to postpone the task for a certain period of time.
|
||||
|
||||
This metadata is extracted and available via the `task` query source to [[🔌 Directive/Query]]:
|
||||
|
||||
<!-- #query task where page = "{{page}}"" -->
|
||||
|name |done |page |pos|tags |deadline |
|
||||
|---------------------|-----|--------|---|------|----------|
|
||||
|This is a task |false|🔌 Tasks|245| | |
|
||||
|This is a tagged task|false|🔌 Tasks|319|my-tag| |
|
||||
|This is due |false|🔌 Tasks|605| |2022-11-26|
|
||||
<!-- /query -->
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
type: plug
|
||||
uri: github:silverbulletmd/silverbullet-twitter/twitter.plug.json
|
||||
repo: https://github.com/silverbulletmd/silverbullet-twitter
|
||||
author: Silver Bullet Authors
|
||||
---
|
||||
|
||||
<!-- #include [[https://raw.githubusercontent.com/silverbulletmd/silverbullet-twitter/main/README.md]] -->
|
||||
# SilverBullet for Twitter
|
||||
Currently the only thing this plug offers is unfurling links to tweets. To use, paste in a link to a Tweet like `https://twitter.com/zef/status/1547943418403295232`, then run the `Link: Unfurl` command and select `Tweet content` to "enrich" the tweet URL with the content of the linked tweet, e.g.
|
||||
|
||||
https://twitter.com/zef/status/1547687321679511552
|
||||
|
||||
Turns into:
|
||||
|
||||
[Zef Hemel](https://twitter.com/zef/status/1547687321679511552):
|
||||
> For those who missed my earlier posts on Silver Bullet: it’s my new powerful note taking/PKM app. Demo video from a user’s perspective: https://t.co/MKauSTcUG3 How it works technically (plugins all the way down): https://t.co/sqCkAa0pem Repo: https://t.co/rrxQdyxze1
|
||||
|
||||
## Installation
|
||||
|
||||
Open (`cmd+k`) your `PLUGS` note in SilverBullet and add this plug to the list:
|
||||
|
||||
```yaml
|
||||
- github:silverbulletmd/silverbullet-twitter/twitter.plug.json
|
||||
```
|
||||
|
||||
Then run the `Plugs: Update` command and off you go!
|
||||
<!-- /include -->
|
|
@ -1,7 +1,11 @@
|
|||
* **Powerful Markdown editor** at its core (powered by [CodeMirror](https://codemirror.net))
|
||||
* **Distraction-free** UI with [What You See is What You Mean](https://en.wikipedia.org/wiki/WYSIWYM) markdown editing.
|
||||
* **Future proof**: stores all notes in a regular folder with markdown files, no proprietary file formats. While SB uses an SQLite database for indexes, this database can be wiped and rebuilt based on your pages at any time. Your markdown files are the single source of truth.
|
||||
## Core features
|
||||
- **Free and open source**. Silver Bullet is [MIT licensed](https://github.com/silverbulletmd/silverbullet/blob/main/LICENSE.md).
|
||||
- **The truth is in the markdown.** Markdown is simply text files, stored on disk. Nothing fancy. No proprietary formats or lock in. While SB uses an (SQLite) database for indexing and caching some data, all of that can be rebuilt from its markdown source at any time. If SB would ever go away, you can still read your pages with any text editor.
|
||||
- [**Local first**](https://www.inkandswitch.com/local-first/): your content is under your own control.
|
||||
- **Single, distraction-free mode.** SB doesn’t have a separate view and edit mode. It doesn’t have a “focus mode.” You’re always in focused edit mode, why wouldn’t you?
|
||||
* **Run anywhere**: run it on your local machine, or install it on a server. You access it via your web browser (desktop or mobile), or install it as a PWA (giving it its own window frame and dock/launcher/dock icon).
|
||||
* **Keyboard oriented:** you can fully operate SB via the keyboard (on
|
||||
laptop/desktop machines as well as iPads with a keyboard).
|
||||
* **Extensible** through [[🔌 Plugs]]
|
||||
- **Keyboard oriented**. You can use SB fully using the keyboard, typin’ the keys.
|
||||
- **Extend it your way**. SB is highly extensible with [[🔌 Plugs]], and you can customize it to your liking and your workflows.
|
||||
|
||||
## Advanced
|
||||
* Make part of your page _dynamic_ using [[🔌 Directive]]s such as [[🔌 Directive/Query]]
|
||||
|
|
Loading…
Reference in New Issue