Roam is a powerful tool that lacks visual bells and whistles. Many first-time users scratch their head why everyone is raving about this app. In Evernote and Notion, you at least get a visual editor. In Roam, you only get a cursor on a page with today’s date without any obvious way to make things pretty. Just plain text, isn’t that boring?
It’s actually one of Roam’s powers. With a plain text editor, we gain a lot of abilities for automation. By not having to worry about difficult formatting, it’s much easier to feed information into Roam.
In this lesson, we’ll quickly revisit Roam’s markup shortcodes and give you the shortcode for headings, before diving into how to set up templates.
Table of Contents
- An introduction to Roam-flavored Markdown
- Why use text templates?
- Create your own Roam shortcodes that turn into templates
- System-wide text expansion
- Browser-wide text expansion
- Roam-wide text expansion
- Low-tech: copy-paste
- Text template examples
An introduction to Roam-flavored Markdown
Markdown is a way to add formatting to plain text in a way that can be interpreted by text editors (like Roam). Mastering Markdown is easy and sets you on the path of becoming a keyboard-first user, which will speed up your workflow a lot.
If you’re going to use text templates that you create outside Roam (using an app or browser extension), you’ll need Markdown. If you’re going for the “Roam-native” expansion plugin we’re teaching you later, you can directly style your templates in Roam.
Roam-flavored Markdown | |
Bold | ** |
Italics | __ (double underscore) |
~~ | |
Highlight | ^^ |
Heading 1 * | # |
Heading 2 * | ## |
Heading 3 * | ### |
* These shortcodes only work in text templates, not when directly typed in Roam.
Why use text templates?
Roam has no inherent structure as it’s a tool for networked thinking; each block can connect to every block. But, there is some hierarchy on a page level; the way blocks are placed.
Many Roamans plan their pages with attributes and headings, to give their system some structure and make it easier to retrieve notes. But having to type the same thing again and again is wasteful. A programmer wouldn’t do that, and we’re here to become programmers of thoughts.
Early on, Roamans started to keep pages of text snippets that they use often. As Roam’s markup information is all in characters you can type, people could go completely wild.
Before long, other people pointed to text expanders, and now thousands of Roamans are creating their own Roam shortcuts each day. Some have 1000-character templates that they trigger with three keystrokes; the possibilities are almost endless.
We will now cover a few ways to reduce typing in Roam. Then, we share snippets we use ourselves so you get an idea of what’s possible.
Create your own Roam shortcodes that turn into templates
Now that you understand the power of text templates, let’s dive into the different ways to set up some automation for them. There are three ways, each requiring different tools and knowledge:
- System-wide: apps
- Browser-wide: extensions
- Roam-wide: JavaScript.
We’ll discuss each option briefly, starting with system-wide apps. Then, we move to the browser, and finish by walking you through an implementation specifically for Roam. Each approach has its advantages and disadvantages. Pick one:
- If you want to have access to templates on your whole system, go for a proper text expander app (requires a purchase).
- If you’re likely to use templates on other websites too, go for the browser extension.
- If you’re strapped for cash and are only likely to use shortcuts in Roam, go for the templates in Roam.
System-wide text expansion
In this category, we see famous apps like Alfred (Mac) and TextExpander (Mac, Windows, and mobile). The advantage of using a text expansion app is that you can use it anywhere on your system.
Want to set up templates for Word? Or email templates for Outlook? Use an app. You’ll be able to set up simple text templates, but they also have dynamic fields to insert other data—think of the time, date, or manual inputs.
If you go with TextExpander, your snippets will sync across all your devices. However, this costs you a yearly fee of $40. If you’re a Mac user and only need to have text templates on one device, Alfred is probably a better option with its one-time fee.
Browser-wide text expansion
We don’t have a lot of experience in the area of browser-based text expanders, but one tool that keeps popping up on our radar is Text Blaze. This is a free extension (while still in beta) that works in Chromium browsers (Chrome, Edge, Brave, Vivaldi).
Text Blaze works the same as system-wide apps, but only in your browser. Given that Roam currently is a web app, Text Blaze will be enough for most users.
Roam-wide text expansion
This is an experimental feature—it may not work for everybody.
If you have Roam42 installed, you can skip steps 1-5 and directly start creating your text templates (step 6).
Recently, another approach to text expansion came to our attention. Fellow Roaman Victor Tabori has written a Roam plugin that enables us to set up a text expander directly within Roam. It works with JavaScript, which sounds more complex than it actually is.
We now show you the steps to set it up. If you want a video walkthrough of this, check out this YouTube video by Les Kristofs.
Step 1: Create roam/js page
From any page in Roam, create a page titled roam/js by typing [[roam/js]]
.
Step 2: Enable JavaScript on roam/js page
Click the link so you’re on the roam/js page. There, enable JavaScript by typing {{[[roam/js]]}}
Step 3: Create a code block below the JavaScript block
Hit Enter and then Tab to create a child block under the JavaScript block. Now, we’re going to add a code editor.
In the new block, type /code and select the Code Block option from the trigger menu. Alternatively, type six backticks (``````
).
Or:
Click outside the block to show the code editor and set the language to JavaScript via the dropdown.
Step 4: Add plugin to code block
Now, go to Viktor Tabori’s Github page to get the code of the plugin. Copy everything from */
to the final }
(don’t include the last three backticks (```
)):
…
Step 5: Enable JavaScript
Now that everything is ready, click the button to activate the plugin.
Now, the block becomes yellow, indicating the code is being used by Roam. We can now set up our text templates!
Step 6: Set up text templates
From any page, create a link that starts with the template/ namespace. Any word that comes after the / will become your shortcode for text on that page.
For example, if I create a page titled template/book, every time I type :book:
it pastes all text that’s on the template/book page.
Now see it expand when I type :book:
Low-tech: copy-paste
Is all of this a bit too technical for you or do you rarely use templates?
Let’s forget automation for a moment and instead create a page with templates you can easily copy and paste. This is how most Roamans start out to reduce typing. As you find yourself using the same snippet again and again, you’ll know when it pays to set up a text expander.
Text template examples
Now that we’ve shown ways to set up a text expander, we want to give you some of our favorite templates. As all templates are just text, think of your own templates. Hopefully the template we offer will benefit you and trigger you to think of your own workflows.
Metadata: books, articles and videos
Many Roamans like to keep their highlights and notes from the content they consume. To easily retrieve this information, they add metadata.
Book template
- Author::
- Status::
- Tags::
- Recommended By::
- ## [[Key arguments and takeaways]]
- ## [[Inter-disciplinary connections]]
- ## [[Questions]]
- ## [[Notes]]
- ## [[Highlights]]
Article
- Author::
- Source::
- Tags::
- ## [[Notes]]
- ## [[Highlights]]
Video template
- Author::
- Status::
- Tags::
- Source::
- ## [[Key arguments and takeaways]]
- ## [[Inter-disciplinary connections]]
- ## [[Questions]]
- ## [[Notes]]
- ## [[Highlights]]
Checklists
You can use any Roam shortcode in your templates. Here’s an example of the checklist that Ramses uses for his blog posts:
- {{[[TODO]]}} What is the main question?
- {{[[TODO]]}} Why does the topic matter?
- {{[[TODO]]}} What are the constraints of the post? (Words, format)
- {{[[TODO]]}} Brain dump of what you know about the topic.
- {{[[TODO]]}} List pages/tags to check out.
- {{[[TODO]]}} Collect blocks.
- {{[[TODO]]}} Group blocks under headings.
- {{[[TODO]]}} Write a shitty first draft.
- {{[[TODO]]}} Collect icons for featured image.
- {{[[TODO]]}} Create first draft of featured image.
- {{[[TODO]]}} Write second draft/revise first draft.
- {{[[TODO]]}} Create second draft of featured image.
- {{[[TODO]]}} Proofread draft.
- {{[[TODO]]}} Put draft through Grammarly.
- {{[[TODO]]}} Add links to draft.
- {{[[TODO]]}} Add Front Matter template.
- {{[[TODO]]}} Write description.
- {{[[TODO]]}} Add featured image.
- {{[[TODO]]}} Publish article.
- {{[[TODO]]}} Test Twitter card in validator.
- {{[[TODO]]}} Draft Tweetstorm about post.
- {{[[TODO]]}} Check Tweetstorm in Grammarly.
- {{[[TODO]]}} Post Tweetstorm to private Twitter account for check.
- {{[[TODO]]}} Post Tweetstorm to main Twitter acount.
Writing/journal prompts
We’re a fan of daily journaling and use the template below. In this template, you’ll see there are tabs. You can copy-paste these templates as-is in most text expander apps/extensions. If you want to create your own template with nested blocks, use the tab button in your app/extension to add it (the Tab
key on your keyboard won’t help).
Morning journal
- Three things [[I'm grateful for]]:
-
-
-
- [[My intention]] for today:
-
Evening journal
- [[What went well today?]]
-
- [[What didn't go well?]]
-
- [[How could I do better tomorrow?]]
-
Need more inspiration?
Want to get more inspiration for text templates? Have a look at these resources:
Getting Started with Algorithms of Thought
Lukas Kawerau short how he uses Roam templates to guide his thinking. The article contains several ready-to-use templates.
Jonathan Borichevskiy’s daily template
Jonathan shares his daily template that contains his morning journal, daily tasks, and evening journal.
Templates and metadata thread on Roam forum
A good place for inspiration is the official Roam forum. In this thread, several Roamans share their favorite templates.
Using Roam as Your Daily Journal
Productivity vlogger Shu Omi shares in this video how he uses Roam as a daily journal. Although he copy-pastes his templates, they’re all suited for use in a automated text template.