You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/Commands.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,5 @@ Commands define actions that SilverBullet can perform. They range from simple ed
3
3
SilverBullet ships with a lot of commands built in, but custom ones can also be defined using [[Space Lua]] and [[Plugs]].
4
4
5
5
Beside the list below, all commands available commands appear in the [[Command Palette]] but may have key bindings as well (these key bindings appear in the [[Command Palette]] and are configurable in [[^Library/Std/Config]]).
6
+
7
+
You can create custom command using the [[^Library/Std/Command]] API.
On this site you see a section “Linked Mentions” appear along the bottom of every page that has incoming links. 👇🏻 This section lists all pages that contain a _link_ to the current page. This allows for easy navigation, and may help you discover linked concepts through these links.
1
+
On this site you see a section “Linked Mentions” appear along the bottom of every page that has incoming links. 👇🏻 This section lists all pages that contain a _link to_ the current page. This allows for easy navigation, and may help you discover linked concepts through these links.
2
2
3
-
Implementation: [[^Library/Std/Widgets#Table of contents]]
Copy file name to clipboardExpand all lines: website/Objects.md
+13-44Lines changed: 13 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
SilverBullet automatically builds and maintains an index of _objects_ extracted from all markdown pages in your space. It subsequently allows you to use [[Space Lua/Lua Integrated Query]] to query this database in (potentially) useful ways.
1
+
SilverBullet automatically builds and maintains an index of _objects_ extracted from all [[Markdown]][[Pages]] in your [[Spaces]]. It subsequently allows you to use [[Space Lua/Lua Integrated Query]] to query this database in (potentially) useful ways.
2
2
3
3
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).
4
4
@@ -7,49 +7,19 @@ Every object has a set of [[Attributes]], some predefined, but you can add any a
7
7
8
8
The following attributes are predefined, and you can expect all objects to have them:
9
9
*`ref`: a globally unique _identifier_, often represented as a pointer to the place (page, position) in your space where the object is defined. For instance, a _page_ object will use the page name as its `ref` attribute, and a `task` will use `page@pos` (where `pos` is the location the task appears in `page`).
10
-
*`tag`: the main type, or “tag” of the page, usually a built-in type of the object (see below).
10
+
*`tag`: the main type, or “tag” of the object, usually a built-in type (see below for a list).
11
11
12
12
In addition, many objects will also contain:
13
13
*`tags`: an optional set of additional, explicitly assigned tags.
14
-
*`itags`: a set of _implicit_ or _inherited_ tags: including the object’s `tag`, `tags` as well as any tags _assigned to its containing page_. This is useful to answer queries like, “give me all tasks on pages where that page is tagged with `person`“, which would be expressed as `task where itags = "person"` (although technically that would also match any tags that have the `#person` explicitly assigned).
14
+
*`itags`: a set of _implicit_ or _inherited_ tags: including the object’s `tag`, `tags` as well as any tags _assigned to its containing page_. This is useful to answer queries like, “give me all tasks on pages where that page is tagged with `person`“, which would be expressed as `query[[from index.tag "task" where table.includes(_.itags, "person")]]` (although technically that would also match any tags that have the `#person` explicitly assigned).
15
15
16
16
Beside these, any number of additional tag-specific and custom [[Attributes]] can be defined (see below).
17
17
18
18
# Tags
19
19
Every object has a main `tag`, which signifies the type of object being described. In addition, any number of additional tags can be assigned as well via the `tags` attribute. You can use either the main `tag` or any of the `tags` as query sources in [[Space Lua/Lua Integrated Query]] — examples below.
20
20
21
-
## Styling
22
-
You can add custom styles to a tag by leveraging the `data-tag-name` attribute, [CSS Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and custom [[Space Style]]'s. Every tag gets an attribute added to it called `data-tag-name` that is set to the tag name with the `#` symbol stripped out. So given the tag #my-cool-tag the `data-tag-name` attribute would look like:
23
-
24
-
data-tag-name="my-cool-tag"
25
-
26
-
This allows us to do things like change the color of the #my-cool-tag
27
-
to have a purple background, limegreen text and bold font by adding the following [[Space Style]]:
28
-
29
-
```css
30
-
.sb-hashtag[data-tag-name="my-cool-tag"] {
31
-
background: purple;
32
-
color: limegreen;
33
-
font-weight: bolder;
34
-
}
35
-
```
36
-
37
-
Additionally tags written using angle brackets, such as...
38
-
39
-
#<my cool tag>
40
-
41
-
...can be styled via [[Space Style]] like this:
42
-
```css
43
-
.sb-hashtag[data-tag-name="my cool tag"] {
44
-
background: purple;
45
-
color: limegreen;
46
-
font-weight: bolder;
47
-
}
48
-
```
49
-
50
-
## Built-in tags
51
-
52
-
### page
21
+
# Built-in tags
22
+
## page
53
23
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`.
54
24
55
25
In addition to `ref` and `tags`, the `page` tag defines a bunch of additional attributes as can be seen in this example query:
@@ -59,12 +29,12 @@ ${query[[from index.tag "page" where name == _CTX.currentPage.name]]}
59
29
Note that you can also query this page using the `level/intermediate` directly:
60
30
${query[[from index.tag "level/intermediate"]]}
61
31
62
-
###aspiring-page
32
+
## aspiring-page
63
33
[[Aspiring Pages]] are pages that are linked to, but not yet created.
64
34
65
35
${query[[from index.tag "aspiring-page"]]}
66
36
67
-
###table
37
+
## table
68
38
Markdown table rows are indexed using the `table` tag, any additional tags can be added using [[Tags]] in any of its cells.
Similar to [[#item]], `task` objects have a `parent` attribute when nested (pointing to their parent `item`), and inherit their ancestor’s tags in `itags`.
123
93
124
-
###taskstate
94
+
## taskstate
125
95
[[Tasks]] support the default `x` and `` states (done and not done), but custom states as well. Custom states used across your space are kept in `taskstate`:
126
96
127
97
*[NOT STARTED] Task 1
@@ -148,25 +118,24 @@ age: 55
148
118
Which then becomes queriable via the `contact` tag:
149
119
${query[[from index.tag "contact"]]}
150
120
151
-
###link
121
+
## link
152
122
All page _links_ are tagged with `link`. You cannot attach additional tags to links. The main two attributes of a link are:
153
123
154
124
*`toPage` the page the link is linking _to_
155
125
*`page` the page the link appears on
156
126
157
127
In addition, the `snippet` attribute attempts to capture a little bit of context on where the link appears.
158
128
159
-
_Note_: this is the data source used for the {[Mentions: Toggle]} feature as well page {[Page: Rename]}.
160
-
161
129
Here is a query that shows some links that appear in this particular page:
130
+
162
131
${query[[from index.tag "link" where page == _CTX.currentPage.name limit 5]]}
163
132
164
-
###header
133
+
## header
165
134
Headers (lines starting with `#`, `##` etc.) are indexed as well and queriable.
166
135
167
136
${query[[from index.tag "header" where page == _CTX.currentPage.name limit 3]]}
168
137
169
-
###tag
138
+
## tag
170
139
The ultimate meta tag is _tag_ itself, which indexes for all tags used, in which page they appear and what their “parent tag” is (the context of the tag: either `page`, `item` or `task`).
According to [Wikipedia](https://en.wikipedia.org/wiki/Self-hosting_(web_services)):
2
+
3
+
> **Self-hosting** is the practice of running and maintaining a [website](https://en.wikipedia.org/wiki/Website) or [service](https://en.wikipedia.org/wiki/Service_\(systems_architecture\)"Service (systems architecture)") using a private [web server](https://en.wikipedia.org/wiki/Web_server"Web server"), instead of using a service outside of the administrator's own control. Self-hosting allows users to have more control over their data, privacy, and computing infrastructure, as well as potentially saving costs and improving skills.
4
+
5
+
SilverBullet is the ultimate gateway to practice hosting your own stuff.
6
+
7
+
Had a taste and want more? Here are some excellent resources:
Copy file name to clipboardExpand all lines: website/Space Style.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,35 @@ The following [[Space Lua/Lua Integrated Query]] is used to determine the order
22
22
query[[from index.tag "space-style" order by _.priority desc]]
23
23
```
24
24
25
-
# Examples
25
+
# Tag Styling
26
+
You can add custom styles to a tag by leveraging the `data-tag-name` attribute, [CSS Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and custom [[Space Style]]'s. Every tag gets an attribute added to it called `data-tag-name` that is set to the tag name with the `#` symbol stripped out. So given the tag #my-cool-tag the `data-tag-name` attribute would look like:
27
+
28
+
data-tag-name="my-cool-tag"
29
+
30
+
This allows us to do things like change the color of the #my-cool-tag
31
+
to have a purple background, limegreen text and bold font by adding the following [[Space Style]]:
32
+
33
+
```css
34
+
.sb-hashtag[data-tag-name="my-cool-tag"] {
35
+
background: purple;
36
+
color: limegreen;
37
+
font-weight: bolder;
38
+
}
39
+
```
40
+
41
+
Additionally tags written using angle brackets, such as...
42
+
43
+
#<my cool tag>
44
+
45
+
...can be styled via [[Space Style]] like this:
46
+
```css
47
+
.sb-hashtag[data-tag-name="my cool tag"] {
48
+
background: purple;
49
+
color: limegreen;
50
+
font-weight: bolder;
51
+
}
52
+
```
53
+
# More examples
26
54
All the actual CSS in these examples is commented out as to not affect this very website.
0 commit comments