enhance roam research, Quick start
you should install roam42
const old = document.getElementById("roam-enhance");
old && old.remove();
const s = document.createElement("script");
s.src = "https://roam-enhance.vercel.app/main.js";
// or
// s.src = "https://cdn.jsdelivr.net/gh/yoyooyooo/roam-enhance/dist/main.js";
s.id = "roam-enhance";
s.async = true;
s.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(s);
click on block bullet:
click on page title:
click on page title of sidebar:
you can create a page named roam/enhance/menu
,then right click the page title, there will be a menu called Pull all build-in menu
in the right click menu.
click it and then it will automatically pull the built-in menu on the current page.
At this point, you can freely change the order of these menus、delete them,or create your own menu.
Afterwards you can click
Pull unused build-in menu
to pull unused menu or new menu.
By default, all menu options are wrapped with {{}}, when click a block'bullet, its children will be executed in the following three ways:
<%menu:built-in menu name%>:
Runs the built-in menu name
javascript code, such as ```javascript````` :
Run the code and output its return
plain text:
will be copied as a template
Now,partially compatible with roam42. For some reason,you can use some of roam42's commands that are not output blocks, such as <%DATE:2021-06-06%>
, and You can't use commands that automatically output content in roam42,such like <%TODOOVERDUE:20%>
.
So your custom menu could look like this:
If you do not use <%JA:%>
but use ```javascript``` directly, you will get some convenience, you can use some variables starting with $ in javascript code directly:
console.log($ctx, $currentUid, $selectUids, $target, $pageTitle);
roam/enhance/menu
demohttps://roamresearch.com/#/app/roam-enhance/page/0wvmci2X2
see https://roamresearch.com/#/app/roam-enhance/page/sG3F86-49