initial commit

This commit is contained in:
Guillermo Vaya
2022-07-24 01:25:20 +02:00
commit ad5e9efddf
7 changed files with 11636 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.plug.json
node_modules

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
18

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# SilverBullet plug for saying hello to the user
A well behaved plug that will greet your users.
## Wait, SilverBullet?
If you don't know what it is, check its [webpage](https://silverbullet.md), but if
you want me to spoil the fun: it is an extensible note taking app with markdown and plain files at its core
(well... there is a bit of magic in there too, but what good it would be without a little magic?)
## Installation
Open (`cmd+k`) your `PLUGS` note in SilverBullet and add this plug to the list:
```yaml
- https://github.com/Willyfrog/silverbullet-plug-example/releases/download/v0.1/helloworld.plug.json
```
Then run the `Plugs: Update` command and off you go!
## What's with all that Lone Ranger quotes
Don't you know that the [Lone Ranger used silver bullets to solve all the problems](https://en.wikipedia.org/wiki/Silver_bullet#Lone_Ranger)?

12
hello.ts Normal file
View File

@@ -0,0 +1,12 @@
import { flashNotification } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
const loneRangerQuotes = [
"Hi-Yo! Silver",
"Hi-Yo! Silver! Away!",
"Kemo Sabe",
"Get-um up, Scout!",
];
export async function helloWorld() {
flashNotification(loneRangerQuotes[Math.floor(Math.random() * loneRangerQuotes.length)]);
}

7
helloWorld.plug.yaml Normal file
View File

@@ -0,0 +1,7 @@
name: hello-world
version: 0.1
functions:
helloWorld:
path: "./hello.ts:helloWorld"
command:
name: "Say hello"

11574
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

16
package.json Normal file
View File

@@ -0,0 +1,16 @@
{
"name": "hello_world",
"version": "0.0.1",
"author": "A Lone Ranger",
"scripts": {
"build": "plugos-bundle --exclude yaml handlebars @lezer/lr -- helloWorld.plug.yaml",
"start": "plugos-bundle -w --exclude yaml handlebars @lezer/lr -- helloWorld.plug.yaml"
},
"dependencies": {
"@silverbulletmd/plugos-silverbullet-syscall": "^0.0.26",
"@silverbulletmd/plugs": "^0.0.26"
},
"devDependencies": {
"@plugos/plugos": "^0.0.26"
}
}