Skip to content

Commit

Permalink
First attempt at switching to TickTick API
Browse files Browse the repository at this point in the history
This is **NOT** a working copy
  • Loading branch information
thesamim committed Sep 28, 2023
1 parent ba8d8e9 commit 42a7970
Show file tree
Hide file tree
Showing 28 changed files with 3,613 additions and 7,612 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "*"

env:
PLUGIN_NAME: ultimate-todoist-sync # Change this to match the id of your plugin.
PLUGIN_NAME: ultimate-TickTick-sync # Change this to match the id of your plugin.

jobs:
build:
Expand Down
19 changes: 0 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
## CHANGELOG
### prelease [1.0.38] - 2023-06-09

https://github.com/HeroBlackInk/ultimate-todoist-sync-for-obsidian/releases/tag/v1.0.38-beta

- New feature
- 1.0.38 beta now supports date formats for tasks.
- Todoist task link is added.

### prelease [1.0.37] - 2023-06-05

https://github.com/HeroBlackInk/ultimate-todoist-sync-for-obsidian/releases/tag/v1.0.37-beta

- New feature
- Two-way automatic synchronization, no longer need to manually click the sync button.
- Full vault sync option, automatically adding `#todoist` to all tasks.
- Notes/comments one-way synchronization from Todoist to Obsidian.
- Bug fix
- Fixed the bug of time zone conversion.
- Removed the "#" from the Todoist label.
- Update the obsidian link in Todoist after moving or renaming a file.
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Ultimate Todoist Sync for Obsidian
# Ultimate TickTick Sync for Obsidian

