Commit Graph
428 Commits
Author SHA1 Message Date
Zef Hemel 65cd6e7585 Enhance language core tests with comprehensive pairs and ipairs validation
- Modified the `assertEqual` function to include a custom message for assertion failures.
- Added tests for empty tables and JavaScript arrays to verify correct behavior of `pairs` and `ipairs`.
- Implemented checks for mixed key types and ensured `ipairs` only iterates over numeric indices, validating the expected values.
2025-04-17 15:23:59 +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 487f6b7c9b Add stdLibPrefix constant and update SyncService logic
- Introduced a new `stdLibPrefix` constant in `constants.ts` for standard library paths.
- Updated the import statement in `sync_service.ts` to include `stdLibPrefix`.
- Modified the logic in `SyncService` to check for both `plugPrefix` and `stdLibPrefix` when validating names.
2025-04-15 09:58:24 +02:00
Zef Hemel e1a6643d9a Website documentation work 2025-04-06 21:49:15 +02:00
Zef Hemel b62cef6d92 Add tag definition and registration to ScriptEnvironment
- Introduced a new `TagDef` type to define tags with optional schema and metatable.
- Added `registerTag` method in `ScriptEnvironment` to register tags.
- Updated `indexSyscalls` to handle tag registration and enrich query results with tag metadata.
- Modified `queryLua` and `DataStore` to support an optional enricher function for enhanced data processing.
2025-04-04 16:56:27 +02:00
Zef Hemel b07823a53c Refactor pairs function for improved type handling
- Updated the `pairsFunction` to specify that keys can be of type `string` or `number`, enhancing type safety.
- Corrected a comment for clarity regarding key retrieval from plain JavaScript objects, ensuring accurate documentation.
2025-04-04 09:14:53 +02:00
Zef Hemel 3440217a88 Enhance tonumber function in Lua standard library
- Updated the `tonumber` function to support optional base conversion, allowing for binary, octal, decimal, hexadecimal, and base 36 inputs.
- Added validation for invalid bases and non-numeric strings.
- Introduced comprehensive tests for various `tonumber` scenarios in `language_core_test.lua` to ensure correct functionality.
2025-04-04 09:11:13 +02:00
Zef Hemel d9ff98e050 Enhance Lua function handling with promise support and update global object exposure
- Modified `luaCall` and `luaValueToJS` functions to handle promises, allowing asynchronous execution of JavaScript functions from Lua.
- Updated the `jsApi` to expose the global `globalThis` object instead of `window`, improving compatibility across different environments.
2025-03-31 17:44:55 +02:00
Zef Hemel bf8646d89d Biting the bullet: exposing the JS window object to Lua
- Added a convenience function for creating HTML widgets, streamlining widget creation.
- Enhanced the key retrieval logic in the pairs function to ensure it captures prototype keys correctly.
- Exposed the global window object in the jsApi for better access to DOM functions.
2025-03-31 15:51:02 +02:00
Zef Hemel 26a72ea8df Remove share functionality and related components, replaced with import and export infrastructure
- Deleted the `share` plug, including its associated files and YAML configuration.
- Removed references to share options and commands from the codebase.
- Cleaned up unused event listeners and functions related to sharing content.
2025-03-30 16:09:45 +02:00
Zef Hemel 453cb912d9 Refactor Lua built-in functions for improved type handling
- Updated `ipairsFunction` and `pairsFunction` to accept both `LuaTable` and array types, enhancing flexibility.
- Modified `eachFunction` to support arrays, ensuring consistent behavior across different data structures.
- Added type checks and adjusted key retrieval logic for better compatibility with JavaScript objects.
2025-03-30 15:03:57 +02:00
Zef Hemel 449c4da4c6 Implement YAML patching functionality and enhance tests
- Added `yaml.patch` syscall to apply patches to YAML strings using the new `applyPatches` function.
- Updated tests to cover a wider range of scenarios, including edge cases and preservation of comments and formatting.
- Refactored existing tests to utilize the new patching logic, ensuring comprehensive coverage of YAML operations.
2025-03-30 14:30:51 +02:00
Zef Hemel be86e53398 Implement new slash commands and enhance editor functionality
- Added slash commands for inserting today's, yesterday's, and tomorrow's dates.
- Introduced new admonition commands for notes and warnings.
- Implemented a table command for quick table insertion.
- Enhanced the `insertAtCursor` function to support a cursor placeholder option.
- Updated `getSelection` to return the selected text along with cursor positions.
- Added a new widget function to display linked tasks in the editor.
2025-03-30 13:03:57 +02:00
Zef Hemel c25a3bf0eb Fix string.find with plain = true 2025-03-29 22:07:31 +01:00
Zef Hemel 4d2299df41 Enhance page list caching logic in Client class
- Introduced checks for initial sync completion before updating the page list cache.
- Updated logic to fetch pages based on sync status and index plug availability.
- Added tagging for meta pages starting with "Library/" during direct fetch.
- Initialized empty tags array for file metadata in fileMetaToPageMeta function.
2025-03-29 15:48:49 +01:00
Zef Hemel 41559f1b06 Merge branch 'v2' of github.com:silverbulletmd/silverbullet into v2 2025-03-29 13:07:50 +01:00
Zef Hemel c2ab44699b Add back pageDecoration.disableTOC support 2025-03-29 13:07:21 +01:00
Zef Hemel 5b9122eb62 Fix very subtle Lua async bug 2025-03-28 18:25:47 +01: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 1703020a8a feat: Add logout option to client wipe functionality
- Add optional logout parameter to system.wipeClient

