yoyooyooo / roam-enhance

Enhance roam reasearch, similar to roam42's smartblock, except that it is triggered by a right-click menu
https://roam-enhance.vercel.app/main.js
6 stars 2 forks source link
extension roam roamresearch

enhance roam research, Quick start

before install

you should install roam42

install

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);

features

enhance right click menu

click on block bullet:

click on block bullet

click on page title:

click on page title

click on page title of sidebar:

click on page title of sidebar

change build-in menu and customize your own menu

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.

how to create your menu

By default, all menu options are wrapped with {{}}, when click a block'bullet, its children will be executed in the following three ways:

  1. <%menu:built-in menu name%>:

    Runs the built-in menu name

  2. javascript code, such as ```javascript````` :

    Run the code and output its return

  3. plain text:

    will be copied as a template

build-in menu

Relationship with roam42

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 demo

https://roamresearch.com/#/app/roam-enhance/page/0wvmci2X2

more document

see https://roamresearch.com/#/app/roam-enhance/page/sG3F86-49