Skip to content

Commit 03c2b67

Browse files
committed
init
0 parents  commit 03c2b67

24 files changed

Lines changed: 1432 additions & 0 deletions

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.d.ts]
15+
trim_trailing_whitespace = false

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Siyuan workspace path
2+
# The workspace contains `data` folder
3+
VITE_SIYUAN_WORKSPACE_PATH=/path/to/siyuan/workspace
4+
5+
# Manually set the dist dir to work with Symbolic Links
6+
VITE_DEV_DIST_DIR=

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Create Release on Tag Push
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
# Checkout
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
# Install apt packages
19+
- name: Install apt packages
20+
run: apt install -y curl unzip
21+
22+
# Install Node.js
23+
- name: Install Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
registry-url: "https://registry.npmjs.org"
28+
29+
# Install pnpm
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v2
32+
id: pnpm-install
33+
with:
34+
version: 8
35+
run_install: false
36+
37+
# Get pnpm store directory
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
43+
44+
# Setup pnpm cache
45+
- name: Setup pnpm cache
46+
uses: actions/cache@v3
47+
with:
48+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
49+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
50+
restore-keys: |
51+
${{ runner.os }}-pnpm-store-
52+
53+
# Install dependencies
54+
- name: Install dependencies
55+
run: pnpm install
56+
57+
# Build for production, 这一步会生成一个 package.zip
58+
- name: Build for production
59+
run: pnpm build
60+
61+
- name: Release Info
62+
id: release_info
63+
run: |
64+
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
65+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
66+
sed -n '/^## 更新日志/,$p' README_zh_CN.md >> $GITHUB_OUTPUT
67+
echo "EOF" >> $GITHUB_OUTPUT
68+
69+
- name: Release
70+
uses: ncipollo/release-action@v1
71+
with:
72+
name: ${{ steps.release_info.outputs.tag_name }}
73+
tag: ${{ github.ref }}
74+
allowUpdates: true
75+
artifactErrorsFailBuild: true
76+
artifacts: "package.zip"
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
draft: false
79+
prerelease: false
80+
generateReleaseNotes: true
81+
body: ${{ steps.release_info.outputs.changelog }}
82+

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.idea
2+
# .vscode
3+
.DS_Store
4+
pnpm-lock.yaml
5+
package.zip
6+
node_modules
7+
dev
8+
dist
9+
build
10+
tmp
11+
.env
12+
draw.war
13+
draw

