1
0

Marking #eval as deprecated

This commit is contained in:
Zef Hemel 2023-10-03 16:22:58 +02:00
parent a66842c50e
commit 38318556aa
2 changed files with 1 additions and 28 deletions

View File

@ -11,6 +11,7 @@ Oh boy, this is a big one. This release brings you the following:
* The query syntax used in [[Live Queries]] (but also used in [[🔌 Directive]]) has been significantly expanded, although there may still be bugs. Theres still more value to be unlocked here in future releases.
* The previous “backlinks” plug is now built into SilverBullet as [[Linked Mentions]] and appears at the bottom of every page (if there are incoming links). You can toggle linked mentions via {[Mentions: Toggle]}.
* A whole bunch of [[PlugOS]] syscalls have been updated, Ill do my best update known existing plugs, but if you built existing ones some things may have broken. Please report anything broken in [Github issues](https://github.com/silverbulletmd/silverbullet/issues).
* This release effectively already removes the `#eval` [[🔌 Directive]] (its still there, but likely not working), this directive needs some rethinking. Join us on [Discord](https://discord.gg/EvXbFucTxn) if you have a use case for it and how you use/want to use it.
Due to significant changes in how data is stored, likely your space will be resynced to all your clients once you upgrade. Just in case you may also want to {[Space: Reindex]} your space. If things are really broken, try the {[Debug: Reset Client]} command.

View File

@ -45,31 +45,3 @@ So, for instance, a template can take a tag name as an argument:
<!-- #use [[template/tagged-tasks]] "test" -->
* [ ] [[🔌 Directive@1537]] This is a test task #test
<!-- /use -->
## Eval
$eval
The `#eval` directive can be used to evaluate arbitrary JavaScript expressions. Its also possible to invoke arbitrary plug functions this way.
**Note:** ==This feature is experimental== and will likely evolve.
A simple example is multiplying numbers:
<!-- #eval 10 * 10 -->
100
<!-- /eval -->
However, you can also invoke arbitrary plug functions, e.g. the `titleUnfurlOptions` function in the `core` plug:
<!-- #eval editor.titleUnfurlOptions() -->
|id |name |
|------------|-------------|
|title-unfurl|Extract title|
<!-- /eval -->
Optionally, you can use a `render` clause to render the result as a template, similar to [[Live Queries]]:
<!-- #eval editor.titleUnfurlOptions() render [[template/debug]] -->
id: title-unfurl
name: Extract title
---
<!-- /eval -->