Commit Graph
53 Commits
Author SHA1 Message Date
Zef Hemel 93333edf65 Two new page templates: page template and slash template 2025-09-12 16:03:13 +02:00
Zef Hemel 7e337f2c6c Clean up Std tasks and tags 2025-09-12 15:18:38 +02:00
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
Andy CostanzaandGitHub 6d4f964a6e Add tag rendering template to Query Templates (#1517) 2025-09-02 20:19:27 +02:00
Zef Hemel a303b1bae2 Fix the templates.itemItem and templates.paragraphItem to be more useful. 2025-08-31 17:21:52 +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 8458c97d0c Adds Github Import and Export support
Building this in as a more sensible way to share SB libraries.
2025-08-20 15:00:33 +02:00
MrMugameandGitHub 98cff15235 Make stripIndent an option for template.new (#1473) 2025-07-26 20:34:32 +02:00
Nico S.andGitHub 5cfd61cd0e Update Widgets.md (#1465)
Added sorting for page name to the query of "Linked Tasks", just like it is with "Linked Mentions".
2025-07-22 22:09:19 +02:00
Michael Schmidt-KorthandGitHub 211d81a28d Merge pull request #1435
* upd: visualize markdown column alignment (based on #1293)

* fix: Table formatter inconsistencies
2025-06-21 17:50:07 +02:00
Michael Schmidt-KorthandGitHub 00326fccb9 upd: Improved Mention UI (#1436) 2025-06-21 17:38:52 +02:00
Zef Hemel 7c110c417d Set Page Template priority 2025-06-18 20:07:23 +02:00
Zef Hemel 8849f0736f New actionButton.define command 2025-06-18 16:58:45 +02:00
Zef Hemel e98b27c830 Content improvements 2025-06-17 18:46:15 +02:00
Zef Hemel 3d805383bb Cleanup: server 2025-06-17 13:48:56 +02:00
Zef Hemel fbf2e4bc45 Rename system.invokeCommand syscall to editor.invokeCommand 2025-06-17 10:55:51 +02:00
Zef Hemel 125d600801 Rename commmand.patch to command.update 2025-06-17 10:48:32 +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 30118eb01c Fixes #1346
Adds back "args" option to shortcuts
2025-06-13 10:38:08 +02:00
Zef Hemel 80b089b691 Fix extra padding 2025-06-04 16:23:02 +02:00
Zef Hemel e5c137a505 Fixes #1411: adds 'priority' setting for space style 2025-06-04 11:36:39 +02:00
Lennart OchelandGitHub ce22a4245a Add optional priority attribute to PageCreatingContent (#1392)
* Add optional priority attribute to PageCreatingContent

* Minor simplification

* Fix comments

* Revert changes

* Add pageEventHandlers
2025-05-26 20:03:54 +02:00
Albert-Jan de VriesandGitHub 4a0f03ee1e fix: closing bracket is missing (#1408) 2025-05-26 20:03:04 +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
Marek S. ŁukasiewiczandGitHub 10e7cea08d Order strings in queries using collation algorithm (#1391)
Configurable with queryCollation, default value maintains old behaviour.
Added tests, schema, example settings, and documentation to query page.

Close: #614
Close: #1316
2025-05-10 17:06:45 +02:00
Lennart OchelandGitHub 57c4317b49 Fix paragraphs for the tag page (#1376) 2025-05-07 19:14:38 +02:00
Matthias BenaetsandGitHub ea3d6928cf feat: configure vim in CONFIG (#1369) 2025-05-04 20:42:00 +02:00
Marek S. ŁukasiewiczandGitHub 39be21e475 Mention answers to recent forum questions on website (#1358)
* Add another example line to Frontmatter.md

Add another line which shows that page references should be quoted and pascalCase convention

* Mention feather icons in config documentation

* Add a query example to select based on folder

This is relevant for Quick Notes
2025-04-30 11:02:13 +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
wbhoustonandGitHub 6be32d73bf Fix hashes in code blocks interpreted as titles in ToC (#1354)
https://github.com/silverbulletmd/silverbullet/issues/1351
2025-04-25 19:00:22 +02:00
wbhoustonandGitHub c35c3a0a58 Add priority to mentions and linked tasks templates (#1355)
https://github.com/silverbulletmd/silverbullet/issues/1349
2025-04-25 18:58:08 +02:00
Nico S.andGitHub d43697e9a4 tag-page: changed order of queries (#1342) 2025-04-17 21:55:36 +02:00
Nico S.andGitHub aa20de14f2 Added paragraphs to tag-page (#1341) 2025-04-17 21:55:09 +02:00
Zef Hemel 7b9b8fb12a Last tweaks before merging v2 into main 2025-04-17 16:32:14 +02:00
Zef Hemel cde017cda0 Fix broken links 2025-04-17 13:01:02 +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 b681e4dfc6 Remove debug print statement from page template command function 2025-04-06 13:44:27 +02:00
Zef Hemel 44d8fe4467 Implement slash command templates and enhance Lua command functionality
- Introduced a new system for defining slash commands using templates, allowing for easier command creation and management.
- Added multiple slash command templates, including for functions, queries, and admonitions, with specific context handling.
- Enhanced existing Lua command definitions to support new template-based commands and improved context filtering.
- Updated the `template.fromPage` function to handle raw template text, enabling more flexible command definitions.
2025-04-06 10:08:06 +02:00
Zef Hemel 18df394ef8 Add page template functionality and restructure existing templates
- Introduced a new page template system to automate page creation based on defined templates.
- Added configuration options for templates, including suggested names, confirmation prompts, and keyboard shortcuts.
- Created a new "Quick Note" template with specific command and key bindings.
- Removed the old "Page Templates" file and integrated its content into the new structure for better organization.
2025-04-06 08:59:49 +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 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 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 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 c28e7aacf5 Fixes #1311 2025-03-28 15:57:46 +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