Website updates with leveling

pull/1039/head
Zef Hemel 2024-08-15 16:39:17 +02:00
parent 074aa323c2
commit b69f6916fc
30 changed files with 168 additions and 10 deletions

View File

@ -1,3 +1,5 @@
#level/beginner
While SilverBullet for sure is aimed at primarily text-based content, life can not fully be represented in text always. Therefore, SilverBullet supports attachments. Attachments, like [[Pages]] ultimately are — once again — just files on disk.
# Uploading

View File

@ -1,3 +1,5 @@
#level/intermediate
Attribute syntax can contribute additional [[Metadata]] to various [[Objects]], including:
* Pages

View File

@ -5,6 +5,7 @@ An attempt at documenting the changes/new features introduced in each release.
## Edge
_These features are not yet properly released, you need to use [the edge builds](https://community.silverbullet.md/t/living-on-the-edge-builds/27) to try them._
* Initial version of [[Schema]] support
* Widget buttons for [[Transclusions]] (by [onespaceman](https://github.com/silverbulletmd/silverbullet/pull/1013))
* SETTINGS is now first indexed, when a full space reindex needs to happen.
* Internal refactor, and more leverage of [JSR](https://jsr.io/). The SilverBullet [plug API](https://jsr.io/@silverbulletmd/silverbullet) is now published on JSR as well, and soon this will be the preferred way of importing the plug APIs.

View File

@ -1,5 +1,6 @@
---
status: Complete
tags: level/beginner
---
Frontmatter is a common format to attach additional metadata (data about data) to markdown documents.

View File

@ -1,3 +1,5 @@
#level/beginner
You can create three types of links in SilverBullet:
* External links, using the `[title](URL)` syntax, for instance: [SilverBullet community](https://community.silverbullet.md).

View File

@ -1,3 +1,5 @@
#level/intermediate
Live Queries are a [[Blocks|block]] that generates a (quasi) live view on various data sources, usually [[Objects]], and renders their results inline via [[Live Preview]] either as a table or using [[Templates]].
The syntax used is:

View File

@ -1,3 +1,5 @@
#level/hardcore
Live Template Widgets allow you to automatically render templated markdown widgets at the top or bottom of pages matching specific criteria.
> **warning** Warning

View File

@ -1,3 +1,5 @@
#level/intermediate
Live Templates are a type of [[Blocks|block]] that render [[Templates]] written in [[Template Language]] inline in a page.
There are two variants of Live Templates:

View File

@ -9,7 +9,6 @@ However, that is all unlikely to happen unless you understand what SilverBullet
The biggest hurdle to get over with SilverBullet is that you need to get this thing running. And as of yet, the only way to do that is to install and deploy it yourself. 🤷
* [[Install]]: Installation instructions for various setups
* [[Authelia]]: configuring SilverBullet with [Authelia](https://www.authelia.com/) authentication.
For more additional guides, check out [our community guides](https://community.silverbullet.md/c/guides/6).
@ -63,7 +62,7 @@ The main ways to roam your space, beside following page links, are:
* [[Space Script]] & [[Space Style]]
# Customization
* [[SETTINGS]]
* [[SETTINGS]] and [[Space Config]]
* [[Shortcuts]]
* [[Page Decorations]]
* [[Space Style]]

View File

@ -1,3 +1,5 @@
#level/beginner
Markdown is a plain text formatting system [originally developed by John Gruber](https://daringfireball.net/projects/markdown/). It has since been standardized into [CommonMark](https://commonmark.org/), which is what SilverBullet uses (with [[Markdown/Extensions]]). While a bit more technical than [WYSIWYG](https://pl.wikipedia.org/wiki/WYSIWYG)-style editing (like MS Word), the nice thing about markdown is that it is a (relatively) easy-to-implement standard, and you can read files even without special tools (like SilverBullet).
This means that _you will always have access to the content_ even if you switch tools. It also means that you can use multiple tools at the same time to edit these files. You dont have to use SilverBullet exclusively.

View File

@ -1,3 +1,5 @@
#level/intermediate
Silverbullet supports [admonitions](https://github.com/community/community/discussions/16925) using GitHub syntax (`note` and `warning`).
> **note** This is a

View File

@ -1,3 +1,5 @@
#level/beginner
The idea of markdown is that you write plain text with some additional markup that even without further processing (like rendering it to HTML, or [[Live Preview]]) you could just read and understand. It was inspired by conventions used in plain-text e-mails, before e-mail supported rich formatting.
# Basic markup

View File

@ -1,3 +1,5 @@
#level/intermediate
Meta pages are pages not core to your content, but function as a way to configure your [[Spaces|space]]. You can think of them as “tooling” pages.
The most obvious example is [[SETTINGS]], which is not really a page that you care about day-to-day, but only want to tweak when youre working on your space as a tool.

View File

@ -1,3 +1,5 @@
#level/hardcore
Object decorators are an **advanced technique** that can be used to add attributes to [[Objects]] dynamically whose values are _calculated dynamically_ (on-the-fly) based on an [[Expression Language|expression]].
> **warning** Warning

View File

@ -1,3 +1,5 @@
#level/intermediate
SilverBullet automatically builds and maintains an index of _objects_ extracted from all markdown pages in your space. It subsequently allows you to [[Live Queries|query]] this database in (potentially) useful ways.
By design, the truth remains in the markdown: all data indexed as objects will have a representation in markdown text as well. This index can be flushed at any time and be rebuilt from its source markdown files kept in your space (and you can do so on demand if you like using the {[Space: Reindex]} command).
@ -23,9 +25,7 @@ Every object has a main `tag`, which signifies the type of object being describe
Here are the currently built-in tags:
## page
Every page in your space is available via the `page` tag. You can attach _additional_ tags to a page, by either specifying them in the `tags` attribute [[Frontmatter]], or by putting additional [[Tags]] in a stand alone paragraph with no other (textual) content in them, e.g.:
#example-tag #another-tag
Every page in your space is available via the `page` tag. You can attach _additional_ tags to a page, by either specifying them in the `tags` attribute [[Frontmatter]], or by putting additional [[Tags]] in a stand alone paragraph with no other (textual) content in them, for instance check the very first line of this page that says `#level/intermediate`.
In addition to `ref` and `tags`, the `page` tag defines a bunch of additional attributes as can be seen in this example query:
@ -33,10 +33,10 @@ In addition to `ref` and `tags`, the `page` tag defines a bunch of additional at
page where name = @page.name
```
Note that you can also query this page using the `example-tag` directly:
Note that you can also query this page using the `level/intermediate` directly:
```query
example-tag
level/intermediate
```
## table

View File

@ -1,3 +1,5 @@
#level/intermediate
While SilverBullet is not a “proper” outliner, it does offer a number of useful commands to manage outlines.
An outline is simply a (nested) bulleted list, for instance:

View File

@ -5,6 +5,8 @@ pageDecoration:
cssClasses:
- christmas-decoration
---
#level/intermediate
Page decorations allow you to “decorate” pages in various fun ways.
> **warning** Warning

View File

@ -1,3 +1,5 @@
#level/intermediate
Page templates enable you to define templates for creating new pages. They can be invoked in a few ways:
* Explicitly using the {[Page: From Template]} command

View File

@ -1,3 +1,5 @@
#level/beginner
The primary thing youll be doing in SilverBullet (hopefully) is creating and editing pages. Pages are written in [[Markdown]], can contain [[Metadata]] and are kept on the server as text files.
Page _names_ are relatively free-form, but have to adhere to a few [[Page Name Rules]].

View File

@ -9,9 +9,9 @@ libraries:
# The "Core" library is recommended for all users
- import: "[[!silverbullet.md/Library/Core/*]]"
# You can exclude items from the import using exclude (also supports wildcards):
# exclude:
# - [[!silverbullet.md/Table of Contents]]
# - [[!silverbullet.md/Library/Core/Widget/*]]
#exclude:
# - "[[!silverbullet.md/Table of Contents]]"
# - "[[!silverbullet.md/Library/Core/Widget/*]]""
## UI TWEAKS
# Hide the sync button

99
website/Schema.md Normal file
View File

@ -0,0 +1,99 @@
#level/hardcore
> **warning** Warning
> This feature is **experimental**, it may evolve over time.
SilverBullet allows you to define schema for custom [[Space Config]] settings as well as for [[Objects|object]] [[Tags|tags]]. Both are defined using [[Space Config]] and use a [[YAML]] encoding of [JSON Schema](https://json-schema.org/).
# Object Schemas
The general format to define schemas for specific [[Tags]] is as follows:
~~~
```space-config
schema.tag.<<TAG>>: <<JSON SCHEMA ENCODED AS YAML>>
```
~~~
## Example
Lets say you use pages tagged with `#contact` to represent your contacts:
```template
{{#each {contact}}}
* [[{{name}}]] ([{{email}}](mailto:{{email}})):
* First name: _{{firstName}}_
* Last name: _{{lastName}}_
{{/each}}
```
To ensure you always attach the required meta data in [[Frontmatter]] for your contacts, youd like to do some checking. Specifically you would like to enforce that:
* `firstName` should always be a `string` and is _required_
* `lastName` should always be a `string` and is _required_
* `email` should be an e-mail address, if specified
You can achieve this using the following [[Space Config]]:
```space-config
schema.tag.contact:
properties:
firstName.type: string
lastName.type: string
email:
type: string
format: email
required:
- firstName
- lastName
```
> **note** Note
> To reload changes to your schema, be sure to run {[System: Reload]}
# Config schema
[[Space Config]] allows you to define arbitrary configuration keys for your own use cases. This is primarily useful for [[Libraries]], but perhaps you find your own use cases too.
The general format is:
~~~
```space-config
schema.config: <<JSON SCHEMA ENCODED AS YAML>>
```
~~~
## Example
Lets say you find it useful to make your full name globally configurable:
```space-config
myFullName: "Steve Hanks"
```
This can be useful, because you can reference this configuration key in any query or template, e.g.:
```template
My full name is: {{@config.myFullName}}
```
However, you would like to make sure that this `myFullName` configuration is always a string. You can achieve this with the following config schema definition:
```space-config
schema.config.properties.myFullName.type: string
```
Now, if you would accidentally change `myFullName` into a number or boolean value, you would get a validation error.
# Validation
At the moment, validation only occurs in the editor in [[Space Config]] and [[Frontmatter]] blocks and shows any violations as highlighted errors.
Even if data does not pass validation, it is still stored in the data store so it does not (currently) _enforce_ the format.
This may change in the future.
# Supported types
All standard JSON Schema types are supported. Likely you are interested in:
* `string`
* With custom formats (specified via `format`):
* `email`
* `page-ref` (for page references, e.g. `[[something]]`)
* `number`
* `array`
* `object`

View File

@ -1,3 +1,5 @@
#level/intermediate
SilverBullet enables you to configure some custom shortcuts in [[SETTINGS]] via the `shortcuts` attribute that trigger [[Commands]] in various ways.
Supported types of shortcuts:

View File

@ -1,3 +1,5 @@
#level/beginner
Slash commands are quick ways to perform repetitive tasks. 99% of the time this will mean inserting a [[Snippets|snippet]], but they can also be configured to trigger commands (see [[Shortcuts]]).
# Invoking a slash command

View File

@ -1,3 +1,5 @@
#level/intermediate
Snippets allow you to define custom [[Commands]] and [[Slash Commands]] that expand snippet-style templates inline.
# Definition

View File

@ -1,3 +1,5 @@
#level/hardcore
Space Script allows you to extend SilverBullet with JavaScript from within your space using `space-script` [[Blocks]]. Its script... in (your) [[Spaces|space]]. Get it?
> **warning** **Security**

View File

@ -1,3 +1,5 @@
#level/hardcore
Space Style is [[Space Script]]s stylish sibling. It enables you to add your own styling to SilverBullet with `space-style` [[Blocks]].
This can be used to achieve various things, such as overriding the default editor font or setting wider page widths. It is also possible to develop custom themes this way.

View File

@ -1,3 +1,5 @@
#level/beginner
A _space_ is SilverBullet terminology for a workspace, or project. [Obsidian](https://obsidian.md/) calls this a vault, [LogSeq](https://logseq.com/) calls it a graph. You may think of it as a [[Folders|folder]] or a directory — because in practical terms, thats all it is.
Feel free to back-up or manipulate your spaces folder and its files with whatever tool you like — you dont have to use SilverBullet exclusively. You may want to turn your spaces folder into a git repository, for instance, and do version control and back-ups that way — in which case you may appreciated the [[Plugs/Git]] plug.

View File

@ -1,3 +1,5 @@
#level/intermediate
Templates are pieces of (markdown) text that contain placeholders (named _directives_) that are replaced once instantiated. Templates are written in SilverBullets [[Template Language]].
Like everything else, templates are kept in your space. Theyre effectively regular [[Pages]], and are [[Tags|tagged]] with the `template` tag.

View File

@ -0,0 +1,6 @@
---
firstName: Jane
lastName: Doe
email: jane@doe.family
---
#contact

View File

@ -0,0 +1,8 @@
---
firstName: Joe
lastName: Doe
email: joe@doe.family
---
#contact
Joe is a stand up guy.