Skip to content

Latest commit

History

History
65 lines (45 loc) 路 2.6 KB

ROAM_FILES.md

File metadata and controls

65 lines (45 loc) 路 2.6 KB

Roam饜儚Files (Research)

Roam Research 鉁嶏笍 Files Attachment Dashboard 馃梼

Upload files to custom servers rather than default Firebase storage, and manage your files in one place

the story begins from @RoamBounties

Quick Start

  1. Add a {{[[roam/js]]}} tag
  2. Add a child JavaScript code block to it with this code...
// 1. New token from https://github.com/settings/tokens/new?scopes=repo
// 2. Create your GitHub repo and choose savePath to upload images 馃憞馃憞馃憞馃憞馃憞馃憞
// e.g. https://raw.githubusercontent.com/JimmyLv/images/master/2021/1618990038204.png
// 3. optional? DROPBOX_APP_KEY https://www.dropbox.com/developers/saver
window.roamFiles = {
  DROPBOX_APP_KEY: 'PLEASE UPDATE TO YOURS!!!',
  GITHUB_ACCESS_TOKEN: 'PLEASE UPDATE TO YOURS!!!',
  repo: 'JimmyLv/images',
  branch: 'main',
  savePath: '2021',
  embedType: 'preview', // or 'edit'
}
window.URLScriptServer = "https://styled-roam.vercel.app/";
var existing = document.getElementById("roam-files");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = window.URLScriptServer + "file.js";
  extension.id = "roam-files";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}
  1. Update the window.roamFiles config and Press the BIG RED button

How to get your GITHUB_ACCESS_TOKEN

  1. Generate new token from https://github.com/settings/tokens/new?scopes=repo

0421-GoogleChrome-Newpersonalaccesstoken

  1. Create your GitHub repo (e.g. JimmyLv/images) here: https://repo.new

0421-GoogleChrome-CreateaNewRepository

  1. Update the window.roamFiles config in {{roam/js}}

0421-RoamResearch-roamjsfile-attachment

  1. Just Copy and Paste (Ctrl-C/Ctrl-V) to save image into Roam Research as normal

https://twitter.com/Jimmy_JingLv/status/1384795856939847684?s=20

How to get your DROPBOX_APP_KEY

Create a new @Dropbox app and get the APP_KEY here: https://www.dropbox.com/developers/saver

(don't forget to add http://roamresearch.com into the Saver domains, and File Permission Scopes)

5L5bjx