Content updates

pull/528/head
Zef Hemel 2023-10-03 18:16:07 +02:00
parent 91387d1e96
commit 55d4699930
2 changed files with 7 additions and 14 deletions

View File

@ -1,6 +1,7 @@
import { SETTINGS_TEMPLATE } from "./settings_template.ts";
import { YAML } from "./deps.ts";
import { SpacePrimitives } from "./spaces/space_primitives.ts";
import { template } from "https://esm.sh/v130/handlebars@4.7.7/runtime.d.ts";
export function safeRun(fn: () => Promise<void>) {
fn().catch((e) => {
@ -62,9 +63,10 @@ export async function ensureSettingsAndIndex(
new TextEncoder().encode(
`Hello! And welcome to your brand new SilverBullet space!
<!-- #use [[!silverbullet.md/Getting Started]] -->
Loading some onboarding content for you (but doing so does require a working internet connection)...
<!-- /use -->`,
\`\`\`template
page: "[[!silverbullet.md/Getting Started]]"
\`\`\`
`,
),
);
}

View File

@ -18,9 +18,9 @@ Notice that as you move your cursor around on this page and you get close to or
Hadnt we mentioned [[Markdown]] yet? Yeah, thats the markup language youll use to add that dash of markup to your documents. Its pretty simple to learn if you dont know it already.
You will notice this whole page section is wrapped in a strange type of block. This is a SilverBullet specific feature called a [[Live Templates]], which embeds another (sometime external) page into the existing one.
You will notice this whole page section is wrapped in a strange type of block. This is a SilverBullet specific feature called a [[Live Templates]], which embeds another (sometime external) page into the existing one. If you hover over this section, youll notice a small _refresh_ and _edit_ button. Hit that edit button to reveal the underlying source that renders this content.
But SilverBullet has even more tricks up its sleeve. Consider [[Live Queries]] which allow you to query [[Objects]] in your space easily.
SilverBullet has even more tricks up its sleeve. Consider [[Live Queries]] which allow you to query [[Objects]] in your space easily.
Dont believe me? Check this out, heres a list of (max 10) pages in your space ordered by name, it updates (somewhat) dynamically 🤯. Create some new pages and come back here to see that it works:
@ -28,15 +28,6 @@ Dont believe me? Check this out, heres a list of (max 10) pages in your sp
page select name order by name limit 10
```
That said, the directive used wrapping this page section is `#use` which uses the content of another page as a template and inlines it. Directives recalculate their bodies in two scenarios:
1. When you load/switch to a page
2. When you explicitly run the {[Directives: Update]} command
In the case of `#use` this means the body will again be replaced with the page included, so dont be surprised when whatever you just updated inside of this directive block will be undone later. Just sayin. [[🔌 Directive|Directives]] are a powerful feature, so you should definitely look into them once you get comfortable with the basics.
Feel free to completely remove all content on this page and make it your own, its just to get you started.
## What next?
If you are a visual learner, you may [enjoy this introduction video on Youtube](https://youtu.be/VemS-cqAD5k).