Commit Graph
160 Commits
Author SHA1 Message Date
Zef Hemel 19d3328647 lint fixes 2026-03-13 09:24:52 +01:00
Zef Hemel 9581433cd3 Fixes #212: adds footnote support
Based on https://www.markdownlang.com/extended/footnotes.html

* Both "official" [^1] and [^1]: def
* And inline ^[My foot note]

Features:
* Properly parsed in markdown parser
* Syntax highlighting
* Live Preview to ... when on-hover preview of content, on-click moves
  cursor to definition
* Reference completion
* Invalid references are marked
2026-03-13 08:28:43 +01:00
Zef Hemel 799e27a9b4 Enable biome based formatter and reformat 2026-03-10 09:38:59 +01:00
Zef Hemel cce5b669f6 Merge branch 'main' into to-node 2026-03-10 08:57:58 +01:00
Zef Hemel a59fb566ae Add table row support also to outline commands
As requested in #1051
2026-03-09 14:58:02 +01:00
Zef Hemel dbe9e702aa Thorough redo of the outline operation commands
Fixes #606 and #908 improves #1051,
2026-03-09 14:52:06 +01:00
Zef Hemel bbcd9ac6aa Introduce new noFloatingPromises lint rule and fix violiations 2026-03-08 15:49:45 +01:00
Zef Hemel dbf275d75b Introduce biome as linter with lint fixes 2026-03-06 08:05:13 +01:00
Zef Hemel 17418fd7ec Pull reported client version number from system.getVersion() 2026-03-05 15:07:25 +01:00
Zef HemelandGitHub 0f3f963de0 Merge pull request #1833 from rktjmp/feat-upload-no-clobber
Dont clobber existing files when uploading
2026-02-26 09:28:27 +01:00
Oliver Marriott 274780e5e1 Match await flashNotification usage to existing code 2026-02-26 14:56:51 +11:00
Oliver Marriott ea590f8e27 Formatter 2026-02-26 14:27:25 +11:00
Oliver Marriott 9467e8af26 Convert arrow functions to regular function decls 2026-02-26 14:27:14 +11:00
rktjmpandGitHub f4bd2c3abc Trim user input from prompts where appropriate (#1854)
* Trim user input from prompts where appropriate

* Run formatter

* Use "page title" language instead of "page name" in notifications.

Existing language in prompt asks for a "page title".

* Use const for prefix inputs as they are never trimmed
2026-02-25 10:16:37 +01:00
Oliver Marriott db6f16fa6f Fix typing 2026-02-25 00:00:04 +11:00
Oliver Marriott 037e69c889 Add no-clobber behaviour to paste uploads 2026-02-25 00:00:04 +11:00
Oliver Marriott f22c1ce15c Check user input for null, trim otherwise 2026-02-25 00:00:04 +11:00
Oliver Marriott d8f0a7488b Prompt user before replacing files when using Upload file command 2026-02-25 00:00:04 +11:00
Zef Hemel dbf95f7fe2 Fix lint 2026-02-03 09:50:25 +01:00
Zef Hemel 9057702557 Merge Client: Clean into Client: Wipe and remove Client: Clean
Client: Wipe now also deletes redundant other databases.

Related to #1798
2026-02-03 09:48:01 +01:00
Zef Hemel 9667916c9c Adds "Page: Create Under Cursor" command
Command that allows creating a new page based on the wiki link under the
cursor.
2026-02-02 17:00:56 +01:00
Zef Hemel 0da5d97284 Refactor navigation commands and enhance page renaming logic
* Modified renamePage function in refactor.ts to ensure navigation to the new page occurs after the index queue is processed, so that linked mentions reflect updated data once arriving there
2026-02-02 16:40:58 +01:00
Zef Hemel c2b71d1740 Change syscall compatibility check to queryLuaObjects 2026-01-21 13:05:33 +01:00
Zef Hemel 8acad63565 Reorganized keyboard shortcuts a little bit and documented them. 2026-01-21 11:01:11 +01:00
Zef Hemel c25a073e81 WIP 2026-01-20 13:48:15 +01:00
Zef Hemel 1847f8e359 Fixes #1774 2026-01-15 11:22:13 +01:00
Zef Hemel cf49b9372f Add message queue flushing to Client: Clean 2026-01-15 08:42:06 +01:00
Zef Hemel ef961d5f79 Navigate: Copy Ref to Current Position and `Navigate: Copy Link to
Current Position` commands
2026-01-13 15:46:27 +01:00
Zef Hemel fb3dd51bdb Inline content refactor 2026-01-12 17:19:23 +01:00
Zef Hemel a0d3c9bfba Hack fix: show alert and force a reload when client code hasn't been
updated yet in cache.
2026-01-08 17:17:16 +01:00
Zef Hemel c93d656ac6 Significant refactor of index
* Moved YAML library import to index plug (so no async syscalls anymore)
  should speed things up
* Merged task and item indexing
* Merged tasks plug into index (questionable)
* taskstate is now no longer a tag, but needs to be configured via
  configs
2026-01-07 11:00:32 +01:00
Michael WeichertandGitHub 78b0b3ae9f feat: Add linkName attribute support for wiki link autocomplete (#1712)
Add support for a linkName frontmatter attribute that controls the alias
text inserted during wiki link autocomplete. The precedence order is:
linkName > displayName > page name.

This allows users to have separate link text from display name. For example,
a page for "Randy Mario Poffo" can have linkName: "Randy Savage" and
displayName: "Macho Man", resulting in [[Randy Mario Poffo|Randy Savage]]
when selected from autocomplete.
2025-12-10 08:39:45 +01:00
Zef Hemel a3b69bd47d Added Tag Picker
Bonus:
* Tag pages now include parent and child tags
* Optimized tag completion
2025-11-14 11:50:59 +01:00
Zef Hemel d890b741c8 Exclude plugs from completions 2025-11-07 11:13:27 +01:00
Zef Hemel 18bea2e113 Client: Clean command 2025-10-23 09:03:57 +02:00
Matouš Jan FialkaandGitHub 27339c98f6 Space Lua: Align arithmetic model with standard Lua (#1611)
* Align Space Lua arithmetic model with standard Lua
* Add missing __unm and __bnot metamethods
- add new basic tests
- add helper for negative tests
* Add comments for ASCII numeric constants

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-16 08:41:47 +02:00
MrMugameandGitHub 00af994d69 Fix navigation for Autolinks and clean up code (#1607) 2025-10-10 08:42:25 +02:00
Oleksandr KuvshynovandGitHub 42dc543be1 silverbullet: fix circular recent page deletion (#1599) 2025-10-07 21:01:44 +02:00
Zef Hemel f4336bf09f Code restructuring: eliminated the top-level lib/ directory 2025-09-23 17:00:34 +02:00
Zef HemelandGitHub a524c64884 Go backend (#1555)
* Replaces old Deno server with a Go implementation
* Restructured the code base accordingly
2025-09-19 13:23:20 +02:00
MrMugameandGitHub 440cd8d144 Cleanup code around dark mode (#1542)
* Cleanup code around dark mode

* Fix lint
2025-09-15 08:59:49 +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
aphymiandGitHub 6914d4bc31 Add command to toggle markdown syntax rendering (#1502)
* feat: add command to toggle clean mode

* refactor: simplify wiki_link no-clean-mode logic

* refactor: use more sensible clean-mode toggling logic

* fix: fix clean-mode-off not lasting across reloads

* refactor: move var declaration to where it's used

* feat: add root data attribute for clean mode state

This allows writing styles based on whether clean mode is currently
enabled or disabled.

* feat: reset clean-mode-off syntax color

* feat: un-hide lua directives in clean-mode-off

* style: format changes from 60379b1

* feat: rename 'Toggle Clean Mode' command

'Toggle Clean Mode' is now 'Toggle Markdown Syntax Rendering', and along
with the change in semantics, now defaults to false. The associated
variables have also been renamed.

* docs: add MD syntax rendering command to docs
2025-09-10 08:28: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 d92eeb85c2 2.0.0-pre4 2025-06-18 10:11:42 +02:00
Zef Hemel 42bd980419 2.0.0-pre3 2025-06-18 10:01:24 +02:00
Zef Hemel 450ef50df7 Cleanup: more cleanup and moving stuff around 2025-06-17 16:12:18 +02:00
Zef Hemel 2d8e16c4e6 Trigger "Anything Picker" by tapping the left shift twice 2025-06-16 20:34:36 +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 931b0bd16c Refactor vim mode naming
Rebind "o" to follow markdown editor's newline and continue behavior
2025-06-13 10:27:37 +02:00