ARTICLE

The Article extension allows users to import articles into their Roam DB!

Installation

You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".

Manual Installation

If the extension doesn't work after using the copy extension button above, try installing manually using the instructions below.

First create a block with the text {{[[roam/js]]}} on any page in your Roam DB. Then, create a single child of this block type three back ticks. A code block should appear. Copy this code and paste it into the child code block in your graph:

var existing = document.getElementById("roamjs-article");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = "https://roamjs.com/article.js";
  extension.id = "roamjs-article";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}

Finally, click "Yes, I Know What I'm Doing".

Usage

In a block, type {{article}}. Similar to date picker, there will be an overlay that appears next to the article button. There will be a text input where you paste in the article's URL. Then, you could hit the IMPORT button and the contents of the article will be imported into your Roam DB!

The extension is making it's best guess on what content from the link is considered the article and what isn't. To help improve the extension over time, send article links that did not quite format correctly to support@roamjs.com.

If there is already an article link in a block, you could use the ALT+SHIFT+I or the OPT+SHIFT+I keyboard shortcut to automatically import the article from the link.

The overlay supports an "Indent Under Header" option. When checked, this will paste contents as children of each header in the article. To set this value globally, add a block with the text "Indent Under Header" in the roam/js/article page in your Roam DB.

This extension is also integrated with Smart Blocks! If you have both this extension and Roam42 installed, there will be a <%ARTICLE:[link]%> command available. Replace [link] with the desired url that you'd like to import. The command will automatically run the article import logic and paste the contents in the blocks before continuing with the rest of the workflow.

Demo

Contributors

This extension is brought to you by RoamJS! If you are facing any issues reach out to support@roamjs.com or click on the chat button on the bottom right. If you get value from using this extension, consider sponsoring RoamJS by clicking on the button below!

ROAMJS DIGEST

Add your email below to stay up to date on all RoamJS features, fixes, and news!

Other Extensions