Working with Namespaces

To distinguish pages with a similar name, Roam has a feature called namespaces.

How to use namespaces

A namespace is always put in front of the page name and separated with a slash (/). An example of the use of namespaces are the roam/css and roam/js pages. In those cases, roam is the namespace.

We like to use namespaces to distinguish between books (Book/), articles (Article/), podcasts (Podcast/), and other types of content.

Showing, shortening, and hiding namespaces

Roam is showing namespaces by default. To shorten namespaces (show only the first letter) in links, use the key combination Ctrl-c then Ctrl-l. To completely hide namespaces in links, use the same combination again. And if you want to show the namespaces? You might have guessed it: use Ctrl-c then Ctrl-l again.

Alternatively, you can change how namespaces are shown via the Settings menu (accessible via the three dots (...) in the top menu):

Namespace settings

When a link contains a shortened or hidden namespace, the color of the link will also change from blue to green (using Roam’s original theme):

Full namespace

Full namespace

Abbreviated namespace

Abbreviated namespace

Hidden namespace

Hidden namespace

Current usefulness of namespaces

Apart from its main function of distinguishing different types of pages, namespaces don’t do much yet. For example, you can’t filter on namespaces.

And if you try to extend its usefulness by turning the namespace into a [[link]], you’re out of luck; that breaks the namespace functionality. Roam doesn’t hide namespaces (when enabled) in names that contain a link, effectively rendering it useless.

It does have one extra use: when you export your Roam database to Markdown files, namespaces become folders with the associated pages in that folder:

Namespaces markdown export

Was this helpful?