Skip to content

Commit

Permalink
🎉 feat(docs): update README and usage instructions for drawio plugin
Browse files Browse the repository at this point in the history
- Updated the README.md and README_zh_CN.md files to include new usage instructions for inserting drawio into notes using the `/drawio` command.
- Added preview images to demonstrate the process.
- Updated the changelog to reflect the new changes in version 0.1.12.
- Removed the 'Copy as Siyuan Link' menu in drawio to encourage using the `/` command instead.
  • Loading branch information
zt8989 committed Nov 16, 2024
1 parent e1c9573 commit 85740d9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
## Description
Integrated into Siyuan as a plugin

### Embedding into Siyuan
1. In drawio, go to File -> Embed -> IFrame -> Create -> Copy
2. Paste into Siyuan document
### Usage

In edit mode, type `/drawio`, select and insert it into the note.

![Insert drawio in command mode](asset/preview-1.png)
![Select or create a new drawio](asset/preview-2.png)

## Author
cowboy
Expand All @@ -21,6 +23,9 @@ cowboy
0.1.11

## Changelog
- **v0.1.12 (2024-11-16)**
- The `/` command will automatically insert `drawio` as an `iframe` into the note, and add the `data-assets` attribute to resolve the issue of unreferenced resource files.
- Removed the 'Copy as Siyuan Link' menu in drawio.
- **v0.1.11 (2024-11-05)**
- Optimized the logic for adding new tabs and the `/` command to insert `drawio`.
- **v0.1.9 (2024-10-31)**
Expand Down
13 changes: 9 additions & 4 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
## 描述
以插件形式集成到思源中

### 嵌入到思源
### 使用方法

1. drawio下,文件->嵌入->IFrame->创建->复制
2. 思源文档,粘贴
编辑状态下输入`/drawio`, 选择并插入到笔记中

![命令模式插入drawio](asset/preview-1.png)
![选择或者新建drawio](asset/preview-2.png)

## 作者
cowboy
Expand All @@ -21,8 +23,11 @@ cowboy
0.1.11

## 更新日志
- **v0.1.12 (2024-11-16)**
- `/`命令会自动将`drawio``iframe`形式插入到笔记中,同时增加`data-assets`属性,解决未引用资源文件问题
- 移除了drawio中『复制为思源链接』菜单
- **v0.1.11 (2024-11-05)**
- 优化新增Tab逻辑和/命令插入`drawio`逻辑
- 优化新增Tab逻辑和`/`命令插入`drawio`逻辑
- **v0.1.9 (2024-10-31)**
- 修复文件->新建的弹窗问题
- **v0.1.8 (2024-10-31)**
Expand Down
Binary file added asset/preview-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asset/preview-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions client/PostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,11 @@
editorUi.openLink('https://www.draw.io/')
}));

editorUi.actions.put("copyLink", new Action(parent.drawioPlugin.i18n.copyAsSiYuanLink, function() {
var file = editorUi.getCurrentFile();
electron.sendMessage("copyLink", file.getTitle())
}),)
// 不需要复制链接,建议直接使用`/`命令
// editorUi.actions.put("copyLink", new Action(parent.drawioPlugin.i18n.copyAsSiYuanLink, function() {
// var file = editorUi.getCurrentFile();
// electron.sendMessage("copyLink", file.getTitle())
// }),)

editorUi.actions.put("open", new Action(mxResources.get('open'), function() {
electron.sendMessage("open", null, "open" + (new Date).getTime(), (url, name) => {
Expand Down

0 comments on commit 85740d9

Please sign in to comment.