SilverBullet v2 removed a slew of features that were still present in the 0.x series (also known as “v1”). Sadly, we just had to rip the bandaid on this one.
Here are some pointers on what was removed and how to adapt.
Queries
v2 does not have support for old-style queries (live queries) anymore. They have been replaced with Space Lua/Integrated Query. Give the linked page a read, but generally there’s a few differences:
- Space Lua Integrated Queries tend to start with
from index.objects("tag-name")instead of plaintag-name. This is a bit longer, but since whatever comes afterfromis a Lua expression, you can not just query Object, you can query any Lua table as well in the same way. - In the old query language, you access attribute simply by their name, this works in SLIQ too, but stylistically it’s nicer to use either
_.attribute, or to give the object you’re iterating over a name, usingfrom page = index.pages(), for instance. - The
=equals operator is==in Lua 😄
Templates
In v1 there were various types of templates:
- Live Templates (in
templateblocks) - Live Template Widgets (using special Frontmatter-based hooks)
- Snippets (using special Frontmatter-based hooks)
- Page Templates (using special Frontmatter-based hooks)
Live templates are now better expressed by simply putting ````````````````````````````````````````````````````````````` using templates is generally done by selecting a template call in the query itself: ```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
Live Template Widgets can now be implemented using an event listener:
event.listen {
name = "hooks:renderTopWidgets", -- or hooks:renderBottomWidgets
run = function(e)
return widget.new {
markdown = "Showing up at the top"
}
end
}See ^Library/Std/Widgets/Widgets for some examples.
Snippets can be implemented as follows: Library/Std/Infrastructure/Slash Templates.
Page templates now work slightly differently: ^Library/Std/Infrastructure/Page Templates.
Plugs
Many existing plugs should keep working, but some may need updating. Plug installation is now handled through the Configuration Manager (open with Client: Configuration or Ctrl/Cmd-,) under the Libraries tab. Legacy plugs: config entries are ignored — install plugs from the Libraries UI instead.
Other changes
- Since no database is kept on the server, you can safely delete any
.silverbullet.dbfile from your space — this isn’t used anymore. - Since space config is no longer a thing,
SETTINGSis now gone. Instead the CONFIG page is now the preferred place to configure things. However, this is just a convention. You can use theconfig.setSpace Lua API in any Space Lua block.
Removed features
Certain features have been removed:
- Online mode: v2 is sync mode only, meaning all your content will be synced into your browser. A simpler Online mode may be added back later. If you like to wipe your local content at any time, use the
System: Wipe Clientcommand. - Federation
- Share replaced by ^Library/Std/Infrastructure/Export
- Space Script: replaced by Space Lua
- Space Config: replaced by the config APIs.
- Command link syntax (````````````````````````the ````````````````````````````````````````````````````