Skip to content

Commit e45839a

Browse files
committed
feat(2do): add 2do protocol launcher support
1 parent f838105 commit e45839a

File tree

25 files changed

+1305
-0
lines changed

25 files changed

+1305
-0
lines changed

.changeset/fair-trams-tickle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'protocol-launcher': minor
3+
---
4+
5+
feat(2do): add 2do protocol launcher support

apps/docs/.vitepress/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default defineConfig({
3636
'en/apps/code-runner.md': 'apps/code-runner.md',
3737
'en/apps/codex.md': 'apps/codex.md',
3838
'en/apps/cursor.md': 'apps/cursor.md',
39+
'en/apps/2do.md': 'apps/2do.md',
3940
'en/apps/evernote.md': 'apps/evernote.md',
4041
'en/apps/fsnotes.md': 'apps/fsnotes.md',
4142
'en/apps/github-desktop.md': 'apps/github-desktop.md',
@@ -147,6 +148,7 @@ export default defineConfig({
147148
{ text: 'CodeRunner', link: '/apps/code-runner' },
148149
{ text: 'Codex', link: '/apps/codex' },
149150
{ text: 'Cursor', link: '/apps/cursor' },
151+
{ text: '2Do', link: '/apps/2do' },
150152
{ text: 'Evernote', link: '/apps/evernote' },
151153
{ text: 'FSNotes', link: '/apps/fsnotes' },
152154
{ text: 'GitHub Desktop', link: '/apps/github-desktop' },
@@ -263,6 +265,7 @@ export default defineConfig({
263265
{ text: 'CodeRunner', link: '/apps/code-runner' },
264266
{ text: 'Codex', link: '/apps/codex' },
265267
{ text: 'Cursor', link: '/apps/cursor' },
268+
{ text: '2Do', link: '/apps/2do' },
266269
{ text: 'Evernote', link: '/apps/evernote' },
267270
{ text: 'FSNotes', link: '/apps/fsnotes' },
268271
{ text: 'GitHub Desktop', link: '/apps/github-desktop' },
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
export const showListParams = {
2+
name: 'Work',
3+
}
4+
5+
export const searchParams = {
6+
text: 'John',
7+
}
8+
9+
export const searchOverdueParams = {
10+
text: 'type:overdue',
11+
}
12+
13+
export const addNewTaskParams = {
14+
ignoreDefaults: 1 as 0 | 1,
15+
}
16+
17+
export const addTaskParams = {
18+
task: 'Dinner at 8pm',
19+
due: '1',
20+
}
21+
22+
export const addTaskWithPriorityParams = {
23+
task: 'Important task',
24+
priority: 3 as 0 | 1 | 2 | 3,
25+
}
26+
27+
export const addTaskWithTagsParams = {
28+
task: 'Monthly subscription',
29+
tags: 'bill,payment',
30+
}
31+
32+
export const addTaskWithProjectParams = {
33+
task: 'Buy a new charger',
34+
forParentName: 'Shopping List',
35+
forList: 'Home',
36+
}
37+
38+
export const pasteParams = {
39+
text: 'Task 1\nTask 2\nTask 3',
40+
forList: 'Shopping',
41+
}
42+
43+
export const getTaskIDParams = {
44+
task: 'My Task',
45+
forList: 'Work',
46+
saveInClipboard: 1 as 0 | 1,
47+
}

apps/docs/en/apps/2do.md

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
---
2+
layout: doc
3+
---
4+
5+
<script setup lang="ts">
6+
import { ref, computed } from 'vue';
7+
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
8+
import { open, showAll, showToday, showStarred, showScheduled, showList, search, addNewTask, add, paste, getTaskID } from 'protocol-launcher/2do';
9+
import { SelectInstallationMethod } from '../../.vitepress/components';
10+
import {
11+
showListParams,
12+
searchParams,
13+
searchOverdueParams,
14+
addNewTaskParams,
15+
addTaskParams,
16+
addTaskWithPriorityParams,
17+
addTaskWithTagsParams,
18+
addTaskWithProjectParams,
19+
pasteParams,
20+
getTaskIDParams,
21+
} from '../../.vitepress/constants/2do';
22+
23+
const currentMethod = ref('On-Demand');
24+
const importPath = computed(() => currentMethod.value === 'On-Demand' ? 'protocol-launcher/2do' : 'protocol-launcher');
25+
</script>
26+
27+
# 2Do
28+
29+
[2Do](https://www.2doapp.com/) is a powerful personal task manager that supports GTD methodology and more. **Protocol Launcher** allows you to generate deep links to create tasks, search, and navigate lists in 2Do.
30+
31+
## Usage
32+
33+
There are two ways to use this library:
34+
35+
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
36+
- Full Import from the root package is convenient but includes all app modules.
37+
38+
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
39+
40+
<SelectInstallationMethod v-model="currentMethod" />
41+
42+
### Open App
43+
44+
```ts-vue [{{currentMethod}}]
45+
import { {{ currentMethod === 'On-Demand' ? 'open' : 'twoDo' }} } from '{{ importPath }}'
46+
47+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}open()
48+
```
49+
50+
<div class="flex justify-center">
51+
<VPLink :href="open()" target="_self">
52+
Open 2Do
53+
</VPLink>
54+
</div>
55+
56+
### Show All Tasks
57+
58+
```ts-vue [{{currentMethod}}]
59+
import { {{ currentMethod === 'On-Demand' ? 'showAll' : 'twoDo' }} } from '{{ importPath }}'
60+
61+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}showAll()
62+
```
63+
64+
<div class="flex justify-center">
65+
<VPLink :href="showAll()" target="_self">
66+
Show All Tasks
67+
</VPLink>
68+
</div>
69+
70+
### Show Today Tasks
71+
72+
```ts-vue [{{currentMethod}}]
73+
import { {{ currentMethod === 'On-Demand' ? 'showToday' : 'twoDo' }} } from '{{ importPath }}'
74+
75+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}showToday()
76+
```
77+
78+
<div class="flex justify-center">
79+
<VPLink :href="showToday()" target="_self">
80+
Show Today Tasks
81+
</VPLink>
82+
</div>
83+
84+
### Show Starred Tasks
85+
86+
```ts-vue [{{currentMethod}}]
87+
import { {{ currentMethod === 'On-Demand' ? 'showStarred' : 'twoDo' }} } from '{{ importPath }}'
88+
89+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}showStarred()
90+
```
91+
92+
<div class="flex justify-center">
93+
<VPLink :href="showStarred()" target="_self">
94+
Show Starred Tasks
95+
</VPLink>
96+
</div>
97+
98+
### Show Scheduled Tasks
99+
100+
```ts-vue [{{currentMethod}}]
101+
import { {{ currentMethod === 'On-Demand' ? 'showScheduled' : 'twoDo' }} } from '{{ importPath }}'
102+
103+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}showScheduled()
104+
```
105+
106+
<div class="flex justify-center">
107+
<VPLink :href="showScheduled()" target="_self">
108+
Show Scheduled Tasks
109+
</VPLink>
110+
</div>
111+
112+
### Show List
113+
114+
```ts-vue [{{currentMethod}}]
115+
import { {{ currentMethod === 'On-Demand' ? 'showList' : 'twoDo' }} } from '{{ importPath }}'
116+
117+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}showList({
118+
name: 'Work',
119+
})
120+
```
121+
122+
<div class="flex justify-center">
123+
<VPLink :href="showList(showListParams)" target="_self">
124+
Show Work List
125+
</VPLink>
126+
</div>
127+
128+
### Search Tasks
129+
130+
```ts-vue [{{currentMethod}}]
131+
import { {{ currentMethod === 'On-Demand' ? 'search' : 'twoDo' }} } from '{{ importPath }}'
132+
133+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}search({
134+
text: 'John',
135+
})
136+
```
137+
138+
<div class="flex justify-center">
139+
<VPLink :href="search(searchParams)" target="_self">
140+
Search for John
141+
</VPLink>
142+
</div>
143+
144+
### Search Overdue Tasks
145+
146+
```ts-vue [{{currentMethod}}]
147+
import { {{ currentMethod === 'On-Demand' ? 'search' : 'twoDo' }} } from '{{ importPath }}'
148+
149+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}search({
150+
text: 'type:overdue',
151+
})
152+
```
153+
154+
<div class="flex justify-center">
155+
<VPLink :href="search(searchOverdueParams)" target="_self">
156+
Search Overdue Tasks
157+
</VPLink>
158+
</div>
159+
160+
### Add New Task (Open Screen)
161+
162+
```ts-vue [{{currentMethod}}]
163+
import { {{ currentMethod === 'On-Demand' ? 'addNewTask' : 'twoDo' }} } from '{{ importPath }}'
164+
165+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}addNewTask({
166+
ignoreDefaults: 1,
167+
})
168+
```
169+
170+
<div class="flex justify-center">
171+
<VPLink :href="addNewTask(addNewTaskParams)" target="_self">
172+
Open New Task Screen
173+
</VPLink>
174+
</div>
175+
176+
### Add Task
177+
178+
```ts-vue [{{currentMethod}}]
179+
import { {{ currentMethod === 'On-Demand' ? 'add' : 'twoDo' }} } from '{{ importPath }}'
180+
181+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}add({
182+
task: 'Dinner at 8pm',
183+
due: '1',
184+
})
185+
```
186+
187+
<div class="flex justify-center">
188+
<VPLink :href="add(addTaskParams)" target="_self">
189+
Add Task
190+
</VPLink>
191+
</div>
192+
193+
### Add Task with Priority
194+
195+
```ts-vue [{{currentMethod}}]
196+
import { {{ currentMethod === 'On-Demand' ? 'add' : 'twoDo' }} } from '{{ importPath }}'
197+
198+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}add({
199+
task: 'Important task',
200+
priority: 3,
201+
})
202+
```
203+
204+
<div class="flex justify-center">
205+
<VPLink :href="add(addTaskWithPriorityParams)" target="_self">
206+
Add High Priority Task
207+
</VPLink>
208+
</div>
209+
210+
### Add Task with Tags
211+
212+
```ts-vue [{{currentMethod}}]
213+
import { {{ currentMethod === 'On-Demand' ? 'add' : 'twoDo' }} } from '{{ importPath }}'
214+
215+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}add({
216+
task: 'Monthly subscription',
217+
tags: 'bill,payment',
218+
})
219+
```
220+
221+
<div class="flex justify-center">
222+
<VPLink :href="add(addTaskWithTagsParams)" target="_self">
223+
Add Task with Tags
224+
</VPLink>
225+
</div>
226+
227+
### Add Task to Project
228+
229+
```ts-vue [{{currentMethod}}]
230+
import { {{ currentMethod === 'On-Demand' ? 'add' : 'twoDo' }} } from '{{ importPath }}'
231+
232+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}add({
233+
task: 'Buy a new charger',
234+
forParentName: 'Shopping List',
235+
forList: 'Home',
236+
})
237+
```
238+
239+
<div class="flex justify-center">
240+
<VPLink :href="add(addTaskWithProjectParams)" target="_self">
241+
Add Task to Project
242+
</VPLink>
243+
</div>
244+
245+
### Paste Text as Tasks
246+
247+
```ts-vue [{{currentMethod}}]
248+
import { {{ currentMethod === 'On-Demand' ? 'paste' : 'twoDo' }} } from '{{ importPath }}'
249+
250+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}paste({
251+
text: 'Task 1\nTask 2\nTask 3',
252+
forList: 'Shopping',
253+
})
254+
```
255+
256+
<div class="flex justify-center">
257+
<VPLink :href="paste(pasteParams)" target="_self">
258+
Paste as Tasks
259+
</VPLink>
260+
</div>
261+
262+
### Get Task ID
263+
264+
```ts-vue [{{currentMethod}}]
265+
import { {{ currentMethod === 'On-Demand' ? 'getTaskID' : 'twoDo' }} } from '{{ importPath }}'
266+
267+
const url = {{currentMethod === 'On-Demand' ? '' : 'twoDo.'}}getTaskID({
268+
task: 'My Task',
269+
forList: 'Work',
270+
saveInClipboard: 1,
271+
})
272+
```
273+
274+
<div class="flex justify-center">
275+
<VPLink :href="getTaskID(getTaskIDParams)" target="_self">
276+
Get Task ID
277+
</VPLink>
278+
</div>

apps/docs/en/guide/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ For detailed usage instructions for each application, please refer to their resp
136136
- [CodeRunner](../apps/code-runner.md)
137137
- [Codex](../apps/codex.md)
138138
- [Cursor](../apps/cursor.md)
139+
- [2Do](../apps/2do.md)
139140
- [Evernote](../apps/evernote.md)
140141
- [FSNotes](../apps/fsnotes.md)
141142
- [GitHub Desktop](../apps/github-desktop.md)

apps/docs/en/guide/what-is-it.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Currently, we support the following applications:
3939
- [CodeLite](../apps/codelite.md)
4040
- [Codex](../apps/codex.md)
4141
- [Cursor](../apps/cursor.md)
42+
- [2Do](../apps/2do.md)
4243
- [Evernote](../apps/evernote.md)
4344
- [FSNotes](../apps/fsnotes.md)
4445
- [GitHub Desktop](../apps/github-desktop.md)

0 commit comments

Comments
 (0)