Coffee Help
All topics

Help Finding notes

Obsidian bases

Mac

Obsidian's bases show in Coffee. Embed a .base file in a note, or write a code block named base, and its views appear under it as a table or a board of cards, with a tab for each view.

How to show a base

  1. Put ![[Books.base]] on a line of its own, using the name of a .base file in your library.
  2. Click away from the line. The base's first view appears in its place.
  3. Click a tab above the list to see another view. ![[Books.base#By status]] opens that view first.
  4. Click a row or card to open its note.

You can also write the base's YAML straight into a note, in a code block named base, as Obsidian allows.

Example

In Markdown
```base
filters:
  and:
    - file.hasTag("book")
    - 'status != "done"'
formulas:
  ppu: "(price / age).toFixed(2)"
views:
  - type: table
    name: Reading
    order: [file.name, status, price, formula.ppu]
    sort:
      - property: price
        direction: DESC
```

This lists every book you haven't finished as a table, priciest first, with a column worked out from two properties.

Good to know

  • Coffee reads filters with and, or and not, formulas, display names, sorting, limits and grouping. this.file means the note the base is shown in, so file.hasLink(this.file) lists the notes that link to it.
  • Table views show as tables. Kanban and cards views with a group show as a board. A view type Coffee doesn't draw, such as a map, shows as a table.
  • A function Coffee can't work out yet is named under the view, and that filter lets every note through rather than hiding them.
  • Coffee only reads bases. Change a base, or the notes' properties, in the files themselves.
  • Query blocks do the same job with a shorter syntax of Coffee's own.

Not what you needed? Write to a person.