Commit Graph
29 Commits
Author SHA1 Message Date
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 450ef50df7 Cleanup: more cleanup and moving stuff around 2025-06-17 16:12:18 +02:00
Zef Hemel 5c45f671d1 More cleanup 2025-06-12 20:40:31 +02:00
Zef Hemel 8d3dc4cc4e Refactor, cleanup 2025-06-12 20:30:01 +02:00
Zef Hemel bf2e0cdb87 Refactor: Merging common/ into web/ 2025-06-04 14:01:59 +02:00
Zef Hemel e1a6643d9a Website documentation work 2025-04-06 21:49:15 +02:00
Zef Hemel c157e979f0 WIP 2025-03-23 12:48:25 +01:00
Zef Hemel dbfc5995f3 More thorough removal of federation 2025-03-21 16:12:10 +01:00
Zef Hemel 29570a3760 Allow for custom widgets through hooks:renderBottomWidgets and hooks:renderTopWidgets 2025-03-16 14:35:59 +01:00
Zef Hemel e93bff7fe4 Disable lua directive rendering on any page starting with "meta/template" 2025-03-15 20:57:22 +01:00
Zef Hemel 6307ce4242 Lua widget revamp 2025-03-14 15:58:01 +01:00
Zef Hemel f514ef1b53 Lua: support passing Lua function callbacks to native JS functions 2025-03-14 10:02:25 +01:00
Zef Hemel 6dfc342594 Fix crash on sync mode first load after update, no longer wait for space scripts to load before starting editor 2025-03-14 09:33:17 +01:00
Zef Hemel d33db399c8 Auto complete and lint fixes 2025-03-07 15:13:47 +01:00
Zef Hemel 0a80c5c537 Collapse PageRef, DocumentRef and LocationRef into a single Ref type 2025-03-07 13:49:20 +01:00
MrMugameandGitHub e61a447d98 Implementing #913 (#1230)
Implemented custom editors
2025-03-06 15:11:17 +01:00
Zef Hemel 9d3b9a8a22 Reduce code duplication 2025-02-13 20:11:08 +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 fce78a22f8 More Lua template work 2025-01-22 20:26:37 +01:00
Zef Hemel 86f31e3a00 Lua: experimental string interpolation 2025-01-09 11:45:15 +01:00
Zef Hemel c2fea2d25b Lua work 2025-01-08 17:09:09 +01:00
Zef Hemel 8acb112e4e Lua stack frame refactor 2024-10-20 15:06:23 +02:00
Zef Hemel c1a20af981 Lua: widgets 2024-10-13 15:14:22 +02:00
Zef Hemel 899c2556cb Lua: more fixes and work on stdlib 2024-10-08 19:53:09 +02:00
Zef Hemel f74bab0aca Lua: inline directives improvements 2024-10-07 19:17:12 +02:00
Zef Hemel 6c71862641 Lua: multi-line string literals 2024-10-07 09:08:36 +02:00
Zef Hemel 41a856636a Lint 2024-10-05 15:38:28 +02:00
Zef Hemel 1299d85e9a First simple Lua directive Live Preview 2024-10-05 15:37:36 +02:00