{{functions}} in Roam

This is a guide to {{functions}} in Roam. It is intended as a complete list, so if you know of any functions that are not described here, please do let me know!

{{alias: }}

Lets you reference another block by its block reference, and change the words displayed. Usually used to shorten the contents of an otherwise long block.

When you click on the alias, you will be taken to the original referenced block.


{{attr-table: }}

See Roam attributes for a full explanation, but essentially this builds tables of attributes that refer to their parent block. In the case below, the attributes Size::, Colour::, and Shape:: refer to Alice and Bob. Currently of limited use, but perhaps will improve when tables get sort and filter capabilities.


{{calc: }}

Can perform simple calculations (it uses the javascript calculation engine).

You can pass in block references too.


{{character-count}}

Displays a character count for its own block and its children blocks. Unlike {{word-count}}, {{character-count}} includes its own characters in the count.


{{chart: }}

I don’t know how this works. If someone knows, please let me know.


{{date}}

This pops up a date picker which you can navigate with your keyboard arrows or mouse.

When a date is selected, it becomes a clickable link to that date’s page.

Remember, dates in Roam are special pages that appear in Daily Notes.


{{diagram}}

Creates a whiteboard.

  • Add blocks by nesting them under the main {{diagram}} block.
  • Hold down Option⌥ and drag between two blocks to create a connecting line. Not sure how to remove these lines.
  • Hold down Option⌥ to drag a box to create a group. Delete a group by clicking on it and hitting backspace while your mouse button is down.

{{DONE}}

Creates a checked {{TODO}} item. Better to use {{[[DONE]]}} so that these items can appear in Queries.

Cycle between {{[[TODO]]}}, {{[[DONE]]}}, and plain text using the keyboard shortcut Cmd⌘-Enter⏎ (Mac) or Ctrl-Enter (Windows).


{{embed: }}

Embeds a block from elsewhere, including all of its children, or a page from elsewhere, without Linked and Unlinked References.

Block embed

Use the embed function with a block reference id in ((parentheses)).

Any edits you make to embedded block will be propagated to the referenced block. The referenced block and the original block are one and the same.

Page embed

Use the embed function with a page reference in [[brackets]].

A page embed can be expanded or contracted, but unlike a block embed, you can’t edit inline. Clicking on a page embed will open that page up in the sidebar.


{{encrypt}}

Encrypts a block of text with a passphrase that you specify. Type {{encrypt}} and hit enter. Then click on the block that says “Encrypted”.

Type in a Passphrase (don’t forget it) and a hint if you want. Hit submit.

Then type the data you want to be encrypted.

If you edit the block, you see the encrypted blob which is saved. If you forget your passphrase, you can’t decrypt the block.


{{iframe: }}

Allows you to embed a website into your Roam page. You can navigate that website just as normal.


{{kanban}}

Lets you create a Kanban board into your Roam page. Add columns and cards by nesting bullets below the Kanban board. First level nested bullets are columns. Second level nested bullets are cards. Moving cards will move the blocks below.


{{mentions: }}

Pulls in the “Linked References” and “Unlinked References” sections for a specified page.


{{or: }}

Allows you to create a simple dropdown. Block references don’t work, neither do [[embedded links]]. Fairly basic for now.


{{orphans}}

Provide a list of “orphaned” blocks that can’t be found on any page, because their parent block was deleted. Best to review this list every now and again, and either move or delete the blocks.

If you have no orphaned blocks, here’s what you see. This is good:


{{pdf: }}

Embeds a pdf file into your page. You need to supply a link to where the pdf file exists.

To upload your own pdfs, use /upload, select the pdf file which will get sent to Roam’s servers, and the {{pdf: }} link will automatically get created.


{{POMO}}

This creates a Pomodoro timer that you can click on to start at 25 min countdown timer with a 5 min break.


{{query: }}

Gives you the ability to search your Roam database for [[Pages]], using a variety of search logical operators: and, not, or, between. {{query}} works by checking each block (not each page) for the words you specify, and it returns the blocks that match the query. See How to query in Roam for a detailed guide.


{{slider}}

Creates a slider that you can slide from 1 to 10.

For pages with multiple authors, you can see where people have slid their slider to.


{{table}}

Creates a table in Roam. Add column headings then rows using nested bullets below the {{table}} function.


{{TaoOfRoam}}

Shows a spinning astrolabe, a favourite icon of Roam Research, and the icon that displays when your Roam database is loading.


{{TODO}}

Adds an unchecked checkbox to the block. Better to use {{[[TODO]]}} so that these items can appear in Queries.

When you check the {{TODO}} item, it becomes a {{DONE}} item. Cycle between {{[[TODO]]}}, {{[[DONE]]}}, and plain text using the keyboard shortcut Cmd⌘-Enter⏎ (Mac) or Ctrl-Enter (Windows).


{{word-count}}

Displays a word count for its own block and its children blocks. Unlike {{character-count}}, {{word-count}} does not include itself as a word.


{{youtube: }}

Embeds a Youtube video that you can watch in your Roam.


%d bloggers like this: