Skip to content

Commit 5704443

Browse files
committed
feat(ulysses): add ulysses protocol launcher support
1 parent 0de5367 commit 5704443

File tree

25 files changed

+1393
-4
lines changed

25 files changed

+1393
-4
lines changed

.changeset/brown-bikes-hammer.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(ulysses): add ulysses protocol launcher support

apps/docs/.vitepress/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export default defineConfig({
118118
'en/apps/trae.md': 'apps/trae.md',
119119
'en/apps/trae-cn.md': 'apps/trae-cn.md',
120120
'en/apps/trello.md': 'apps/trello.md',
121+
'en/apps/ulysses.md': 'apps/ulysses.md',
121122
'en/apps/upic.md': 'apps/upic.md',
122123
'en/apps/verdent.md': 'apps/verdent.md',
123124
'en/apps/vscode.md': 'apps/vscode.md',
@@ -274,6 +275,7 @@ export default defineConfig({
274275
{ text: 'Trae', link: '/apps/trae' },
275276
{ text: 'Trae China', link: '/apps/trae-cn' },
276277
{ text: 'Trello', link: '/apps/trello' },
278+
{ text: 'Ulysses', link: '/apps/ulysses' },
277279
{ text: 'uPic', link: '/apps/upic' },
278280
{ text: 'Verdent', link: '/apps/verdent' },
279281
{ text: 'VS Code', link: '/apps/vscode' },
@@ -436,6 +438,7 @@ export default defineConfig({
436438
{ text: 'Trae', link: '/apps/trae' },
437439
{ text: 'Trae China', link: '/apps/trae-cn' },
438440
{ text: 'Trello', link: '/apps/trello' },
441+
{ text: 'Ulysses', link: '/apps/ulysses' },
439442
{ text: 'uPic', link: '/apps/upic' },
440443
{ text: 'Verdent', link: '/apps/verdent' },
441444
{ text: 'VS Code', link: '/apps/vscode' },
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
export const openItemParams = {
2+
id: 'DCj45UWKr_g15y2vBPwJdQ',
3+
}
4+
5+
export const newSheetParams = {
6+
text: 'My new sheet content',
7+
group: '/Books',
8+
format: 'markdown' as const,
9+
index: 0,
10+
}
11+
12+
export const insertParams = {
13+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
14+
text: 'Inserted text',
15+
format: 'markdown' as const,
16+
position: 'end' as const,
17+
newline: 'prepend' as const,
18+
}
19+
20+
export const attachNoteParams = {
21+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
22+
text: 'My new note',
23+
format: 'markdown' as const,
24+
}
25+
26+
export const attachKeywordsParams = {
27+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
28+
keywords: 'Draft,Important',
29+
}
30+
31+
export const newGroupParams = {
32+
name: 'My Group',
33+
parent: '/Books',
34+
index: 0,
35+
}
36+
37+
export const copyParams = {
38+
id: 'hZ7IX2jqKbVmPGlYUXkZjQ',
39+
targetGroup: 'H8zLAmc1I0njH-0Ql-3YGQ',
40+
index: 4,
41+
}

apps/docs/en/apps/ulysses.md

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
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, openItem, newSheet, insert, attachNote, attachKeywords, newGroup, copy, openAll, openFavorites, openRecent } from 'protocol-launcher/ulysses';
9+
import { SelectInstallationMethod } from '../../.vitepress/components';
10+
import { openItemParams, newSheetParams, insertParams, attachNoteParams, attachKeywordsParams, newGroupParams, copyParams } from '../../.vitepress/constants/ulysses';
11+
12+
const currentMethod = ref('On-Demand');
13+
const importPath = computed(() => currentMethod.value === 'On-Demand' ? 'protocol-launcher/ulysses' : 'protocol-launcher');
14+
</script>
15+
16+
# Ulysses
17+
18+
[Ulysses](https://ulysses.app/) is a powerful writing app for Mac, iPad and iPhone. **Protocol Launcher** allows you to generate deep links to create and manage sheets, groups, and notes in Ulysses.
19+
20+
## Usage
21+
22+
There are two ways to use this library:
23+
24+
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
25+
- Full Import from the root package is convenient but includes all app modules.
26+
27+
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
28+
29+
<SelectInstallationMethod v-model="currentMethod" />
30+
31+
### Open App
32+
33+
```ts-vue [{{currentMethod}}]
34+
import { {{ currentMethod === 'On-Demand' ? 'open' : 'ulysses' }} } from '{{ importPath }}'
35+
36+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}open()
37+
```
38+
39+
<div class="flex justify-center">
40+
<VPLink :href="open()" target="_self">
41+
Open Ulysses
42+
</VPLink>
43+
</div>
44+
45+
### Open Item
46+
47+
Open a sheet or group by identifier, name, or path.
48+
49+
```ts-vue [{{currentMethod}}]
50+
import { {{ currentMethod === 'On-Demand' ? 'openItem' : 'ulysses' }} } from '{{ importPath }}'
51+
52+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}openItem({
53+
id: 'DCj45UWKr_g15y2vBPwJdQ',
54+
})
55+
```
56+
57+
<div class="flex justify-center">
58+
<VPLink :href="openItem(openItemParams)" target="_self">
59+
Open Item in Ulysses
60+
</VPLink>
61+
</div>
62+
63+
### New Sheet
64+
65+
Create a new sheet with optional content, group, format, and position.
66+
67+
```ts-vue [{{currentMethod}}]
68+
import { {{ currentMethod === 'On-Demand' ? 'newSheet' : 'ulysses' }} } from '{{ importPath }}'
69+
70+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}newSheet({
71+
text: 'My new sheet content',
72+
group: '/Books',
73+
format: 'markdown',
74+
index: 0,
75+
})
76+
```
77+
78+
<div class="flex justify-center">
79+
<VPLink :href="newSheet(newSheetParams)" target="_self">
80+
Create New Sheet
81+
</VPLink>
82+
</div>
83+
84+
### Insert Text
85+
86+
Insert or append text to an existing sheet.
87+
88+
```ts-vue [{{currentMethod}}]
89+
import { {{ currentMethod === 'On-Demand' ? 'insert' : 'ulysses' }} } from '{{ importPath }}'
90+
91+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}insert({
92+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
93+
text: 'Inserted text',
94+
format: 'markdown',
95+
position: 'end',
96+
newline: 'prepend',
97+
})
98+
```
99+
100+
<div class="flex justify-center">
101+
<VPLink :href="insert(insertParams)" target="_self">
102+
Insert Text in Ulysses
103+
</VPLink>
104+
</div>
105+
106+
### Attach Note
107+
108+
Attach a note to a sheet.
109+
110+
```ts-vue [{{currentMethod}}]
111+
import { {{ currentMethod === 'On-Demand' ? 'attachNote' : 'ulysses' }} } from '{{ importPath }}'
112+
113+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}attachNote({
114+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
115+
text: 'My new note',
116+
format: 'markdown',
117+
})
118+
```
119+
120+
<div class="flex justify-center">
121+
<VPLink :href="attachNote(attachNoteParams)" target="_self">
122+
Attach Note in Ulysses
123+
</VPLink>
124+
</div>
125+
126+
### Attach Keywords
127+
128+
Add keywords to a sheet.
129+
130+
```ts-vue [{{currentMethod}}]
131+
import { {{ currentMethod === 'On-Demand' ? 'attachKeywords' : 'ulysses' }} } from '{{ importPath }}'
132+
133+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}attachKeywords({
134+
id: 'H8zLAmc1I0njH-0Ql-3YGQ',
135+
keywords: 'Draft,Important',
136+
})
137+
```
138+
139+
<div class="flex justify-center">
140+
<VPLink :href="attachKeywords(attachKeywordsParams)" target="_self">
141+
Attach Keywords in Ulysses
142+
</VPLink>
143+
</div>
144+
145+
### New Group
146+
147+
Create a new group for organizing sheets.
148+
149+
```ts-vue [{{currentMethod}}]
150+
import { {{ currentMethod === 'On-Demand' ? 'newGroup' : 'ulysses' }} } from '{{ importPath }}'
151+
152+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}newGroup({
153+
name: 'My Group',
154+
parent: '/Books',
155+
index: 0,
156+
})
157+
```
158+
159+
<div class="flex justify-center">
160+
<VPLink :href="newGroup(newGroupParams)" target="_self">
161+
Create New Group
162+
</VPLink>
163+
</div>
164+
165+
### Copy Item
166+
167+
Copy a sheet or group to a target location.
168+
169+
```ts-vue [{{currentMethod}}]
170+
import { {{ currentMethod === 'On-Demand' ? 'copy' : 'ulysses' }} } from '{{ importPath }}'
171+
172+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}copy({
173+
id: 'hZ7IX2jqKbVmPGlYUXkZjQ',
174+
targetGroup: 'H8zLAmc1I0njH-0Ql-3YGQ',
175+
index: 4,
176+
})
177+
```
178+
179+
<div class="flex justify-center">
180+
<VPLink :href="copy(copyParams)" target="_self">
181+
Copy Item in Ulysses
182+
</VPLink>
183+
</div>
184+
185+
### Open All
186+
187+
Open the special "All" group showing all sheets.
188+
189+
```ts-vue [{{currentMethod}}]
190+
import { {{ currentMethod === 'On-Demand' ? 'openAll' : 'ulysses' }} } from '{{ importPath }}'
191+
192+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}openAll()
193+
```
194+
195+
<div class="flex justify-center">
196+
<VPLink :href="openAll()" target="_self">
197+
Open All in Ulysses
198+
</VPLink>
199+
</div>
200+
201+
### Open Favorites
202+
203+
Open the special "Favorites" group.
204+
205+
```ts-vue [{{currentMethod}}]
206+
import { {{ currentMethod === 'On-Demand' ? 'openFavorites' : 'ulysses' }} } from '{{ importPath }}'
207+
208+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}openFavorites()
209+
```
210+
211+
<div class="flex justify-center">
212+
<VPLink :href="openFavorites()" target="_self">
213+
Open Favorites in Ulysses
214+
</VPLink>
215+
</div>
216+
217+
### Open Recent
218+
219+
Open the special "Last 7 Days" (Recent) group.
220+
221+
```ts-vue [{{currentMethod}}]
222+
import { {{ currentMethod === 'On-Demand' ? 'openRecent' : 'ulysses' }} } from '{{ importPath }}'
223+
224+
const url = {{currentMethod === 'On-Demand' ? '' : 'ulysses.'}}openRecent()
225+
```
226+
227+
<div class="flex justify-center">
228+
<VPLink :href="openRecent()" target="_self">
229+
Open Recent in Ulysses
230+
</VPLink>
231+
</div>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ For detailed usage instructions for each application, please refer to their resp
223223
- [Trae](../apps/trae.md)
224224
- [Trae China](../apps/trae-cn.md)
225225
- [Trello](../apps/trello.md)
226+
- [Ulysses](../apps/ulysses.md)
226227
- [uPic](../apps/upic.md)
227228
- [Verdent](../apps/verdent.md)
228229
- [VS Code](../apps/vscode.md)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Currently, we support the following applications:
121121
- [Trae](../apps/trae.md)
122122
- [Trae China](../apps/trae-cn.md)
123123
- [Trello](../apps/trello.md)
124+
- [Ulysses](../apps/ulysses.md)
124125
- [uPic](../apps/upic.md)
125126
- [Verdent](../apps/verdent.md)
126127
- [VS Code](../apps/vscode.md)

0 commit comments

Comments
 (0)