schedule management
and to-do list
management",
19 | "zh_CN": "汇总散落在整个工作空间的任务,依托任务列表实现日程管理
和待办事项
管理"
20 | },
21 | "readme": {
22 | "default": "README.md",
23 | "zh_CN": "README_zh_CN.md"
24 | },
25 | "i18n": [
26 | "en_US",
27 | "zh_CN"
28 | ],
29 | "funding": {
30 | "openCollective": "",
31 | "patreon": "",
32 | "github": "",
33 | "custom": [
34 | "https://sylwair.com"
35 | ]
36 | },
37 | "keywords": [
38 | "task",
39 | "todo",
40 | "list",
41 | "任务",
42 | "代办",
43 | "列表"
44 | ]
45 | }
--------------------------------------------------------------------------------
/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syh19/siyuan-plugin-task-list/c175e2d325e32de96a45ded3bd8677a372a23348/preview.png
--------------------------------------------------------------------------------
/scripts/.gitignore:
--------------------------------------------------------------------------------
1 | .venv
2 | build
3 | dist
4 | *.exe
5 | *.spec
6 |
--------------------------------------------------------------------------------
/scripts/make_dev_link.js:
--------------------------------------------------------------------------------
1 | import fs from 'fs'
2 | import readline from 'node:readline'
3 |
4 |
5 | //************************************ Write you dir here ************************************
6 |
7 | //Please write the "workspace/data/plugins" directory here
8 | //请在这里填写你的 "workspace/data/plugins" 目录
9 | let targetDir = ''
10 | //Like this
11 |
12 | // const targetDir = `H:\\SiYuanDevSpace\\data\\plugins`;
13 | //********************************************************************************************
14 |
15 | const log = console.log
16 |
17 | async function getSiYuanDir () {
18 | let url = 'http://127.0.0.1:6806/api/system/getWorkspaces'
19 | let header = {
20 | // "Authorization": `Token ${token}`,
21 | "Content-Type": "application/json",
22 | }
23 | let conf = {}
24 | try {
25 | let response = await fetch(url, {
26 | method: 'POST',
27 | headers: header
28 | })
29 | if (response.ok) {
30 | conf = await response.json()
31 | } else {
32 | log(`HTTP-Error: ${response.status}`)
33 | return null
34 | }
35 | } catch (e) {
36 | log("Error:", e)
37 | log("Please make sure SiYuan is running!!!")
38 | return null
39 | }
40 | return conf.data
41 | }
42 |
43 | async function chooseTarget (workspaces) {
44 | let count = workspaces.length
45 | log(`Got ${count} SiYuan ${count > 1 ? 'workspaces' : 'workspace'}`)
46 | for (let i = 0; i < workspaces.length; i++) {
47 | log(`[${i}] ${workspaces[i].path}`)
48 | }
49 |
50 | if (count == 1) {
51 | return `${workspaces[0].path}/data/plugins`
52 | } else {
53 | const rl = readline.createInterface({
54 | input: process.stdin,
55 | output: process.stdout
56 | })
57 | let index = await new Promise((resolve, reject) => {
58 | rl.question(`Please select a workspace[0-${count - 1}]: `, (answer) => {
59 | resolve(answer)
60 | })
61 | })
62 | rl.close()
63 | return `${workspaces[index].path}/data/plugins`
64 | }
65 | }
66 |
67 | if (targetDir === '') {
68 | log('"targetDir" is empty, try to get SiYuan directory automatically....')
69 | let res = await getSiYuanDir()
70 |
71 | if (res === null) {
72 | log('Failed! You can set the plugin directory in scripts/make_dev_link.js and try again')
73 | process.exit(1)
74 | }
75 |
76 | targetDir = await chooseTarget(res)
77 | log(`Got target directory: ${targetDir}`)
78 | }
79 |
80 | //Check
81 | if (!fs.existsSync(targetDir)) {
82 | log(`Failed! plugin directory not exists: "${targetDir}"`)
83 | log(`Please set the plugin directory in scripts/make_dev_link.js`)
84 | process.exit(1)
85 | }
86 |
87 |
88 | //check if plugin.json exists
89 | if (!fs.existsSync('./plugin.json')) {
90 | console.error('Failed! plugin.json not found')
91 | process.exit(1)
92 | }
93 |
94 | //load plugin.json
95 | const plugin = JSON.parse(fs.readFileSync('./plugin.json', 'utf8'))
96 | const name = plugin?.name
97 | if (!name || name === '') {
98 | log('Failed! Please set plugin name in plugin.json')
99 | process.exit(1)
100 | }
101 |
102 | //dev directory
103 | const devDir = `./dev`
104 | //mkdir if not exists
105 | if (!fs.existsSync(devDir)) {
106 | fs.mkdirSync(devDir)
107 | }
108 |
109 | const targetPath = `${targetDir}/${name}`
110 | //如果已经存在,就退出
111 | if (fs.existsSync(targetPath)) {
112 | log(`Failed! Target directory ${targetPath} already exists`)
113 | } else {
114 | //创建软链接
115 | fs.symlinkSync(`${process.cwd()}/dev`, targetPath, 'junction')
116 | log(`Done! Created symlink ${targetPath}`)
117 | }
118 |
119 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |