1
0

Docs update

This commit is contained in:
Zef Hemel 2022-07-16 10:18:31 +00:00
parent 8862f314ec
commit 081db983db
4 changed files with 50 additions and 12 deletions

View File

@ -23,6 +23,7 @@ Here are some things to try:
* Start typing `:party` to trigger the emoji picker 🎉
* Type `/` somewhere in the text to invoke a **slash command**.
* 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).
## Explore more
Click on the links below to explore various aspects of Silver Bullet more in-depth:
@ -42,7 +43,7 @@ More of a video person? Heres two to get you started:
Some core principles that underly Silver Bullets 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.
* **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.
* **What you see is what it is.** No magic or hidden content.
* **Single, distraction free mode.** SB doesnt have a separate view and edit mode. It doesnt have a “focus mode.” Youre always in focused edit mode, why wouldnt you?
* **Keyboard oriented**. You can use SB fully using the keyboard, typin the keys.

View File

@ -1,3 +1,3 @@
Inspiration for Silver Bullet comes primarily from [Obsidian](https://obsidian.md/) and its various plugs (the work-in-progress plugs around querying and tasks are inspired by Obsidians tasks and dataview plugins), but also [Roam Research](https://roamresearch.com/) was an inspiration.
Inspiration for Silver Bullet comes primarily from [Obsidian](https://obsidian.md/) and its vast plug-in ecosystem (the work-in-progress plugs around querying and tasks are inspired by Obsidians tasks and dataview plugins), but also [Roam Research](https://roamresearch.com/) was an inspiration.
Why start something new? Neither of these tools are open source, and they make some different choices, specifically on how extensibility is implemented — more on the differences some time in the future.
The way plugs are implemented, is a further iteration on how this was done in a previous project of mine (now defunct) called [Zed](https://github.com/zedapp/zed) as well as [Matterless](https://github.com/zefhemel/matterless).

View File

@ -19,3 +19,44 @@ Examples of functionality implemented as plugs:
* Data objects embedded in your pages
* Git integration
* Github integration
## How to develop your own plug
At this stage, to get started, its probably easiest to fork one of the existing plugs found in the [SilverBullet github org](https://github.com/silverbulletmd), for instance the [github one](https://github.com/silverbulletmd/silverbullet-github).
Generally, every plug consists of a YAML manifest file named `yourplugname.plug.yml`. Its convenient to have a `package.json` file in your repo to add any dependencies. One dev dependency you will definitely need is [@plugos/plugos](https://www.npmjs.com/package/@plugos/plugos) which will supply you with the `plugos-bundle` command, which is used to “compile” your plug YAML file into its bundled `.plug.json` form, which Silver Bullet will be able to load and execute.
Generally, the way to invoke `plugos-bundle` is as follows:
plugos-bundle yourplugname.plug.yaml
This will write out a `yourplugname.plug.json` file into the same folder. For development its convenient to add a `-w` flag to automatically recompile when changes to the YAML or source files are detected.
In order to keep bundles somewhat small, a few dependencies come prebundled with SB. A the time of this writing:
* `yaml` (a YAML reader and stringifier library)
* `@lezer/lr` (a parser library)
* `handlebars`
If you use any of these, you can add e.g. `--exclude handlebars` to _not_ have them be included in the bundle (they will be loaded from SB itself).
Once you have a compiled `.plug.json` file you can load it into SB in a few ways by listing it in your spaces `PLUGS` page.
For development its easiest to use the `file:` prefix for this, by adding this in the `yaml` block section there to your existing list of plugs:
- file:/home/me/git/yourplugname/yourplugname.plug.json
Reload your list of plugs via the `Plugs: Update` command (`Cmd-Shift-p` on Mac, `Ctrl-Shift-p` on Linux and Windows) to load the list of plugs from the various sources on the server and your browser client. No need to reload the page, your plugs are now active.
Once youre happy with your plug, you can distribute it in various ways:
* You can put it on github by simply committing the resulting `.plug.json` file there and instructing users to point to by adding `- github:yourgithubuser/yourrepo/yourplugname.plug.json` to their `PLUGS` file
* You can put it on any other web server, and tell people to load it via https, e.g. `- https://mydomain.com/mypugname.plug.json`.
### Recommended development workflow
I develop plugs as follows: in one terminal I have `plugos-bundle -w` running at all times, constantly recompiling my code as I change it.
I also have SB open with a `file:` based link in my `PLUGS` file.
Whenever I want to test a change, I switch to SB, hit `Cmd-Shift-p` and test if stuff works.
Often I also have the `Debug: Show Logs` command running to monitor both server and client logs for any errors and debug information.

View File

@ -1,10 +1,6 @@
* **Free and open source** (MIT licensed)
* **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 a 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.
* **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):
* Switch between pages using `Cmd-k` (Mac) or `Ctrl-k` (Linux/Windows)
* Open the command palette using `Cmd-/` (Mac) or `Ctrl-/` (Linux/Windows)
* Use slash commands by entering a `/` in your notes text
* Various plugs add additional keyboard shortcuts and auto completions like when entering `[[page links]]` and typing emoji via the `:lemon:` syntax.
* **Extensible** through plugs (see below)
* **Keyboard oriented:** you can fully operate SB via the keyboard (on laptop/desktop machines as well as iPads with a keyboard).
* **Extensible** through [[🔌 Plugs]]