Beginner questions + huge thank you!

Hello community! I discovered SilverBullet yesterday from a reference in the Foam Discord server. I’ve watched all of Zef’s videos … twice :blush: - that’s how much I’m falling for this product. I spent quite a bit of time in the playground and finally this morning bit the bullet (no pun intended) and loaded SB on my Mac (via Deno) following the install steps.

I then created a new directory in my Documents folder called sb and then ran silverbullet . -p8080 (since I use port 3000 for React development). I can then access the app at http://127.0.0.1:8080/ as expected. Then I clicked the button to install the packages (32 of them). So, it seems like everything should be there, but …

In Zef’s videos and in the playground, there is an option to create a daily note. But I have no daily note option in my SB install. Pulling up the commands via ⌘/ and then typing ‘daily’ or ‘journal’ returns nothing. Is there a special package for the journal that I’m missing?

The 2nd issue I’m having is that I’m trying to resize a screen-capture that I pasted into a note. I’ve tried all forms of syntax including ![image|100](attachments/2024-06-22_14-41-01.png) but no matter what I try, the image takes up the full width, which, for this particular image, is not what I want.

And the final issue I’m having is more of a philosophical one, and that’s to do with tags. In Zef’s video, he creates a page called “Harry Potter” and then he adds some frontmatter to include tags for which he adds “book” and then a property (or attribute) for author. And what confuses me is this: suppose I wanted that Harry Potter page to represent both a book AND a movie? So on the tags line I’d add “book, movie” - but for the properties … then what? If I add a ‘director’ property, for instance, then it just “feels” off in that director is only an attribute of movie, not book. It seems like each tag should have its own set of properties, not a combined mix. But perhaps I’m totally misunderstanding, hence my outreach for guidance.

Oh … so sorry, two other minor questions if I haven’t already overdone it here are this:

(1) when I select a word and type [ the closing bracket automatically is added to the end - which is awesome. Ditto for (. But it’s not the case for or and I’m curious why that is.

(2) how can I use an escape character? I’d like --- to sometimes NOT result in displaying a full hr, but typing \--- displays the backslash, which I do not want.

Anyway, thank you for creating this amazing product. I’m eagerly looking forward to continuing my journey here.

Thank you so much!

Warmly,
Grace :heart:

1 Like

Hello Grace, and welcome!

This is perhaps something that changed since I recorded the intro video, the daily and weekly note templates are now in the “Journal” Library: Library/Journal — this link also describes how to install it.

This is a good question, but I don’t have a single solution here, I see two options:

  1. Just mix attributes. So indeed, if your page represents a book and a movie, you just accept that the attributes will also be mixed. This is similar to multiple inheritance, or implementing multiple interfaces in object-oriented programming, if you’re familiar with that.
  2. Since frontmatter is YAML, you can nest it if you like:
---
movie:
   director: Whoever
   screenplay: Some other person
book:
   author: J.K. Rowling
---

This will create nested attributes, which you can then query via where movie.director = "Whoever" for instance. If you have some pages that are only a movie and some that are both, and you don’t apply these attribute sets consistently it would get a bit messy.

This is not by design, just didn’t implement it, just create an issue for it: Typing a " or ' when text is selected, should surround the text with these quotes · Issue #896 · silverbulletmd/silverbullet · GitHub

2 Likes

Thank you so much!! Your comments on the tagging (and inheritance) make perfect sense. And I got the Journal implemented - most appreciated!

If you get a moment to give some guidance on my image sizing question (basically how to not have the image take up the full width) as well the escape character, that would be most helpful.

In the meantime, I seem to be missing a single command which I’ll post in a separate thread.

This product is incredibly powerful. I am really impressed so far. Is there a way we can make a financial contribution to this initiative?

Image sizing is a new feature only in the Edge build for now. I just documented it here: Attachments

Thank you. Trying to use the Edge Deno script results in the following error:

error: Module not found "https://silverbullet.md/silverbullet.js".

Hmm. I didn’t properly update this everywhere apparently. It’s https://edge.silverbullet.md/silverbullet.js

1 Like

FYI that I wrote my first space-script so that I could name the daily journal in a format like 2024-06-22_Sat. It’s so cool that we can do things like this!

silverbullet.registerFunction("dayOfWeek", () => {
  const date = new Date();
  const daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  const currentDayOfWeek = daysOfWeek[date.getDay()];
  return currentDayOfWeek;
})

Updating the Daily Note template with the following worked like a charm!

description: "Your daily note template"
tags: template
hooks.newPage:
  suggestedName: "Journal/Day/{{today}}_{{dayOfWeek}}"
  confirmName: false
  openIfExists: true
  forPrefix: "Journal/Day/"
  command: "Open Daily Note"
  key: "Alt-Shift-d"

I’m really loving SilverBullet!!

2 Likes