|
| 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, capture, search, showAgenda, showTasks, viewFile } from 'protocol-launcher/beorg'; |
| 9 | +import { SelectInstallationMethod } from '../../.vitepress/components'; |
| 10 | +import { |
| 11 | + captureParams, |
| 12 | + captureWithDeadlineParams, |
| 13 | + searchParams, |
| 14 | + searchWithCallbackParams, |
| 15 | + showTasksParams, |
| 16 | + viewFileParams, |
| 17 | +} from '../../.vitepress/constants/beorg'; |
| 18 | + |
| 19 | +const currentMethod = ref('On-Demand'); |
| 20 | +const importPath = computed(() => currentMethod.value === 'On-Demand' ? 'protocol-launcher/beorg' : 'protocol-launcher'); |
| 21 | +</script> |
| 22 | + |
| 23 | +# Beorg |
| 24 | + |
| 25 | +[Beorg](https://www.beorgapp.com/) is a powerful task management app for iPhone and iPad that uses plain text files in Org mode syntax. **Protocol Launcher** allows you to generate deep links to open Beorg, capture tasks, search for items, and view your agenda and tasks. |
| 26 | + |
| 27 | +## Usage |
| 28 | + |
| 29 | +There are two ways to use this library: |
| 30 | + |
| 31 | +- On-Demand import from subpaths enables tree-shaking and keeps bundles small. |
| 32 | +- Full Import from the root package is convenient but includes all app modules. |
| 33 | + |
| 34 | +Pick On-Demand for production builds; Full Import is fine for quick scripts or demos. |
| 35 | + |
| 36 | +<SelectInstallationMethod v-model="currentMethod" /> |
| 37 | + |
| 38 | +### Open Beorg |
| 39 | + |
| 40 | +```ts-vue [{{currentMethod}}] |
| 41 | +import { {{ currentMethod === 'On-Demand' ? 'open' : 'beorg' }} } from '{{ importPath }}' |
| 42 | +
|
| 43 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}open() |
| 44 | +``` |
| 45 | + |
| 46 | +<div class="flex justify-center"> |
| 47 | + <VPLink :href="open()" target="_self"> |
| 48 | + Open Beorg |
| 49 | + </VPLink> |
| 50 | +</div> |
| 51 | + |
| 52 | +### Capture |
| 53 | + |
| 54 | +Add a new item to Beorg (capture). |
| 55 | + |
| 56 | +```ts-vue [{{currentMethod}}] |
| 57 | +import { {{ currentMethod === 'On-Demand' ? 'capture' : 'beorg' }} } from '{{ importPath }}' |
| 58 | +
|
| 59 | +// Capture with title, notes, schedule and file |
| 60 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}capture({ |
| 61 | + title: 'Shopping List', |
| 62 | + notes: 'Buy eggs', |
| 63 | + scheduled: '2017-10-03', |
| 64 | + file: 'shopping', |
| 65 | +}) |
| 66 | +
|
| 67 | +// Capture with deadline, template and edit option |
| 68 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}capture({ |
| 69 | + title: 'New task', |
| 70 | + notes: 'Complete project', |
| 71 | + deadline: '2017-10-10', |
| 72 | + template: 'Daily Review', |
| 73 | + edit: true, |
| 74 | +}) |
| 75 | +``` |
| 76 | + |
| 77 | +<div class="flex flex-col gap-4 items-center"> |
| 78 | + <VPLink :href="capture(captureParams)" target="_self"> |
| 79 | + Capture Task |
| 80 | + </VPLink> |
| 81 | + <VPLink :href="capture(captureWithDeadlineParams)" target="_self"> |
| 82 | + Capture with Deadline |
| 83 | + </VPLink> |
| 84 | +</div> |
| 85 | + |
| 86 | +### Search |
| 87 | + |
| 88 | +Search for items in Beorg and return results as JSON. |
| 89 | + |
| 90 | +```ts-vue [{{currentMethod}}] |
| 91 | +import { {{ currentMethod === 'On-Demand' ? 'search' : 'beorg' }} } from '{{ importPath }}' |
| 92 | +
|
| 93 | +// Simple search |
| 94 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}search({ |
| 95 | + search: 't bookmark', |
| 96 | +}) |
| 97 | +
|
| 98 | +// Search with callback URL |
| 99 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}search({ |
| 100 | + search: 't bookmark', |
| 101 | + xSuccess: 'shortcuts://x-callback-url/run-shortcut?name=ProcessResults', |
| 102 | +}) |
| 103 | +``` |
| 104 | + |
| 105 | +<div class="flex flex-col gap-4 items-center"> |
| 106 | + <VPLink :href="search(searchParams)" target="_self"> |
| 107 | + Search in Beorg |
| 108 | + </VPLink> |
| 109 | + <VPLink :href="search(searchWithCallbackParams)" target="_self"> |
| 110 | + Search with Callback |
| 111 | + </VPLink> |
| 112 | +</div> |
| 113 | + |
| 114 | +### Show Agenda |
| 115 | + |
| 116 | +Show the agenda in Beorg. |
| 117 | + |
| 118 | +```ts-vue [{{currentMethod}}] |
| 119 | +import { {{ currentMethod === 'On-Demand' ? 'showAgenda' : 'beorg' }} } from '{{ importPath }}' |
| 120 | +
|
| 121 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}showAgenda() |
| 122 | +``` |
| 123 | + |
| 124 | +<div class="flex justify-center"> |
| 125 | + <VPLink :href="showAgenda()" target="_self"> |
| 126 | + Show Agenda |
| 127 | + </VPLink> |
| 128 | +</div> |
| 129 | + |
| 130 | +### Show Tasks |
| 131 | + |
| 132 | +Show the tasks tab in Beorg, optionally with a search filter. |
| 133 | + |
| 134 | +```ts-vue [{{currentMethod}}] |
| 135 | +import { {{ currentMethod === 'On-Demand' ? 'showTasks' : 'beorg' }} } from '{{ importPath }}' |
| 136 | +
|
| 137 | +// Show all tasks |
| 138 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}showTasks({}) |
| 139 | +
|
| 140 | +// Show tasks with search filter |
| 141 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}showTasks({ |
| 142 | + search: 't bookmark', |
| 143 | +}) |
| 144 | +``` |
| 145 | + |
| 146 | +<div class="flex flex-col gap-4 items-center"> |
| 147 | + <VPLink :href="showTasks({})" target="_self"> |
| 148 | + Show All Tasks |
| 149 | + </VPLink> |
| 150 | + <VPLink :href="showTasks(showTasksParams)" target="_self"> |
| 151 | + Show Tasks with Filter |
| 152 | + </VPLink> |
| 153 | +</div> |
| 154 | + |
| 155 | +### View File |
| 156 | + |
| 157 | +View a specific file in Beorg. |
| 158 | + |
| 159 | +```ts-vue [{{currentMethod}}] |
| 160 | +import { {{ currentMethod === 'On-Demand' ? 'viewFile' : 'beorg' }} } from '{{ importPath }}' |
| 161 | +
|
| 162 | +const url = {{currentMethod === 'On-Demand' ? '' : 'beorg.'}}viewFile({ |
| 163 | + file: 'shopping', |
| 164 | +}) |
| 165 | +``` |
| 166 | + |
| 167 | +<div class="flex justify-center"> |
| 168 | + <VPLink :href="viewFile(viewFileParams)" target="_self"> |
| 169 | + View File |
| 170 | + </VPLink> |
| 171 | +</div> |
0 commit comments