The Ultimate Todoist Sync plugin automatically creates tasks in Todoist and synchronizes task state between Obsidian and Todoist.
> [!important]
> This plugin is based on [Ultimate Todoist Sync for Obsidian](https://github.com/HeroBlackInk/ultimate-todoist-sync-for-obsidian)
> as of 2023-09-28 this is a work in progress, guarantied to fail. Just saving progress at this point.
The Ultimate TickTick Sync plugin automatically creates tasks in TickTick and synchronizes task state between Obsidian and TickTick.


## Demo
Expand All @@ -15,7 +19,7 @@ The Ultimate Todoist Sync plugin automatically creates tasks in Todoist and sync
## Features

###
| Feature | Sync from Obsidian to Todoist | Sync from Todoist to Obsidian | Description |
| Feature | Sync from Obsidian to TickTick | Sync from TickTick to Obsidian | Description |
|-------------------------|-------------------------------|-------------------------------|-------------|
| Add task || 🔜 | |
| Delete task || 🔜 | |
Expand All @@ -27,12 +31,12 @@ The Ultimate Todoist Sync plugin automatically creates tasks in Todoist and sync
| Mark task as uncompleted||| |
| Modify project | 🔜 | 🔜 | |
| Modify section | 🔜 | 🔜 | |
| Modify priority || 🔜 | Currently, task priority only support one-way synchronization from Todoist to Obsidian. |
| Modify priority || 🔜 | Currently, task priority only support one-way synchronization from TickTick to Obsidian. |
| Add reminder | 🔜 | 🔜 | |
| Move tasks between files| 🔜 | 🔜 | |
| Added-at date | 🔜 | 🔜 | |
| Completed-at date | 🔜 | 🔜 | |
| Task notes | 🔜 || Currently, task notes/comments only support one-way synchronization from Todoist to Obsidian. |
| Task notes | 🔜 || Currently, task notes/comments only support one-way synchronization from TickTick to Obsidian. |


## Installation
Expand All @@ -45,18 +49,18 @@ From Obsidian v1.3.5+, you can activate this plugin within Obsidian by doing the
2. Select the `Community plugins` tab on the left
3. Make sure `Restricted mode` is **off**
4. Click `Browse` next to `Community Plugins`
5. Search for and click on `Ultimate Todoist Sync`
5. Search for and click on `Ultimate TickTick Sync`
6. Click `Install`
7. Once installed, close the `Community Plugins` window
8. Under `Installed Plugins`, activate the `Ultimate Todoist Sync` plugin
8. Under `Installed Plugins`, activate the `Ultimate TickTick Sync` plugin

You can update the plugin following the same procedure, clicking `Update` instead of `Install`

### Manually

If you would rather install the plugin manually, you can do the following:

1. Download the latest release of the plugin from the [Releases](https://github.com/HeroBlackInk/ultimate-todoist-sync-for-obsidian/releases) page.
1. Download the latest release of the plugin from the [Releases](https://github.com/HeroBlackInk/ultimate-TickTick-sync-for-obsidian/releases) page.
2. Extract the downloaded zip file and copy the entire folder to your Obsidian plugins directory.
3. Enable the plugin in the Obsidian settings.

Expand All @@ -65,8 +69,8 @@ If you would rather install the plugin manually, you can do the following:

1. Open Obsidian's `Settings` window
2. Select the `Community plugins` tab on the left
3. Under `Installed plugins`, click the gear icon next to the `Ultimate Todoist Sync` plugin
4. Enter your Todoist API token
3. Under `Installed plugins`, click the gear icon next to the `Ultimate TickTick Sync` plugin
4. Enter your TickTick API token


## Settings
Expand All @@ -75,7 +79,7 @@ The time interval for automatic synchronization is set to 300 seconds by default
2. Default project
New tasks will be added to the default project, and you can change the default project in the settings.
3. Full vault sync
By enabling this option, the plugin will automatically add `#todoist` to all tasks, which will modify all files in the vault.
By enabling this option, the plugin will automatically add `#TickTick` to all tasks, which will modify all files in the vault.


## Usage
Expand All @@ -84,11 +88,11 @@ By enabling this option, the plugin will automatically add `#todoist` to all tas

| Syntax | Description | Example |
| --- | --- | --- |
|#todoist|Tasks marked with `#todoist` will be added to Todoist, while tasks without the `#todoist` tag will not be processed.If you have enabled Full vault sync in the settings, `#todoist` will be added automatically.| `- [ ] task #todoist`|
| 📅YYYY-MM-DD | The date format is 📅YYYY-MM-DD, indicating the due date of a task. | `- [ ] task content 📅2025-02-05 #todoist` <br>Supports the following calendar emojis.📅📆🗓🗓️|
| #projectTag | New tasks will be added to the default project(For example, inbox .), and you can change the default project in the settings or use a tag with the same name to specify a particular project. | `- [ ] taskA #todoist` will be added to inbox.<br>`- [ ] taskB #tag #testProject #todoist` will be added to testProject.|
| #tag | Note that all tags without a project of the same name are treated as normal tags | `- [ ] task #tagA #tagB #tagC #todoist` |
| `!!<number>` | The priority of the task (a number between 1 and 4, 4 for very urgent and 1 for natural).<br>**Note**: Keep in mind that very urgent is the priority 1 on clients. So, the priority 1 in the client corresponds to the number 4 here (Because that's how the official API of Todoist is designed.). | `- [ ] task !!4 #todoist` |
|#TickTick|Tasks marked with `#TickTick` will be added to TickTick, while tasks without the `#TickTick` tag will not be processed.If you have enabled Full vault sync in the settings, `#TickTick` will be added automatically.| `- [ ] task #TickTick`|
| 📅YYYY-MM-DD | The date format is 📅YYYY-MM-DD, indicating the due date of a task. | `- [ ] task content 📅2025-02-05 #TickTick` <br>Supports the following calendar emojis.📅📆🗓🗓️|
| #projectTag | New tasks will be added to the default project(For example, inbox .), and you can change the default project in the settings or use a tag with the same name to specify a particular project. | `- [ ] taskA #TickTick` will be added to inbox.<br>`- [ ] taskB #tag #testProject #TickTick` will be added to testProject.|
| #tag | Note that all tags without a project of the same name are treated as normal tags | `- [ ] task #tagA #tagB #tagC #TickTick` |
| `!!<number>` | The priority of the task (a number between 1 and 4, 4 for very urgent and 1 for natural).<br>**Note**: Keep in mind that very urgent is the priority 1 on clients. So, the priority 1 in the client corresponds to the number 4 here (Because that's how the official API of TickTick is designed.). | `- [ ] task !!4 #TickTick` |

### Set a default project for each file separately

Expand Down
55 changes: 41 additions & 14 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";

import { copy } from 'esbuild-plugin-copy';

import fs from 'fs';

const copyManifestPlugin = () => ({
name: 'copy-manifest-plugin',
setup(build) {
build.onEnd(async () => {
try {
fs.copyFileSync('./manifest.json', './dist/manifest.json');
} catch (e) {
console.error('Failed to copy file:', e);
}
});
},
});

const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
Expand Down Expand Up @@ -32,17 +49,27 @@ const context = await esbuild.context({
"@lezer/highlight",
"@lezer/lr",
...builtins],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outdir: './dist',
plugins: [
copy({
resolveFrom: 'cwd', // Returns name of current working directory
assets: {
from: ['./src/static/**/*'],
to: ['./dist'],
},
}),
copyManifestPlugin(),
],
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}
Loading

0 comments on commit 42a7970

Please sign in to comment.