This is a work in progress, and breaking changes to the setup/config could occur in the future. If you have any trouble, don't hesitate to create new Issues or contact me on the #roamist channel on Roam Slack. Sorry for any inconvenience.
CleanShot.2022-01-21.at.23.49.40.mp4
I have been using Todoist as my task management tool for a long time.
I still think that Roam Research is the best note-taking tool, but Todoist is more suitable for task management.
Since I started using Roam Research, I've wondered if it would be possible to use Todoist for task management but take detailed notes for each task in Roam Research.
This Roamist is one way to make this possible. With this integration, you can copy tasks from Todoist to Roam Research, complete Todoist tasks from within Roam Reasearch, and synchronize task completion status between Todoist and Roam Reserach.
- Todoist’s api token
- See: https://developer.todoist.com/rest/v1/#javascript-sdk
- You can get your token on https://todoist.com/prefs/integrations.
- roam42
- smartBlocks
- Create a block with
{{roam/js}}
and put the code below as a child block.- If you're not familiar with
{{roam/js}}
, see https://roamresearch.com/#/app/help/page/nBCwjGuI7.
- If you're not familiar with
window.TODOIST_TOKEN = "put your todoist token"; // Please replace with your token
window.Roamist = {};
window.Roamist.TODOIST_TAG_NAME = "Roamist"; // Please replace here with any tags what you want to use for this integration.
const ID = "roamist";
const existing = document.getElementById(ID);
if (!existing) {
const script = document.createElement("script");
script.src = "https://kdnk.github.io/roamist/dist/roamist.umd.js";
script.id = ID;
script.defer = true;
script.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
}
⚠️ All tasks pulled from Todoist should have a specific tag you set viawindow.Roamist.TODOIST_TAG_NAME
.
This tag is essential because this integration uses the tag to recognize which blocks come from Todoist.
I recommend you don’t change it once you set this tag.
See also workflows section for more details.
⚠️ You should already have the page namedroam/js/smartblocks
if you followedSetup
section.
If not, make sure you set up SmartBlocks correctly first.
- Paste some workflows what you like under workflows block on
[[roam/js/smartblocks]]
.- After finishing setup, your
[[roam/js/smartblocks]]
page should look like this.
- After finishing setup, your
- Then, you can use these workflows typing your SmartBlocks trigger (I use
jj
for it).
⚠️ This integration recognizes the Todoist id using a tag likeTodoist/1234567890
.
You must NOT remove this tag.
If you do, this integration won't work as intended.
- This workflow will pull tasks with the Todoist's Filters.
- Block will look like this.
- This command should work in any pages.
- arguments
todoistFilter
- You can pass your filter here.
onlyDiff
- If you pass
true
, this workflow pulls only tasks which don't exist in the current page.
- If you pass
- #SmartBlock todoist - pull daily today
- <%JAVASCRIPTASYNC:```javascript
(async function () {
await window.Roamist.pullTasks({ todoistFilter: "(#🧘Routine & #🦒Personal) & today", onlyDiff: false });
})();
```%>
⚠️ I assume we use this workflow in[[42Todoist]]
page or the page you set viawindow.Roamist.TODOIST_TAG_NAME
.
- This workflow will sync completion status from Todoist to Roam Research.
- If there are blocks which are already completed in Todoist,
{{[[TODO]]}}
part in Roam Research will be changed to{{[[DONE]]}}
automatically just pressing this button. - I recommend you use this workflow as a button in
[[42Todoist]]
as follows.
- #SmartBlock todoist - sync completed
- <%JAVASCRIPTASYNC:```javascript
(async function () {
await window.Roamist.syncCompleted();
})();
```%><%NOBLOCKOUTPUT%>
- This workflow will complete a task under your cursor.
- After running this workflow,
{{[[TODO]]}}
will turn into{{[[DONE]]}}
automatically.
- After running this workflow,
- #SmartBlock todoist - complete task
- <%JAVASCRIPTASYNC:```javascript
(async function () {
await window.Roamist.completeTask();
})();
```%>
- I recommend you set css for todoist's priority.
- #priority/p1 #priority/p2 #priority/p3 #priority/p4
- ```css
@import url('https://kdnk.github.io/roamist/src/css/priority.css');
```