# Tricks & Techniques

**URL:** https://community.silverbullet.md/c/tricks-techniques/12.md?page=4

[Latest](https://community.silverbullet.md/latest.md) · [Categories](https://community.silverbullet.md/categories.md)

**Page:** 5

---

## [Show a random list of N notes](https://community.silverbullet.md/t/show-a-random-list-of-n-notes/2280)

<div class="topic-metadata">

**Author:** [@bnjbvr](https://community.silverbullet.md/u/bnjbvr)\
**Replies:** 2\
**Last updated:** [June 3, 2025, 2:49pm UTC](https://community.silverbullet.md/t/show-a-random-list-of-n-notes/2280 "2025-06-03T14:49:49Z")

</div>

This snippet allows to show N random pages from the vault. For instance, I’m showing 7 random notes on my home page, as an attempt to provoke serendipity. The number of random notes to be displayed can be passed as a fun…

---

## [Space Script not works?](https://community.silverbullet.md/t/space-script-not-works/2431)

<div class="topic-metadata">

**Author:** [@phlnil](https://community.silverbullet.md/u/phlnil)\
**Replies:** 2\
**Last updated:** [May 27, 2025, 6:52pm UTC](https://community.silverbullet.md/t/space-script-not-works/2431 "2025-05-27T18:52:11Z")

</div>

Hi, just installed this incredible piece of software, it works great. I would like to try some space\_scripts, so I would start to input: /code and add a "space\_script string … put some code : keyboard short cut to ins…

---

## [V2 Query Guide for v1 Users](https://community.silverbullet.md/t/v2-query-guide-for-v1-users/2429)

<div class="topic-metadata">

**Author:** [@Pat](https://community.silverbullet.md/u/Pat)\
**Replies:** 2\
**Last updated:** [May 27, 2025, 9:00am UTC](https://community.silverbullet.md/t/v2-query-guide-for-v1-users/2429 "2025-05-27T09:00:13Z")

</div>

This should be a “start” help for users, who migrate from v1 or new v2 users for queries Tasks queries Hint: Check dd-MM-yyyy - maybe its yyyy-MM-dd ## Overdue Tasks ${template.each( query\[\[ from index.tag 'task' whe…

---

## [Logseq-like theme](https://community.silverbullet.md/t/logseq-like-theme/2425)

<div class="topic-metadata">

**Author:** [@JocelynDelalande](https://community.silverbullet.md/u/JocelynDelalande)\
**Replies:** 0\
**Last updated:** [May 26, 2025, 9:53pm UTC](https://community.silverbullet.md/t/logseq-like-theme/2425 "2025-05-26T21:53:32Z")

</div>

What this theme brings: softer colors on links to make them more… link-looking more spacing and a fat colored left border on code blocks and quote blocks get rid off monospace font (except for code) It looks like this…

---

## [Convenience commands for page renaming](https://community.silverbullet.md/t/convenience-commands-for-page-renaming/2385)

<div class="topic-metadata">

**Author:** [@22rw](https://community.silverbullet.md/u/22rw)\
**Replies:** 0\
**Last updated:** [May 18, 2025, 9:44pm UTC](https://community.silverbullet.md/t/convenience-commands-for-page-renaming/2385 "2025-05-18T21:44:17Z")

</div>

Some small convenience commands to rename either branch or leaf of the page path, saving you the rather small effort of typing out the full path when renaming: command.define { name = "Page: Rename Leaf", run = func…

---

## [V2: SilverBullet library distribution](https://community.silverbullet.md/t/v2-silverbullet-library-distribution/2347)

<div class="topic-metadata">

**Author:** [@lochel](https://community.silverbullet.md/u/lochel)\
**Replies:** 2\
**Last updated:** [May 12, 2025, 6:40am UTC](https://community.silverbullet.md/t/v2-silverbullet-library-distribution/2347 "2025-05-12T06:40:07Z")

</div>

I’ve been thinking about the best way to share a SilverBullet library - something like Library/Std but more custom. Since I recently had time to port a few scripts from v1 to v2, I figured: why not hack together a half-d…

---

## [Changing favicon & Darkmode](https://community.silverbullet.md/t/changing-favicon-darkmode/836)

<div class="topic-metadata">

**Author:** [@mcboogieman](https://community.silverbullet.md/u/mcboogieman)\
**Replies:** 35\
**Last updated:** [May 6, 2025, 8:18am UTC](https://community.silverbullet.md/t/changing-favicon-darkmode/836 "2025-05-06T08:18:38Z")

</div>

Hello everyone! I’ve been an absolutely enthusiastic Silverbullet user for about a week now. I am currently busy trying to exploit the “hackable” aspect of silverbullet and am customizing a few things. Unfortunately, I …

---

## [Print a readable markdown ParseTree for a page](https://community.silverbullet.md/t/print-a-readable-markdown-parsetree-for-a-page/2283)

<div class="topic-metadata">

**Author:** [@wbh](https://community.silverbullet.md/u/wbh)\
**Replies:** 3\
**Last updated:** [April 30, 2025, 5:51am UTC](https://community.silverbullet.md/t/print-a-readable-markdown-parsetree-for-a-page/2283 "2025-04-30T05:51:49Z")

</div>

While I was working on the ToC widget, I needed a way to explore a page’s markdown parse tree as returned by markdown.parseMarkdown(text). At the time I printed everything to the console and often got lost in nested squi…

---

## [Space Script example: Get Current Local Date and Time](https://community.silverbullet.md/t/space-script-example-get-current-local-date-and-time/251)

<div class="topic-metadata">

**Author:** [@jdiercks](https://community.silverbullet.md/u/jdiercks)\
**Replies:** 4\
**Last updated:** [April 27, 2025, 8:47am UTC](https://community.silverbullet.md/t/space-script-example-get-current-local-date-and-time/251 "2025-04-27T08:47:31Z")

</div>

enjoy… /\* get current local date and time \*/ silverbullet.registerFunction({name: "localtime"}, () =\> { const options = { timezone: 'America/Los\_Angeles', /\* replace with your local TZ \*/ hour12: false, …

---

## [V2 - Understanding queries lua and help to migrate old requests](https://community.silverbullet.md/t/v2-understanding-queries-lua-and-help-to-migrate-old-requests/2253)

<div class="topic-metadata">

**Author:** [@PoppyLeFou](https://community.silverbullet.md/u/PoppyLeFou)\
**Replies:** 3\
**Last updated:** [April 25, 2025, 4:56pm UTC](https://community.silverbullet.md/t/v2-understanding-queries-lua-and-help-to-migrate-old-requests/2253 "2025-04-25T16:56:48Z")

</div>

Hello, From my understanding (and tests I’ve done), it seems this can only request the field “tag” to print pages. ${query\[\[from index.tag ... It is no possible to query directly the page name ? With something like : …

---

## [Sending emails from silverbullet](https://community.silverbullet.md/t/sending-emails-from-silverbullet/2236)

<div class="topic-metadata">

**Author:** [@bnjbvr](https://community.silverbullet.md/u/bnjbvr)\
**Replies:** 1\
**Last updated:** [April 24, 2025, 6:48pm UTC](https://community.silverbullet.md/t/sending-emails-from-silverbullet/2236 "2025-04-24T18:48:28Z")

</div>

Based on Custom search for v2 using git grep and answers, in the category “Because I can”, here’s a small tutorial to send emails from Silverbullet, assuming you already have some correctly configured SMTP relay host ser…

---

## [\`space-style\` snippets showcase 💅](https://community.silverbullet.md/t/space-style-snippets-showcase/2200)

<div class="topic-metadata">

**Author:** [@jim-fx](https://community.silverbullet.md/u/jim-fx)\
**Replies:** 3\
**Last updated:** [April 18, 2025, 10:54am UTC](https://community.silverbullet.md/t/space-style-snippets-showcase/2200 "2025-04-18T10:54:53Z")

</div>

Over the past year of using Silverbullet, I’ve collected a handful of space-style snippets that improve the look and feel of my workspace. Thought it’d be cool to share them here — and I’d love to see what others have co…

---

## [Todoist with Lua](https://community.silverbullet.md/t/todoist-with-lua/2189)

<div class="topic-metadata">

**Author:** [@dklawren](https://community.silverbullet.md/u/dklawren)\
**Replies:** 0\
**Last updated:** [April 17, 2025, 5:15pm UTC](https://community.silverbullet.md/t/todoist-with-lua/2189 "2025-04-17T17:15:52Z")

</div>

I started the work of converting my TS based Todoist plug that I wrote a while back to the new Lua style of things. I have the basics working for me and plan to expand the functionality in the near future. Right now it: …

---

## [Responsive TreeView](https://community.silverbullet.md/t/responsive-treeview/2188)

<div class="topic-metadata">

**Author:** [@MatthiasBenaets](https://community.silverbullet.md/u/MatthiasBenaets)\
**Replies:** 0\
**Last updated:** [April 17, 2025, 3:15pm UTC](https://community.silverbullet.md/t/responsive-treeview/2188 "2025-04-17T15:15:11Z")

</div>

TreeView is a great plug for browsing pages in directories I don’t open often. The only problem I have with it, is that it’s not very responsive. It either works for landscape or portrait, but not both. There is a Git…

---

## [Breadcrumbs for hierarchical pages](https://community.silverbullet.md/t/breadcrumbs-for-hierarchical-pages/737)

<div class="topic-metadata">

**Author:** [@bitraten](https://community.silverbullet.md/u/bitraten)\
**Replies:** 8\
**Last updated:** [April 17, 2025, 2:09pm UTC](https://community.silverbullet.md/t/breadcrumbs-for-hierarchical-pages/737 "2025-04-17T14:09:54Z")

</div>

Hi! I like to structure my pages in an hierarchical way and wanted to see the current nesting / “breadcrumbs”. I added a Template Widget and some space script for it, see below in case anyone else is interested. Happy t…

---

## [Lua comand to create a new page within the current directory](https://community.silverbullet.md/t/lua-comand-to-create-a-new-page-within-the-current-directory/2169)

<div class="topic-metadata">

**Author:** [@anthillsocial](https://community.silverbullet.md/u/anthillsocial)\
**Replies:** 8\
**Last updated:** [April 15, 2025, 5:22pm UTC](https://community.silverbullet.md/t/lua-comand-to-create-a-new-page-within-the-current-directory/2169 "2025-04-15T17:22:03Z")

</div>

Some more simple functionality. A command for creating a new page within the same directory as the page you are currently editing. It creates a page called “/current/dir/New” which you can then quickly edit. sub=sub or …

---

## [Simple word-count functionality](https://community.silverbullet.md/t/simple-word-count-functionality/2159)

<div class="topic-metadata">

**Author:** [@anthillsocial](https://community.silverbullet.md/u/anthillsocial)\
**Replies:** 1\
**Last updated:** [April 14, 2025, 8:07am UTC](https://community.silverbullet.md/t/simple-word-count-functionality/2159 "2025-04-14T08:07:46Z")

</div>

Here’s a space-lua script with some simple word-count functionality. command.define { name = "Word Count", run = function() editor.flashNotification("Word count: "..countCurrentPage()) end } function countCur…

---

## [Displaying tags in query render](https://community.silverbullet.md/t/displaying-tags-in-query-render/2145)

<div class="topic-metadata">

**Author:** [@disoardi](https://community.silverbullet.md/u/disoardi)\
**Replies:** 1\
**Last updated:** [April 11, 2025, 9:26am UTC](https://community.silverbullet.md/t/displaying-tags-in-query-render/2145 "2025-04-11T09:26:21Z")

</div>

Hi everyone, I need help visualizing the tags of tasks in queries. I’m currently using this template: \* \[{{state}}\] {{#if deadline \< today()}}⚠️OVERDUE⚠️{{else}}{{#if deadline = today()}}📅NOW📅{{else}}📝 {{#if deadline}}{…

---

## [Lua: \[Productivity\] Token replacement](https://community.silverbullet.md/t/lua-productivity-token-replacement/2096)

<div class="topic-metadata">

**Author:** [@malys](https://community.silverbullet.md/u/malys)\
**Replies:** 1\
**Last updated:** [April 4, 2025, 9:49am UTC](https://community.silverbullet.md/t/lua-productivity-token-replacement/2096 "2025-04-04T09:49:04Z")

</div>

\--- # Define key-value to replace replace: t: text d: demonstration --- \`\`\`space-lua function replaceValue(content, tags) local c= content for k, v in pairs(tags) do local key="\_"..k.."\_" c=c:gsub(key…

---

## [\[Space-Lua\] Prompt for input](https://community.silverbullet.md/t/space-lua-prompt-for-input/2112)

<div class="topic-metadata">

**Author:** [@flkiwi](https://community.silverbullet.md/u/flkiwi)\
**Replies:** 5\
**Last updated:** [April 3, 2025, 8:54pm UTC](https://community.silverbullet.md/t/space-lua-prompt-for-input/2112 "2025-04-03T20:54:51Z")

</div>

Let’s say I’m trying to create a script that: Registers a command that takes input from a user (say a name of a new page) prints the name of the page (as a link) at the cursor navigates to the new page I can do all of…

---

## [TSDproxy to Simplify Docker Self-Hosting](https://community.silverbullet.md/t/tsdproxy-to-simplify-docker-self-hosting/1769)

<div class="topic-metadata">

**Author:** [@drewbs-b](https://community.silverbullet.md/u/drewbs-b)\
**Replies:** 6\
**Last updated:** [April 1, 2025, 6:49pm UTC](https://community.silverbullet.md/t/tsdproxy-to-simplify-docker-self-hosting/1769 "2025-04-01T18:49:12Z")

</div>

Not going to go into enough detail here to write a whole guide, but after initially following the Docker + Tailscale guide to run SilverBullet on a Raspberry Pi I had laying around, I found myself revisiting my install b…

---

## [Sitemap Generator](https://community.silverbullet.md/t/sitemap-generator/2057)

<div class="topic-metadata">

**Author:** [@stag](https://community.silverbullet.md/u/stag)\
**Replies:** 3\
**Last updated:** [March 31, 2025, 3:24pm UTC](https://community.silverbullet.md/t/sitemap-generator/2057 "2025-03-31T15:24:48Z")

</div>

I’ve made a tool that will generate a sitemap, available at https://silverbullet.domain/\_/sitemap.xml To use it paste the following code into any page. I’ve put mine under Library/Me/Script/sitemap. You can change the d…

---

## [Page/Document directory example in Lua (v2)](https://community.silverbullet.md/t/page-document-directory-example-in-lua-v2/2076)

<div class="topic-metadata">

**Author:** [@nickb](https://community.silverbullet.md/u/nickb)\
**Replies:** 1\
**Last updated:** [March 30, 2025, 8:41pm UTC](https://community.silverbullet.md/t/page-document-directory-example-in-lua-v2/2076 "2025-03-30T20:41:58Z")

</div>

Just an example of a display of pages/documents and “directories” njb = njb or {} function njb.splitPath(path) local parts = {} for part in string.gmatch(path, "(\[^/\]+)") do table.insert(parts, part) end r…

---

## [Finding empty pages](https://community.silverbullet.md/t/finding-empty-pages/2040)

<div class="topic-metadata">

**Author:** [@janssen-io](https://community.silverbullet.md/u/janssen-io)\
**Replies:** 0\
**Last updated:** [March 25, 2025, 10:08pm UTC](https://community.silverbullet.md/t/finding-empty-pages/2040 "2025-03-25T22:08:18Z")

</div>

The problem To keep things easy to find, it’s nice to only have pages in your page picker and query results that actually have content. I used to clean them up by finding them in the command line with commands like ls -…

---

## [Collapsible - Vertical Action Menu for MobileScreens (but not only)](https://community.silverbullet.md/t/collapsible-vertical-action-menu-for-mobilescreens-but-not-only/1552)

<div class="topic-metadata">

**Author:** [@Mr.Red](https://community.silverbullet.md/u/Mr.Red)\
**Replies:** 18\
**Last updated:** [March 22, 2025, 8:43pm UTC](https://community.silverbullet.md/t/collapsible-vertical-action-menu-for-mobilescreens-but-not-only/1552 "2025-03-22T20:43:37Z")

</div>

I have a lot of action buttons so I needed a solution which doesn’t interfere with the title of the page. So I was playing around with the space-style and made this modification for mobile devices Screenshots with the …

---

## [(Script) Display a calendar for Journal entries](https://community.silverbullet.md/t/script-display-a-calendar-for-journal-entries/1308)

<div class="topic-metadata">

**Author:** [@zeus-web](https://community.silverbullet.md/u/zeus-web)\
**Replies:** 14\
**Last updated:** [March 19, 2025, 12:58am UTC](https://community.silverbullet.md/t/script-display-a-calendar-for-journal-entries/1308 "2025-03-19T00:58:41Z")

</div>

Hi, I just played around a bit the last days and implemented a feature on my (very short) Silverbullet wishlist, and I thought, it might be handy for others, too. As I’m not familiar with writing plugins, yet, I’m shar…

---

## [\[Space-Lua\] Simple HTML ColorPicker for Current Selection](https://community.silverbullet.md/t/space-lua-simple-html-colorpicker-for-current-selection/1972)

<div class="topic-metadata">

**Author:** [@jay](https://community.silverbullet.md/u/jay)\
**Replies:** 0\
**Last updated:** [March 14, 2025, 7:56pm UTC](https://community.silverbullet.md/t/space-lua-simple-html-colorpicker-for-current-selection/1972 "2025-03-14T19:56:56Z")

</div>

Hey guys, I made a simple little color picker tool/widget (twidget?) using space-lua Once activated, the tool lets you quickly visualize the color of any valid hex code that is currently selected. Features Visualize …

---

## [Render chess board from FEN](https://community.silverbullet.md/t/render-chess-board-from-fen/1898)

<div class="topic-metadata">

**Author:** [@Antoni](https://community.silverbullet.md/u/Antoni)\
**Replies:** 0\
**Last updated:** [March 2, 2025, 10:58am UTC](https://community.silverbullet.md/t/render-chess-board-from-fen/1898 "2025-03-02T10:58:57Z")

</div>

Hi there, I did a thing, for rendering chessboards and drawing some arrows and circles on it. I find it useful for studying theory, analyzing games (e.g. you can highlight all your glorious blunders, or show what were t…

---

## [Add "next Sunday" yyyy-MM-DD to your note with a {{next\[Day\]} date function](https://community.silverbullet.md/t/add-next-sunday-yyyy-mm-dd-to-your-note-with-a-next-day-date-function/260)

<div class="topic-metadata">

**Author:** [@SONDLecT](https://community.silverbullet.md/u/SONDLecT)\
**Replies:** 17\
**Last updated:** [February 23, 2025, 5:16pm UTC](https://community.silverbullet.md/t/add-next-sunday-yyyy-mm-dd-to-your-note-with-a-next-day-date-function/260 "2025-02-23T17:16:45Z")

</div>

NextDate Inserter This script adds functions that allow you to insert the yyyy-MM-DD date for the next \[day\]. e.g. {{nextMonday}} silverbullet.registerFunction({name: "nextSunday"}, () =\> { const currentDayOfWeek = ne…

---

## [Minimal headerless design](https://community.silverbullet.md/t/minimal-headerless-design/1118)

<div class="topic-metadata">

**Author:** [@majo](https://community.silverbullet.md/u/majo)\
**Replies:** 2\
**Last updated:** [February 21, 2025, 6:46am UTC](https://community.silverbullet.md/t/minimal-headerless-design/1118 "2025-02-21T06:46:53Z")

</div>

I just found out about SilverBullet and have really enjoyed the experience! For fun, I played around a bit with styling and created a “theme” some might enjoy. The header has the same background as the rest of the docum…

[Previous page](https://community.silverbullet.md/c/tricks-techniques/12.md?page=3)

[Next page](https://community.silverbullet.md/c/tricks-techniques/12.md?page=5)
