You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-23Lines changed: 31 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,21 @@
20
20
21
21
## Get started
22
22
23
-
1. Make a copy of this repo as a template with the `Use this template` button, please note that the repo name must be the same as the plugin name, the default branch must be `main`
23
+
1. Use the <kbd>Use this template</kbd> button to make a copy of this repo as a template. Note that the repository name should match the plugin name, and the default branch must be `main`.
24
+
2. Clone your repository to the local development folder.
25
+
* Note: Unlike `plugin-sample`, this example does not recommend directly downloading the code to `{workspace}/data/plugins/`.
26
+
3. Install [NodeJS](https://nodejs.org/en/download) and [pnpm](https://pnpm.io/installation), then run `pnpm i` in the development folder to install the required dependencies.
27
+
4. Run the `pnpm run make-link` command to create a symbolic link (Windows developers, please refer to the "make-link on Windows" section below).
28
+
5. Execute `pnpm run dev` for real-time compilation.
29
+
6. Open the marketplace in SiYuan and enable the plugin in the download tab.
24
30
25
-
2. Clone your repo to a local development folder at any place
26
-
- Notice: we **don't recommand** you to place the folder under your `{workspace}/data/plugins/` folder.
31
+
### Setting the Target Directory for the make-link Command
27
32
28
-
3. Install NodeJS and pnpm, then run pnpm i in the command line under your repo folder
29
-
4.**Auto create development symbolic links**
30
-
- Make sure that SiYuan is running
31
-
- Run `pnpm run make-link`, the script will detect all the siyuan workspace, please select the targe workspace and the script will automatically create the symbolic link under the `{workspace}/data/plugins/` folder
33
+
The `make-link` command creates a symbolic link that binds your `dev` directory to the SiYuan plugin directory. You can configure the target SiYuan workspace and create the symbolic link in three ways:
34
+
35
+
1.**Select Workspace**
36
+
- Open SiYuan, ensure the SiYuan kernel is running.
37
+
- Run `pnpm run make-link`, the script will automatically detect all SiYuan workspaces, please manually enter the number to select the workspace.
Done! Created symlink H:/SiYuanDevSpace/data/plugins/plugin-sample-vite-svelte
54
-
```
55
-
5. **Create development symbolic links by using environment variable**
56
-
- You can set environment variable `SIYUAN_PLUGIN_DIR` as `/data/plugins`
57
-
6. Execute pnpm run dev for real-time compilation
58
-
7. Open SiYuan marketplace and enable plugin in downloaded tab
59
-
60
-
> Notice: as the `make-link` script rely on the `fetch` function, please **ensure that at least version v18 of nodejs is installed**if you want to use make-link script.
51
+
2. **Manually Configure Target Directory**
52
+
- Open the `./scripts/make_dev_link.js` file, change `targetDir` to the SiYuan plugin directory `<siyuan workspace>/data/plugins`.
53
+
- Run the `pnpm run make-link` command. If you see a message similar to the one below, it indicates successful creation:
54
+
55
+
3. **Set Environment Variable to Create Symbolic Link**
56
+
- Set the system environment variable `SIYUAN_PLUGIN_DIR` to the path `workspace/data/plugins`.
57
+
58
+
### make-link on Windows
59
+
60
+
Due to SiYuan upgrading to Go 1.23, the old version of junction links cannot be recognized normally on Windows, so it has been changed to create `dir` symbolic links.
However, creating directory symbolic links on Windows using NodeJs may require administrator privileges. You have the following options:
65
+
66
+
1. Run `pnpm run make-link`in a command line with administrator privileges.
67
+
2. Configure Windows settings, enable developer mode in [System Settings - Update & Security - Developer Mode] then run `pnpm run make-link`.
68
+
3. Run `pnpm run make-link-win`, this command will use a PowerShell script to request administrator privileges, requiring the system to enable PowerShell script execution permissions.
0 commit comments