- Add new 'Clear Local Storage & Logout' command

- Update API to support logout parameter

- Clean up server code comments
2025-03-28 13:45:39 +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 96f299bf8a Shell streaming support (Lua) 2025-03-27 17:04:15 +01:00
Zef Hemel d08c8cef20 Fix plugs and plug updating 2025-03-26 19:42:51 +01:00
Zef Hemel 706588cd56 Bringing in config and config docs 2025-03-26 17:46:35 +01:00
Zef Hemel e6a45f213a Remove temporal 2025-03-25 18:55:27 +01:00
Zef Hemel 254d6e6379 Ripped out use of Deno KV and other unstable features 2025-03-24 20:21:17 +01:00
Zef Hemel 130b5b179a config.* syscalls 2025-03-24 17:44:09 +01:00
Zef Hemel e003e926d2 Progress 2025-03-23 15:56:02 +01:00
Zef Hemel c157e979f0 WIP 2025-03-23 12:48:25 +01:00
Zef Hemel 65e853e800 Temporarily add back in system.getSpaceConfig 2025-03-22 08:48:02 +01:00
Zef Hemel 55be05031c Markdown widget removal 2025-03-22 08:40:26 +01:00
Zef Hemel 63f7314256 index.tag simplification 2025-03-22 07:53:24 +01:00
Zef Hemel b1421dc030 Update table.find API 2025-03-21 16:48:30 +01:00
Zef Hemel d73d9b155f Further work 2025-03-21 16:12:10 +01:00
Zef Hemel 6e368619c5 Remove embeds 2025-03-21 16:12:10 +01:00
Zef Hemel 1284d15a8b Remove command buttons 2025-03-21 16:12:10 +01:00
Zef Hemel fa8f07a123 Kinda working 2025-03-21 16:12:10 +01:00
Zef Hemel d50ddc2357 First very rough pass of cleanup 2025-03-21 16:12:07 +01:00
Zef Hemel 701a3b1fb8 Query collection distinct 2025-03-21 16:11:00 +01:00
Zef Hemel a773d320f6 Lua: support distinct queries 2025-03-21 16:11:00 +01:00
Zef Hemel e6aa89020a Lua: table.find 2025-03-21 16:11:00 +01:00
Zef Hemel f4de6a4b85 Migrating core use of queryObjects to queryLuaObjects 2025-03-18 18:22:17 +01:00
Zef Hemel 0812ba8287 Added some convenience editor syscalls 2025-03-16 15:53:00 +01:00
Stan Ionitoiu-JanssenandGitHub d38e757cd6 fix(tables): only escape pipes outside SB context (#1292)
* fix(tables): only escape pipes outside SB context

Fixes #943

* fix(tables): detect command context in tables

Fixes #1016

* Added tests for parsing tables
2025-03-15 20:58:43 +01:00
Zef Hemel fdf6a97f97 Lua: expose all template.* syscalls 2025-03-15 20:52:34 +01:00
Zef Hemel dde532d1b6 Added silverbullet lua:repl command 2025-03-14 16:43:13 +01:00
Ohad LutzkyandGitHub cde2155ac3 Use writer to ensure the entire file is written (#1287)
Using file.write directly once doesn't guarantee the entire file is
written; see https://docs.deno.com/examples/writing_files/
2025-03-14 16:02:18 +01:00
Zef Hemel c85fb17145 Improved Lua string library 2025-03-14 15:56:53 +01:00
Zef Hemel 98befe3a33 Lua widget event support 2025-03-14 10:36:41 +01:00
Zef Hemel f514ef1b53 Lua: support passing Lua function callbacks to native JS functions 2025-03-14 10:02:25 +01:00