Using Namespaces Instead of Prefixes in Roam Research
Some Roam Research users use page title prefixes in order to quickly differentiate between different types of content. E.g.: “B: How To Take Smart Notes” for the book, and “A: How To Take Smart Notes” for an article about it.
Roam Research has a feature built-in with similar advantages and additional features: namesspaces.
Namespaces are, and are simply created, by using a backslash / in the page title. In our examples we might end up with “Book/How To Take Smart Notes” and “Article/How To Take Smart Notes”
Added Advantages
Semi-Automatic Namespace Collation
Typing [[Book/How To Take Smart Notes]] somewhere will:
- Create the page Book/How To Take Smart Notes
- If you go to the page [[Book]], the link, your mention of the page, will show up under Unlinked References.
- If you go to the page [[How To Take Smart Notes]], the link, your mention of the page, shows up there under Unlinked References as well.
Note that [[Book/How To Take Smart Notes]] is just a page title, just like any other, so in and by itself it will not make the page show up as a reference on the Book page.
Folders on Export
When doing an export to Markdown, the namespaces will become folders, and the last part of the namespace will be a regular file in that folder.
This has two advantages:
- Natively avoids name collission
- File system safe filenames. Prefixing a page title with something like “B: How To Take Smart Notes” can cause problems when extracting your ZIP file in Windows, as the colon is a forbidden character in filenames. Utilities like 7zip can replace the forbidden character with an underscore, but this will break your links to the file in the other files.
Clean Display Options
The initial default for displaying namespace links is to show the whole link.
Using the shortcut sequence CTRL C followed by CTRL L you can cycle through that option, abbreviated, or isolated:
- [[Book/How To Take Smart Notes]]
- [[B/How To Take Smart Notes]]
- [[How To Take Smart Notes]]
The color of the links will change according, so visually it is readily apparent 2 & 3 are namespace links
3 Replies to “Using Namespaces Instead of Prefixes in Roam Research”
this is excellent! you are slowly. nudging me in the direction of Roam. I wish TheBrain would shortcut types this way while creating thoughts!
I’ve stuck with the tool since December 2019, and it grows on you. First used it as a notepad, then a CMS, but eventually things started to fall in place for more. Combined with the Readwise integration, which now also includes Feedly notes/highlights, and their customizable export templates for Roam, it is just shaping up to be the place for my knowledge and writing.
I usually use 2-3 tools, with Evernote still being the place where “everything” ends up, if not for the fact I have 15+ years notes in it, but it is looking like I prefer Roam over TheBrain.Not that TB is bad or anything like that; it’s just that I tend to store articles and highlights in TheBrain, but tend to *work* with notes in Roam.
If you have any questions, feel free to ask here or hit me up on htps://twitter.com/ruudhein
I’ve been using prefixes for virtually everything (B: Book, P: Podcast, Z: Zettel, etc) and this looks like a much better approach
Now I just have to figure out a way to mass update all those page names to convert B: Book Title to Book/Book Title (please let me know if you have a suggestion)
Using namespace also makes sense because more features will likely be developed for it in the future