Skip to content

Instantly share code, notes, and snippets.

@thesved
thesved / roam-open-page-in-sidebar.js
Last active February 20, 2023 21:24
Open a page in Roam's sidebar POC
/*
* Open a page in Roam's sidebar POC, h/t @dvargas92495
* version: 0.4 Mutation Observer, returns Promise
* author: @ViktorTabori
* use: await openPageSidebar("Page Title")
*/
openPageSidebar = (function(){
var observer,
doLog = true, // console.log
running = false, // status;
/*
* Viktor's Roam Mobile Long tap to Exluce Filters and Right click on bullets + pages + title
* version: 0.3
* author: @ViktorTabori
*
* How to install it:
* - go to page [[roam/js]]
* - create a node with: { {[[roam/js]]}}
* - create a clode block under it, and change its type from clojure to javascript
* - allow the running of the javascript on the {{[[roam/js]]}} node
@media only screen and (max-width: 600px) {
/* main page */
.roam-article, .roam-center > div[style*="width: 100%; height: 100%;"] {
width: 200vw!important;
}
.roam-article, #all-pages-search, .roam-block-container {
max-width: 200vw!important;
}
}
/*
* Viktor's Roam Mobile Double tap to Exluce Filters and Right click on bullets
* version: 0.2
* author: @ViktorTabori
*
* How to install it:
* - go to page [[roam/js]]
* - create a node with: { {[[roam/js]]}}
* - create a clode block under it, and change its type from clojure to javascript
* - allow the running of the javascript on the {{[[roam/js]]}} node
Copy this to roam/js page, including the "{{[[roam/js]]}}" node:
- {{[[roam/js]]}}
- ```javascript
/*
* Roam template PoC by @ViktorTabori
* 0.1alpha
*
* How to install it:
* - go to `roam/js` page`
- [[✏️ literature notes]]
- author::
- source::
- date::
- tags::
- meta game::
- status:: [[in progress]]
- {{[[TODO]]}} meta data added
- {{[[TODO]]}} meta game added
- {{[[TODO]]}} quotes collected
- [[💎 permanent notes]]
- author::
- source::
- date::
- tags::
- meta game::
- status:: [[in progress]]
- {{[[TODO]]}} meta data added
- {{[[TODO]]}} meta game added
- {{[[TODO]]}} notes written
chrome.extension.sendMessage({}, function(response) {
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
clearInterval(readyStateCheckInterval);
var actions = [
[function(){return clickNode('.bp3-icon-more', '')}, 10],
[function(){return clickNode('a.bp3-menu-item', 'Export All')}, 10],
[function(){return clickNode('.bp3-dialog .bp3-button', 'Markdown')}, 10],
[function(){return clickNode('.bp3-dialog a.bp3-menu-item', 'JSON')}, 10],
- (In)Validated Table Example
- {{[[table]]}}
- {{[[embed]]: ((QcQfPuVk1))}}
- {{[[embed]]: ((ibFRCAD6x))}}
- {{[[embed]]: ((S-2e-IjsR))}}
- {{[[embed]]: ((-eUj_vvA_))}}
- {{[[embed]]: }}
- {{[[embed]]: }}
- {{[[embed]]: }}
- {{[[embed]]: }}