1
0
Fork 0
mirror of https://github.com/silverbulletmd/silverbullet.git synced 2026-02-13 15:04:01 +00:00
No description
Find a file
Matouš Jan Fialka e0182b3bb4
[Space Lua] Implement native Lua pattern matching engine (#1838)
* Add Lua *pattern matching engine* (`pattern.ts`) that directly ports
  `lstrlib.c` semantics.

* Integrate the new engine into the `string` API for `find`, `match`,
  `gmatch`, and `gsub` functions.

* Add a pattern test suite (`pattern_test.lua`) covering character
  classes, repetition quantifiers, edge cases as well as error
  conditions.

* Refactor `string_test.lua` to remove duplicated pattern tests that
  are now covered by the pattern test suite.

* Fix `string.rep` separator support.

* Fix `string.sub` index handling.

* Remove the obsolete `string_test2.lua` file.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-02-13 14:18:55 +01:00
.githooks Added git hook that does some sanity checking 2025-03-18 18:29:46 +01:00
.github Fix docker builds 2026-02-06 14:49:20 +01:00
.helix Add config for Helix editor (#1200) 2025-01-04 06:59:12 +01:00
.vscode Ripped out use of Deno KV and other unstable features 2025-03-24 20:21:17 +01:00
.zed Sync engine rearchitecture (#1516) 2025-09-12 14:43:57 +02:00
bench Add Space Lua benchmarks based on Deno.bench aligned to Deno.test (#1649) 2025-11-05 15:06:33 +01:00
bin Swap out @luca/esbuild-deno-loader with "official" deno ES build loader (fixes building with Deno 2.6.5+ versions) 2026-02-06 08:12:11 +01:00
client [Space Lua] Implement native Lua pattern matching engine (#1838) 2026-02-13 14:18:55 +01:00
client_bundle Move built client files to client_bundle folder to make embedding them into the server binary cleaner. 2025-09-25 09:51:05 +02:00
libraries Honor openIfExists: true when using Page: From Template command (#1831) 2026-02-12 11:18:03 +01:00
plug-api Add validation and error handling for object indexing 2026-02-03 15:59:04 +01:00
plugs Revert removal of item's toPos 2026-02-12 11:06:20 +01:00
scripts Reorganized keyboard shortcuts a little bit and documented them. 2026-01-21 11:01:11 +01:00
server Some authentication fixes (#1804) 2026-01-31 17:07:35 +01:00
website Vim mode binding collision documentation (#1827) 2026-02-08 15:22:30 +01:00
.air.toml Let air also rebuild on .yaml files 2026-01-21 09:22:13 +01:00
.gitignore Let air also rebuild on .yaml files 2026-01-21 09:22:13 +01:00
build_client.ts Swap out @luca/esbuild-deno-loader with "official" deno ES build loader (fixes building with Deno 2.6.5+ versions) 2026-02-06 08:12:11 +01:00
build_deps.ts Swap out @luca/esbuild-deno-loader with "official" deno ES build loader (fixes building with Deno 2.6.5+ versions) 2026-02-06 08:12:11 +01:00
build_plug_compile.ts Swap out @luca/esbuild-deno-loader with "official" deno ES build loader (fixes building with Deno 2.6.5+ versions) 2026-02-06 08:12:11 +01:00
build_plugs_libraries.ts Retain timezone in system.getVersion() date-time (#1828) 2026-02-07 07:08:39 +01:00
CHANGELOG.md Work on #10 theming 2022-08-02 14:40:04 +02:00
CONTRIBUTING.md v1 code contribution guidelines 2026-01-14 09:29:39 +01:00
deno.json Space Lua: Align numeric/table semantics with Lua, align number formating, optimize loops allocations (#1823) 2026-02-12 15:22:12 +01:00
deno.lock Space Lua: Align numeric/table semantics with Lua, align number formating, optimize loops allocations (#1823) 2026-02-12 15:22:12 +01:00
docker-entrypoint.sh Fixes #1568 2025-09-28 17:24:25 +02:00
Dockerfile Fix docker builds 2026-02-06 14:49:20 +01:00
Dockerfile.ci Fix docker builds 2026-02-06 14:49:20 +01:00
Dockerfile.website Switch silversearch to edge build 2025-12-10 10:11:26 +01:00
go.mod Prometheus metrics support 2025-10-27 17:21:50 +01:00
go.sum Prometheus metrics support 2025-10-27 17:21:50 +01:00
LICENSE.md Refactor of asset bundles 2022-10-12 11:47:13 +02:00
Makefile Fix docker builds 2026-02-06 14:49:20 +01:00
README.md Adding LLM use link to README 2026-01-16 08:12:04 +01:00
silverbullet.go Move built client files to client_bundle folder to make embedding them into the server binary cleaner. 2025-09-25 09:51:05 +02:00
STYLE.md Website docs refactoring (Lua, mostly) 2026-02-04 17:03:55 +01:00
version.ts 2.4.1 2026-01-16 13:07:53 +01:00

GitHub Repo stars Docker Pulls GitHub Downloads (all assets, all releases) GitHub contributors

SilverBullet

SilverBullet is a Programmable, Private, Browser-based, Open Source, Self Hosted, Personal Knowledge Management Platform.

Yowza! That surely is a lot of adjectives to describe a browser-based Markdown editor programmable with Lua.

Lets get more specific.

In SilverBullet you keep your content as a collection of Markdown Pages (called a Space). You navigate your space using the Page Picker like a traditional notes app, or through Links like a wiki (except they are bi-directional).

If you are the writer type, youll appreciate SilverBullet as a clean Markdown editor with Live Preview. If you have more of an outliner personality, SilverBullet has Outlining tools for you. Productivity freak? Have a look at Tasks. More of a database person? You will appreciate Objects and Queries.

And if you are comfortable programming a little bit — now were really talking. You will love dynamically generating content with Space Lua (SilverBullets Lua dialect), or to use it to create custom Commands, Page Templates or Widgets.

Much more detail can be found on silverbullet.md

Installing SilverBullet

Check out the instructions.

Developing SilverBullet

SilverBullet's frontend is written in TypeScript and built on top of the excellent CodeMirror 6 editor component. Additional UI is built using Preact. ESBuild) running through Deno is used to build both the front-end.

The server backend is written in Go.

If you're considering contributing changes, be aware of the LLM use policy.

Code structure

  • client/: The SilverBullet client, implemented with TypeScript
  • server/: The SilverBullet server, written in Go
  • plugs: Set of built-in plugs that are distributed with SilverBullet
  • libraries: A set of libraries (space scripts, page templates, slash templates) distributed with SilverBullet
  • plug-api/: Useful APIs for use in plugs
    • lib/: Useful libraries to be used in plugs
    • syscalls/: TypeScript wrappers around syscalls
    • types/: Various (client) types that can be references from plugs
  • bin
    • plug_compile.ts the plug compiler
  • scripts/: Useful scripts
  • website/: silverbullet.md website content

Requirements

  • Deno: Used to build the frontend and plugs
  • Go: Used to build the backend

It's convenient to also install air for development, this will automatically rebuild both the frontend and backend when changes are made:

go install github.com/air-verse/air@latest

Make sure your $GOPATH/bin is in your $PATH.

To build everything and run the server:

air <PATH-TO-YOUR-SPACE>

Alternatively, to build:

make

To run the resulting server:

./silverbullet <PATH-TO-YOUR-SPACE>

Useful development tasks

# Clean all generated files
make clean
# Typecheck and lint all code
make check
# Format all code
make fmt
# Run all tests
make test

Build a docker container

Note, you do not need Deno nor Go locally installed for this to work:

docker build -t silverbullet .

To run:

docker run -p 3000:3000 -v <PATH-TO-YOUR-SPACE>:/space silverbullet