Commit Graph
50 Commits
Author SHA1 Message Date
Zef HemelandGitHub dc2987a3f9 Sync engine rearchitecture (#1516)
* Don't require auth for .ping
* Finally introducing loggers
* Remove file list caching from disk_space_primitives
I don't think this is required anymore with the sync model
* Simplification of space primitives and more tests
* More reliable online status
* Add .zed settings
* Remove selfUpdate argument from `writeFile` no longer used
- Add `sync` config schema and document sync options
- Move sync config handling to client boot logic
- Move BootConfig type to ui_types.ts
- Remove sync env vars from server
- Update documentation for sync and architecture
* Improve sync logic and proxy routing for full sync state
* Add BoxProxy for late-bound client and improve Lua boot
- Add isMobile syscall for editor
* Add concurrency to sync process and log indexing duration
* Better service worker lifecycle management
2025-09-12 14:43:57 +02:00
Alex DobinandGitHub 956b7a947f document editor.getCurrentLine() function (#1531) 2025-09-11 08:31:44 +02:00
Zef Hemel b85b090c30 Adding back slashCommand with different casing... 2025-09-03 08:15:42 +02:00
Zef Hemel 32ac93cd34 Delete old slashcommand to be replace 2025-09-03 08:15:26 +02:00
Zef Hemel a7b284938f Revert back slashcommand to slashCommand 2025-09-03 08:14:39 +02:00
Zef HemelandGitHub 554744c794 Update slashcommand.md 2025-09-02 20:34:05 +02:00
Zef HemelandGitHub 4ebea149dc Update slashcommand.md 2025-09-02 20:33:45 +02:00
Zef Hemel c74e878897 Shell command whitelisting and stdin support 2025-08-27 11:14:21 +02:00
aa0b95b31d The one about refs (#1496)
* [Major] Introduce a new `Ref` and `Path` type

This introduces a new `Ref` and `Path` type, which try to be as lightweight and rigorous as possible. More description in the PR

* [Minor] Updated Syntax

* [Minor] Updated Type

* [Minor] Renamed file

* [Minor] Updated type

* [Minor] Updated Syntax

* [Major] Rename css classes for wiki links

Previously all the parts of a wiki link were tagged with `sb-wiki-link-page`. This didn't make a whole lot of sense. Also the tag `sb-wiki-link` was could never render, because of the way `HighlightStyle` works. Now every part of a wiki link will be tagged with `sb-wiki-link` (i.e. the link, the alias, the dimensions). Invalid and missing links will be styled separately in a later commit.

* [Minor] Adjust to new API

* [Minor] Small changes

* [Minor] Function and file renames

* [Major] Syscall adjusments

Change behavior of `getCurrentPath` to actually return what's now considered a `Path`. `getCurrentPage(Meta)` now also correctly returns for documents. We could consider a rename to get rid of the `page` association

* [Major] Rework `Client`

Mostly minor adjustments for the new API. Some major changes in `navigateWithinPage` and some unecessary checks removed now

* [Major] Errors on navigate

This now throws an error when the user tries to navigate to a link that is invalid

* [Major] Minor adjustments and remove some old bulk

This does the typicall adjustments to the new API. A thing to consider is that invalid links aren't indexed. Also removed old code about template and query stuff. And reused a regex instead of copy pasting it.

* [Minor] Cleanup editor ui

* [Minor] Adjust to new API

* [Minor] Adjust to new API and reduce ugly regex

* [Minor] New API

* [Minor] Rework link cm plugin

* [Major] Rework wiki links

A lot of code cleanup, reworked for new APIs and also introduces "invalid links"

* [Minor] Part of the editor ui rework

* [Major] Adjust to new API

This also removes the `looksLikePathWithExtension` check. I don't think it was necessary.

* [Minor] PArt of editor ui rewrite

* [Minor] Adjust to new API

* [Major] Adjust renderer to new API

Invalid links now link to `#`

* [Major] Rewrite navigator

This still needs major rework, currently in a "got it working" state

* [Minor] Adjust file name

* [Minor] Mistake during rebase

* [Minor] Navigate to end of header

* [Minor] Remove `tweakEditorDOM` and use proper CM extensions

* [Major] Heavily clean up the navigation code

* [Minor] Make `PageNavigator` closable again

* [Minor] Small fixes to reduce errors bubbling up

* [Minor] Show error message if navigate fails

* [Major] Remove legacy `navigate({ kind = ` syntax

This removes the old navigation syntax. It's still supported but the user will be warned then using it. I also added some validation to editor.navigate for user provided refs.

* [Minor] Make notifications errors

* [Minor] Don't fail if header isn't found

* [Minor] Typo

* [Major] Remove cleanPageRef

* [Minor] Small bug

* [Minor] Align behavior between render and editor

* [Major] Remove `PageRef`. Pretty sure it's obsolete

* [Major] Remove pos from header as it's an invalid ref

* [Minor] Align with original behavior

* [Minor] Get tests working again

* [Minor] check that indexPage is valid

* [Major] Rewrite `resolve.ts` file

* [Minor] More tests, more fixes

* [Minor] Don't just append .md this is weird

* [Minor] More edge cases

* [Minor] Version bumping hono somehow fixes the `/` case

* [Minor] Smaller TODOs

* [Major] We can be a littler looser on the restrictions

* [Major] Change header indexing, to index with pos

* [Minor] More fixes for headers

* [Minor] Rename for clarity

* [Minor] Change more regexes to named groups

* [Major] Inline content rewrite

* [Minor] Fix TODO

* [Minor] Bump index version

* [Major] New Space Primitive to check paths

* [Minor] Fix #1214

* [Minor] Fix #1169

* [Minor] Remove TODO

This check is probably not needed anymore. Unsure. May look into it later

* [Minor] small bug

* [Minor] Not a good rebase without me needing to fix it afterwards

* [Minor] Improve fallback for file upload

* [Minor] Some fixes on the for resolving

* [Minor] Removed doubled test case

* [Minor] Resolve #860

* [Minor] Turn flash notification into an error

* [Minor] Change handling of `.` paths

* [Minor] Show empty URL for index page

* [Minor] Push correct ref to history

* [Major] Capture mini editor events in capture phase

This fixes the issue were when pressing arrowup or arrowdown changed the cursor position inside the editor

* [Major] Add prefix to `FilterList`

This now fixes issues were if you had a prefixed page you  con't properly search for it, because the search considered the prefix as part of the name

* [Minor] A little rigor for empty headers

* [Major] Fix #1404

* [Minor] `parseInt` returns `NaN` handle that

* [Minor] Use `fileName`

* [Minor] Fix comment

* [Minor] Fixes

* [Major] disallow `foo.png.md` and `/../`, etc. cases

* [Major] Change name of conflicted pages

* [Minor] Remove unecessary check

* [Minor] Remove some split code

* [Minor] Allow deletion of invalid files

* [Minor] Bug in the regex

* [Minor] Give some possibility of fixing incorrect names

* [Minor] Tiny bug with header completion

* [Major] Docs

* [Minor] Ignore errors for navigation inside of a page

This could be a problem when SB e.g. cached a scrollTop for a page, which, because e.g. the file is now deleted, doesn't exist anymore and thus CM throws an error, when trying to navigate

* Update conflicted copy regex in Maintenance.md

---------

Co-authored-by: Zef Hemel <zef@zef.me>
2025-08-24 16:16:19 +02:00
Zef Hemel c16dbc12fb [Lua] Adds some useful encoding APIs for Lua (base64 encoding and decoding and such). 2025-08-20 13:39:34 +02:00
Zef Hemel a321339e9a Fixes #1495
Renames sync.* syscalls to be more accurate, specifically that this is not about scheduling a sync but actually performing the sync.
2025-08-20 10:58:30 +02:00
MrMugameandGitHub 98cff15235 Make stripIndent an option for template.new (#1473) 2025-07-26 20:34:32 +02:00
MrMugameandGitHub 6a7a9ebc85 Adds missing doc for syscalls (#1452)
* Add missing syscall documentation

* Add missing space lua documentation
2025-07-09 10:37:34 +02:00
Zef Hemel e98b27c830 Content improvements 2025-06-17 18:46:15 +02:00
Zef Hemel fbf2e4bc45 Rename system.invokeCommand syscall to editor.invokeCommand 2025-06-17 10:55:51 +02:00
Zef Hemel aff178bd78 Fix index.defineTag after refactor 2025-06-17 10:46:38 +02:00
Zef Hemel 10f6efe0ad Significant refactor of command, slashcommand and config handling, removal of "shortcuts" 2025-06-16 17:08:04 +02:00
Zef Hemel 1910ffce3e Index handling refinements 2025-06-12 13:52:13 +02:00
Marek S. ŁukasiewiczandGitHub f2f4937854 Utility function to handle empty query results and templates (#1386)
* Add global Lua function 'some'

Moved documentation for 'each' function to non-standard section.

* Revert "Add optional argument to template.each for empty collection output (#1359)"

This reverts commit b73dadec67.

* Reimplement #1359 using 'some' function
2025-05-12 07:33:49 +02:00
wbhoustonandGitHub c0f68f0906 Add notes on Space Lua Pattern Matching (#1366) 2025-05-02 07:36:04 +02:00
Marek S. ŁukasiewiczandGitHub b73dadec67 Add optional argument to template.each for empty collection output (#1359)
When omitted, the function outputs empty string for empty table as before.
The feature was motivated by the Maintenance page in v1 that showed messages
instead of just empty blocks (ported over).
2025-04-30 11:01:39 +02:00
Marek S. ŁukasiewiczandGitHub b9488b45c8 Fix table constructor in editor.filterBox example (close #1344) (#1360)
Also added description field from FilterOption, others didn't seem relevant
2025-04-30 11:01:00 +02:00
Marek S. ŁukasiewiczandGitHub 971e19f591 Add Lua features for integers (#1363)
* Parse hexadecimal numeric constants in Lua

Fix lua grammar to not require a "+" after "e" in numbers.
Add tests for parsing correct number value.

* Implement bitwise operators in Lua

They throw an error when called on fractional values,
like Lua 5.4 but with a hint to round them manually.
2025-04-30 10:58:45 +02:00
Zef Hemel 3356a3bc5f Update Datastore API documentation to reflect key format changes from string to list for keys in set, get, and delete operations. 2025-04-28 18:52:09 +02:00
Zef Hemel 34557e0575 Update documentation for consistency and clarity
- Revised multiple documentation files to correct references and improve clarity, including updates to the Command Palette, Document Editor, and various Markdown files.
- Removed outdated references to "Slash Templatese" and replaced them with "Slash Templates" for consistency.
- Enhanced explanations regarding meta pages and shortcuts, ensuring accurate guidance for users.
2025-04-17 12:04:20 +02:00
Zef Hemel 2ac30edb2f Update configuration documentation and remove deprecated templates
- Enhanced the `Config.md` documentation to clarify built-in configuration options and the use of the `config.set` API.
- Removed outdated `Page Template.md` and `Slash Template.md` files to streamline documentation and avoid confusion.
- Updated references in various documentation files to reflect the removal of deprecated templates and ensure consistency across the site.
2025-04-17 11:55:09 +02:00
Zef Hemel e1a6643d9a Website documentation work 2025-04-06 21:49:15 +02:00
Zef Hemel 4b52da3d86 Missing API docs 2025-04-03 18:09:51 +02:00
Zef Hemel db62692d5a - Start of a migration guide
- Included a warning at the top of the SilverBullet documentation indicating that it is for version 2, which is still in progress.
- Provided a link to version 1 for users preferring a stable version and included a note about active development on v2.
2025-03-30 21:21:33 +02:00
Zef Hemel 45b767fd3c Lua widgets: html can now also be a DOM node
Encoding some more space lua priorities and documenting them
2025-03-28 17:38:32 +01:00
Zef Hemel 64e537732b Debug: Reset Client is now called System: Wipe Client
Merged two datastores into one (for both state and files), this will trigger a resync on upgrade
2025-03-28 12:17:17 +01:00
Zef Hemel 6e551cd245 Lua: cron:secondPassed event 2025-03-21 17:38:25 +01:00
Zef Hemel b1421dc030 Update table.find API 2025-03-21 16:48:30 +01:00
Zef Hemel fa8f07a123 Kinda working 2025-03-21 16:12:10 +01:00
Zef Hemel e6aa89020a Lua: table.find 2025-03-21 16:11:00 +01:00
Zef Hemel bafd2974e1 Lua API docs update 2025-03-18 18:20:49 +01:00
MrMugameandGitHub e61a447d98 Implementing #913 (#1230)
Implemented custom editors
2025-03-06 15:11:17 +01:00
KitAmbraidandGitHub 31792a3a43 space lua: os.date add support for %U, %V and %W (#1250) 2025-02-22 12:00:54 +01:00
Zef Hemel 5111b5a380 http.request Lua syscall 2025-02-13 21:12:00 +01:00
Zef Hemel fb7be2a45a Changelog updates and Lua fixes 2025-02-09 18:37:21 +01:00
Zef Hemel 8eebb8dd67 Expose index.extractFrontmatter as syscall 2025-02-07 15:39:51 +01:00
Zef Hemel a169406d37 Lua: huge API breaking change: converted all snake_case APIs to camelCase 2025-02-06 10:04:45 +01:00
Zef Hemel 41d5743673 Load .lua files with dofile 2025-01-19 16:23:08 +01:00
Zef Hemel 6078452a6c Breaking Lua API changes:
* tpl -> template.new
* define_command -> command.define
* define_event_listener -> event.listen
* tag -> index.tag

Updated in the docs
2025-01-19 14:32:11 +01:00
Zef Hemel 72b4ecdc36 Blacklist shell syscalls in Lua for now (security) 2025-01-19 13:02:01 +01:00
Zef Hemel 83550c1623 Exposing Objects indexing as syscalls 2025-01-17 10:41:02 +01:00
Zef Hemel b398a6b2ff Docs fixes 2025-01-16 20:52:30 +01:00
Zef Hemel 38983b49c5 AI generated API docs 2025-01-16 20:41:52 +01:00
Zef Hemel 8b2e76ee51 Lua API docs 2025-01-16 20:05:13 +01:00
Zef Hemel 5604f6d8c2 Lua: tweaks and docs 2025-01-14 20:26:47 +01:00