Move to website folder

pull/20/head
Zef Hemel 2022-07-15 14:59:47 +02:00
parent 7a86c4ef56
commit 307bd3be7a
17 changed files with 73 additions and 69 deletions

5
.gitignore vendored
View File

@ -10,5 +10,6 @@ generated
*.test.js
*.js.map
.vscode
website
data.db
website_build
data.db
/index.json

View File

@ -1 +0,0 @@
2.7.18

View File

@ -1,40 +0,0 @@
# Silver Bullet
Silver Bullet (SB) is a highly extensible, open source **personal knowledge playground**. At its core its a Markdown-based writing/note taking application 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. This makes it a simple tool for [Personal Knowledge Management](https://en.wikipedia.org/wiki/Personal_knowledge_management). However, once you leverage its various extensions (called _plugs_) it can feel more like a _knowledge playground_, allowing you to annotate, combine and query your accumulated knowledge in creative ways, specific to you.
So what is it SB _really_? That is hard to answer. It can do a ton of stuff out of the box, and Im constantly finding new use cases. Its like... a silver bullet!
Heres how I use it today (but this has grown significantly over time):
* Basic note taking, e.g. meeting notes, notes on books I read, blogs I read, podcasts I listen to, movies I watch.
* Getting a quick glance at the work people in my team are doing by pulling data from our 1:1 notes, recent activity on Github (such as recent pull requests) and other sources.
* Writing:
* [My blog](https://zef.plus) is published via SBs [Ghost](https://ghost.org) plugin.
* An internal newsletter that I write is written in SB.
* Performance reviews for my team (I work as a people manager) are written and managed using SB (for which I extensively use SBs meta data features and query that data in various ways).
* A custom SB plugin aggregates data from our OpsGenie account every week, and publishes it to our [Mattermost](https://mattermost.com/) instance.
* It powers part of my smart home: I wired HomeBridge webhooks up to custom HTTP endpoints exposed by my custom smart home SB plug.
Thats a pretty crazy wide range of use cases!
I know, right?
**Disclaimer:** Silver Bullet is under heavy development and significant changes under the hood happen constantly. Its also low on automated tests and documentation. All this will improve over time. Ill do better, I promise.
[[🤯 Features]]
[[💡 Inspiration]]
[[🔌 Plugs]]
[[🔨 Development]]
[[🗺 Roadmap]]
## Proposals
[[Mounts]]
## Installing and running Silver Bullet
To run a release version, you need to have a recent version of npm (8+) and node.js (16+) installed as well as some basic build infrastructure (make, cpp). Silver Bullet has only been tested on MacOS and Linux thus far.
To install and run, create a folder for your pages (can be empty or an existing folder with `.md` files) and run:
npx @silverbullet/server <path-to-folder>
Optionally you can use the `--port` argument to specify a HTTP port (defaults to `3000`) and you can pass a `--password` flag to require a password to access. Note this is a rather weak security mechanism, so its recommended to add additional layers of security on top of this if you run this on a public server somewhere (at least add TLS). Personally I run it on a tiny Linux VM on my server at home, and use a VPN (Tailscale) to access it from outside my home.

View File

@ -1,15 +0,0 @@
Some things I want to work on:
* [ ] Persistent recent commands (saved between sessions)
* [x] Add ==marker== syntax
* [x] Two finger tap gesture to bring up command palette
* [ ] Change indent level command
* [ ] Keyboard shortcuts for specific notes (e.g. `index` note)
* [ ] RevealJS slides plug
* [ ] Pinned notes and actions?
* [x] Template for deadline, with 📅 emoji and perhaps defaulting to today?
* [ ] Data store pagination API
* [ ] Extract `MarkdownEditor` component.
* REST API safeguards:
* [ ] PUT page with `If-Last-Modified-Before` type header. Rejects if not matching. Client creates a revision, navigates to it.
* [ ] Put retries exponential back off

View File

@ -0,0 +1,25 @@
import { readYamlPage } from "./yaml_page";
// Read SECRETS page and retrieve specific set of secret keys
// Note: in this implementation there's no encryption employed at all so it's just a matter
// of not decising this SECRETS page to other places
export async function readSecrets(keys: string[]): Promise<any[]> {
try {
let allSecrets = await readYamlPage("SECRETS", ["yaml", "secrets"]);
let collectedSecrets: any[] = [];
for (let key of keys) {
let secret = allSecrets[key];
if (secret) {
collectedSecrets.push(secret);
} else {
throw new Error(`No such secret: ${key}`);
}
}
return collectedSecrets;
} catch (e: any) {
if (e.message === "Page not found") {
throw new Error(`No such secret: ${keys[0]}`);
}
throw e;
}
}

View File

@ -1,12 +1,12 @@
#!/bin/sh
npm run clean-build
rm -rf website
mkdir -p website/fs/_plug
cp -r packages/web/dist/* website/
cp _redirects _headers website/
cp -r docs/* website/fs/
cp packages/plugs/dist/* website/fs/_plug/
find website/fs/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \;
find website/fs/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \;
node scripts/generate_fs_list.js > website/index.json
#npm run clean-build
rm -rf website_build
mkdir -p website_build/fs/_plug
cp -r packages/web/dist/* website_build/
cp _redirects _headers website_build/
cp -r website/* website_build/fs/
cp packages/plugs/dist/* website_build/fs/_plug/
find website_build/fs/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \;
find website_build/fs/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \;
node scripts/generate_fs_list.js > website_build/index.json

View File

@ -12,7 +12,7 @@ async function getFiles(dir) {
return Array.prototype.concat(...files);
}
const rootDir = resolve("website/fs");
const rootDir = resolve("website_build/fs");
getFiles(rootDir).then((files) => {
files = files

View File

@ -1,3 +1,5 @@
This is currently implemented in [this github repo](https://github.com/silverbulletmd/silverbullet-mount):
Space mounting in `MOUNTS`
```yaml

31
website/index.md Normal file
View File

@ -0,0 +1,31 @@
# Silver Bullet
## Markdown as a platform
Silver Bullet (SB) is a highly extensible, open source **personal knowledge playground**. At its core its a Markdown-based writing/note taking application 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. This makes it a simple tool for [Personal Knowledge Management](https://en.wikipedia.org/wiki/Personal_knowledge_management). However, once you leverage its various extensions (called _plugs_) it can feel more like a _knowledge playground_, allowing you to annotate, combine and query your accumulated knowledge in creative ways, specific to you.
What does Silver Bullet look like? Well, have a look around. **Youre looking at it at this very moment!** Feel free to make some edits, to get a feel for it. Dont worry, you wont break anything, nothing is saved (just reload the page to see).
## Explore more
Click on the links below to explore various of Silver Bullet more in-depth:
[[🤯 Features]]
[[💡 Inspiration]]
[[🔌 Plugs]]
[[🔨 Development]]
[[🗺 Roadmap]]
More of a video person? Heres two to get you started:
* [A Tour of Silver Bullets features](https://youtu.be/RYdc3UF9gok) — spoiler alert: its cool.
* [A look the SilverBullet architecture](https://youtu.be/mXCGau05p5o) — spoiler alert: its plugs all the way down.
## Installing and running Silver Bullet
Like what youre seeing? Install it yourself locally or on your server! Its free.
To run a release version, you need to have a recent version of [node.js installed](https://nodejs.org/en/) (16+) as well as some basic build infrastructure (make, cpp). Silver Bullet has only been tested on MacOS and Linux thus far.
To install and run, create a folder for your pages (can be empty or an existing folder with `.md` files) and run:
npx @silverbullet/server <path-to-folder>
Optionally you can use the `--port` argument to specify a HTTP port (defaults to `3000`) and you can pass a `--password` flag to require a password to access. Note this is a rather weak security mechanism, so its recommended to add additional layers of security on top of this if you run this on a public server somewhere (at least add TLS). Personally I run it on a tiny Linux VM on my server at home, and use a VPN (Tailscale) to access it from outside my home.

1
website/🗺 Roadmap.md Normal file
View File

@ -0,0 +1 @@
This is very much in progress, have a look at our [Github Issues](https://github.com/silverbulletmd/silverbullet/issues) page if youd like to help out!