.vscode/settings.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"volar.autoCompleteRefs": true,
3+
"volar.updateImportOnFileMove.enabled": true,
4+
"css.validate": false,
5+
"scss.validate": false,
6+
"less.validate": false,
7+
"typescript.tsdk": "node_modules/typescript/lib",
8+
"todo-tree.tree.showBadges": true,
9+
"todo-tree.tree.showCountsInTree": true,
10+
// Disable the default formatter, use eslint instead
11+
"prettier.enable": false,
12+
"editor.formatOnSave": false,
13+
14+
// Auto fix
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll.eslint": "explicit",
17+
"source.organizeImports": "never"
18+
},
19+
20+
// Silent the stylistic rules in you IDE, but still auto fix them
21+
// "eslint.rules.customizations": [
22+
// { "rule": "style/*", "severity": "warn", "fixable": true },
23+
// { "rule": "format/*", "severity": "warn", "fixable": true },
24+
// { "rule": "*-indent", "severity": "warn", "fixable": true },
25+
// { "rule": "*-spacing", "severity": "warn", "fixable": true },
26+
// { "rule": "*-spaces", "severity": "warn", "fixable": true },
27+
// { "rule": "*-order", "severity": "warn", "fixable": true },
28+
// { "rule": "*-dangle", "severity": "warn", "fixable": true },
29+
// { "rule": "*-newline", "severity": "warn", "fixable": true },
30+
// { "rule": "*quotes", "severity": "warn", "fixable": true },
31+
// { "rule": "*semi", "severity": "warn", "fixable": true }
32+
// ],
33+
"eslint.lintTask.enable": true,
34+
"eslint.lintTask.options": "-c ./eslint.config.mjs --quiet src",
35+
// Enable eslint for all supported languages
36+
"eslint.validate": [
37+
"javascript",
38+
"javascriptreact",
39+
"typescript",
40+
"typescriptreact",
41+
"vue",
42+
"html",
43+
"markdown",
44+
"json",
45+
"json5",
46+
"jsonc",
47+
"yaml",
48+
"toml",
49+
"xml",
50+
"gql",
51+
"graphql",
52+
"astro",
53+
"css",
54+
"less",
55+
"scss",
56+
"pcss",
57+
"postcss"
58+
]
59+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Yuxin Zhao
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<p align="center">
2+
<img alt="drawio" src="./icon.png" width="160px">
3+
<br>
4+
5+
<p align="center">
6+
<strong>SiYuan Plugin「Embed Series」</strong>
7+
<br>
8+
Draw high-quality vector graphics directly in SiYuan using draw.io.
9+
<br>
10+
No external dependencies · Full editability · Free to share
11+
</p>
12+
13+
<p align="center">
14+
<a href="https://github.com/YuxinZhaozyx/siyuan-embed-drawio/blob/main/README_zh_CN.md">中文</a> | <a href="https://github.com/YuxinZhaozyx/siyuan-embed-drawio/blob/main/README.md">English</a>
15+
</p>
16+
17+
---
18+
19+
## Embed Series
20+
21+
This plugin serves as the third plugin in the **Embed Series**, aiming to provide a more complete and flexible draw.io experience within SiYuan.
22+
23+
**The principle of Embed Series plugins**: They are designed solely as auxiliary editing tools for SiYuan, embedding all information directly into formats supported by SiYuan and Markdown. This ensures that all content created by the plugin remains fully visible and functional even after being separated from the plugin — or even from SiYuan itself — such as when exporting to Markdown or sharing on third-party platforms.
24+
25+
## Features
26+
27+
- [x] Save draw.io image as SVG format
28+
- [x] Edit draw.io image
29+
- [x] Support for mobile devices
30+
- [x] Support dark mode
31+
32+
> If you have additional feature requests or suggestions, feel free to [open an issue on GitHub](https://github.com/YuxinZhaozyx/siyuan-embed-drawio/issues).
33+
34+
## Effects
35+
36+
![image.png](https://b3logfile.com/file/2025/11/image-r5KMPJt.png)
37+
38+
## Usage Guide
39+
40+
**Create a draw.io Image:**
41+
Type `/drawio` in the editor to create a new draw.io image.
42+
43+
**Edit a draw.io Image:**
44+
Click the menu button in the top-right corner of the image. If the block is recognized as a valid draw.io image, an `Edit draw.io` option will appear. Click it to open the editor.
45+
46+
**Migrating from other sources:**
47+
Simply export your diagram as an SVG from any draw.io platform with the "Include a copy of my diagram" option enabled, then drag the resulting SVG file into SiYuan.
48+
49+
## Changelog
50+
51+
+ v0.1.0
52+
+ Feature: save draw.io image as SVG format
53+
+ Feature: edit draw.io image

README_zh_CN.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<p align="center">
2+
<img alt="drawio" src="./icon.png" width="160px">
3+
<br>
4+
5+
<p align="center">
6+
<strong>思源插件「嵌入式系列」</strong>
7+
<br>
8+
使用draw.io在思源笔记中直接绘制高质量矢量图。
9+
<br>
10+
无需外部依赖 · 自由编辑 · 自由分享
11+
</p>
12+
13+
<p align="center">
14+
<a href="https://github.com/YuxinZhaozyx/siyuan-embed-drawio/blob/main/README_zh_CN.md">中文</a> | <a href="https://github.com/YuxinZhaozyx/siyuan-embed-drawio/blob/main/README.md">English</a>
15+
</p>
16+
17+
---
18+
19+
## 嵌入式系列
20+
21+
本插件为第三个「嵌入式系列」插件,旨在为思源笔记提供更加完善且自由的draw.io使用体验。
22+
23+
**嵌入式系列插件的宗旨**:仅作为思源笔记的辅助编辑插件,将所有信息嵌入思源笔记和markdown所支持的数据格式中,使得插件所创造的所有内容在脱离插件甚至脱离思源笔记(导出为markdown/分享到第三方平台)后仍然可以正常显示。
24+
25+
## 使用效果
26+
27+
![image.png](https://b3logfile.com/file/2025/11/image-r5KMPJt.png)
28+
29+
## 功能
30+
31+
- [x] draw.io图像以SVG格式存储
32+
- [x] draw.io图像可编辑
33+
- [x] 支持移动端
34+
- [x] 图像支持暗黑模式
35+
36+
> 如有更多需求/建议欢迎[在GitHub仓库中提issue](https://github.com/YuxinZhaozyx/siyuan-embed-drawio/issues)
37+
38+
## 使用指南
39+
40+
**创建draw.io图像:** 在编辑器中输入 `/drawio` 命令即可创建新draw.io图像。
41+
42+
**编辑draw.io图像:** 点击图像右上角的菜单按钮,当图像被识别为合法的draw.io图像时,菜单中会显示 `编辑draw.io` 的选项,点击即可打开编辑窗口。
43+
44+
**从其他来源迁移:** 只需要在任意draw.io平台导出SVG图像时勾选 `包含绘图副本` 选项,再把SVG图像拖入思源笔记中即可。
45+
46+
## 更新日志
47+
48+
+ v0.1.0
49+
+ 新增功能:draw.io图像以SVG格式存储
50+
+ 新增功能:draw.io图像可编辑
51+

default.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)