generated from Zuoqiu-Yingyi/siyuan-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0a4c587
Showing
10 changed files
with
444 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<div align="center"> | ||
<img alt="icon" src="https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-typewriter/public/icon.png" style="width: 8em; height: 8em;"> | ||
|
||
--- | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases/latest) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases/latest) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/blob/main/LICENSE) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/commits/main) | ||
 | ||
 | ||
<!--  --> | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases) | ||
|
||
--- | ||
[简体中文](./README_zh_CN.md) \| English | ||
|
||
--- | ||
</div> | ||
|
||
# Typewriter Mode Plugin for SiYuan | ||
|
||
This is a plug-in for [SiYuan Note](https://github.com/siyuan-note/siyuan) that can highlight the currently edited block and automatically scroll it to the center of the editing area. | ||
|
||
## Preview | ||
|
||
 | ||
|
||
## Frequently Asked Questions | ||
|
||
## Introduction | ||
|
||
### Features | ||
|
||
* `Focus Display` | ||
|
||
* Show the currently edited block (block where the cursor is located) in the editor | ||
|
||
* Each currently edited block (cell in a table) in the editor will have the attribute `data-plugin-focus="true"` | ||
* The currently edited block (cell where the cursor is located) will have the `id` attribute `plugin-focus-unique-id` | ||
* `CSS` style variables can be modified in <kbd>SiYuan Settings > Appearance > Code Snippet</kbd> | ||
|
||
* ```css | ||
:root { | ||
/* Focus shadow blur radius */ | ||
--custom-focus-shadow-blur: 0.25em; | ||
/* Focus shadow color */ | ||
--custom-focus-shadow-color: var(--b3-theme-secondary); | ||
|
||
/* Global unique focus shadow color */ | ||
--custom-focus-unique-shadow-color: var(--b3-theme-primary); | ||
|
||
/* Outline width of the table row with focus */ | ||
--custom-focus-table-row-outline-width: 1px; | ||
/* Outline color of the table row with focus */ | ||
--custom-focus-table-row-outline-color: var(--b3-theme-on-surface); | ||
|
||
/* Shadow blur radius of the table cell with focus */ | ||
--custom-focus-table-cell-shadow-blur: 0.25em; | ||
} | ||
``` | ||
* `Typewriter Mode` | ||
|
||
* Keep the currently edited block (block where the cursor is located) in the middle of the editor | ||
|
||
* If the cursor is in a table block, the cell where the cursor is located can be kept in the middle of the editor | ||
* If the cursor is in a code block, the line where the cursor is located can be kept in the middle of the editor | ||
* This mode can be enabled/disabled in the following ways | ||
|
||
* <kbd>This Plugin Settings Panel > Typewriter Settings > Enable Typewriter Mode</kbd> | ||
* `Typewriter Mode` button in the top-right corner of the menu bar | ||
* Shortcut key <kbd>Shift + Alt + T</kbd> | ||
* Command Palette option `Toggle Typewriter Mode` | ||
|
||
### Settings | ||
|
||
* General Settings | ||
|
||
* `Reset Settings` | ||
|
||
* This button will reset all settings to their default values | ||
* The page will be refreshed after resetting | ||
* Focus Settings | ||
|
||
* `Display Current Focus` | ||
|
||
* When enabled, the currently edited block will be highlighted in the editor (outline will be added to the currently edited block) | ||
|
||
* The element of the currently edited block will have attributes `data-plugin-focus="true"` and `id="plugin-focus-unique-id"` | ||
* When disabled, the currently edited block will no longer be highlighted | ||
|
||
* All attributes `data-plugin-focus="true"` and `id="plugin-focus-unique-id"` will be removed | ||
* This option does not apply the features of Typewriter Mode | ||
* Typewriter Settings | ||
|
||
* `Enable Typewriter Mode` | ||
|
||
* When enabled, the block where the cursor is located will automatically scroll to the middle of the editor while editing | ||
* `Code Block Line Focus Follow` | ||
|
||
* When enabled, the line of code where the cursor is located will be scrolled to the middle of the editor while editing a code block | ||
* When disabled, the code block will be scrolled to the middle of the editor while editing a code block | ||
* `Table Block Cell Focus Follow` | ||
|
||
* When enabled, the table cell where the cursor is located will be scrolled to the middle of the editor while editing a table block | ||
* When disabled, the table block will be scrolled to the middle of the editor while editing a table block | ||
* `Database Block Cell Focus Follow` | ||
|
||
* When enabled, the cell where the cursor is located will be scrolled to the middle of the editor while editing a database block (property view). | ||
* When disabled, the entire database block will be scrolled to the middle of the editor while editing a database block (property view). | ||
* `Scroll Delay` | ||
|
||
* After the cursor moves to another block, the block where the cursor is located will scroll to the middle of the editor after a certain delay | ||
* Unit: Milliseconds | ||
|
||
## Changelog | ||
|
||
[CHANGELOG.md](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/blob/main/CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<div align="center"> | ||
<img alt="图标" src="https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-typewriter/public/icon.png" style="width: 8em; height: 8em;"> | ||
|
||
--- | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases/latest) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases/latest) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/blob/main/LICENSE) | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/commits/main) | ||
 | ||
 | ||
<!--  --> | ||
[](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/releases) | ||
|
||
--- | ||
简体中文 \| [English](./README.md) | ||
|
||
--- | ||
</div> | ||
|
||
# 思源打字机模式插件 | ||
|
||
这是一款可以突出显示当前正在编辑的块, 并将其自动滚动至编辑区中间的[思源笔记](https://github.com/siyuan-note/siyuan)插件。 | ||
|
||
## 预览 | ||
|
||
 | ||
|
||
## 常见问题 | ||
|
||
## 介绍 | ||
|
||
### 功能介绍 | ||
|
||
* `焦点显示` | ||
|
||
* 在编辑器中显示当前正在编辑的块 (光标所在的块) | ||
|
||
* 每个编辑器中当前正在编辑的块 (表格中当前正在编辑的单元格) 元素会设置属性 `data-plugin-focus="true"` | ||
* 当前光标所在的块 (表格中当前光标所在的单元格) 元素会设置 `id` 属性 `plugin-focus-unique-id` | ||
* `CSS` 样式变量, 可以在 <kbd>思源设置 > 外观 > 代码片段</kbd> 中修改 | ||
|
||
* ```css | ||
:root { | ||
/* 焦点阴影模糊半径 */ | ||
--custom-focus-shadow-blur: 0.25em; | ||
/* 焦点阴影的颜色 */ | ||
--custom-focus-shadow-color: var(--b3-theme-secondary); | ||
|
||
/* 全局唯一焦点阴影的颜色 */ | ||
--custom-focus-unique-shadow-color: var(--b3-theme-primary); | ||
|
||
/* 焦点所在表格行的轮廓宽度 */ | ||
--custom-focus-table-row-outline-width: 1px; | ||
/* 焦点所在表格行的轮廓颜色 */ | ||
--custom-focus-table-row-outline-color: var(--b3-theme-on-surface); | ||
|
||
/* 焦点所在表格单元格的阴影模糊半径 */ | ||
--custom-focus-table-cell-shadow-blur: 0.25em; | ||
} | ||
``` | ||
* `打字机模式` | ||
|
||
* 将当前正在编辑的块 (光标所在的块) 保持在编辑区中间 | ||
|
||
* 若光标位于表格块中, 可以将光标所在的单元格保持在编辑区中间 | ||
* 若光标位于代码块中, 可以将光标所在的行保持在编辑区中间 | ||
* 可以通过如下方式打开/关闭该模式 | ||
|
||
* <kbd>本插件设置面板 > 打字机设置 > 启用打字机模式</kbd> | ||
* 右上角顶部菜单栏中的 `打字机模式` 按钮 | ||
* 快捷键 <kbd>Shift + Alt + T</kbd> | ||
* 命令面板 `打开/关闭打字机模式` 选项 | ||
|
||
### 设置项介绍 | ||
|
||
* 常规设置 | ||
|
||
* `重置设置选项` | ||
|
||
* 该按钮将重置所有设置选项为默认选项 | ||
* 重置后将刷新页面 | ||
* 焦点设置 | ||
|
||
* `显示当前焦点` | ||
|
||
* 开启后将在编辑器中显示当前正在编辑的块 (为当前正在编辑的块添加一个轮廓) | ||
|
||
* 当前正在编辑的块元素将设置属性 `data-plugin-focus="true"` 与 `id="plugin-focus-unique-id"` | ||
* 关闭后将不再突出显示当前正在编辑的块 | ||
|
||
* 移除所有的属性 `data-plugin-focus="true"` 与 `id="plugin-focus-unique-id"` | ||
* 该选项不会应用打字机模式的功能 | ||
* 打字机设置 | ||
|
||
* `启用打字机模式` | ||
|
||
* 开启后在编辑时焦点所在块将自动滚动至编辑区中间 | ||
* `代码块焦点跟随行` | ||
|
||
* 开启后在编辑代码块时, 将光标所在的代码行滚动至编辑区中间 | ||
* 关闭后在编辑代码块时, 将该代码块滚动至编辑区中间 | ||
* `表格块焦点跟随单元格` | ||
|
||
* 开启后在编辑表格块时, 将光标所在的表格单元格滚动至编辑区中间 | ||
* 关闭后在编辑表格块时, 将该表格块滚动至编辑区中间 | ||
* `数据库焦点跟随单元格` | ||
|
||
* 开启后在编辑数据库块(属性视图)时, 将光标所在的单元格滚动至编辑区中间 | ||
* 关闭后在编辑数据库块(属性视图)时, 将该数据库块滚动至编辑区中间 | ||
* `滚动延时时间` | ||
|
||
* 当光标位置移动至其他块时, 经过一定延时后光标所在的块再滚动至编辑区中间 | ||
* 单位: 毫秒 | ||
|
||
## 更改日志 | ||
|
||
[CHANGELOG.md](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-typewriter/blob/main/CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"menu": { | ||
"switch": { | ||
"command": { | ||
"text": "Toggle Typewriter Mode" | ||
}, | ||
"disabled": "Typewriter Mode 🚫", | ||
"enabled": "Typewriter Mode ✅", | ||
"title": "Typewriter Mode" | ||
} | ||
}, | ||
"settings": { | ||
"focusSettings": { | ||
"enable": { | ||
"description": "Enable to display the currently edited block in the editor", | ||
"title": "Display current focus" | ||
}, | ||
"title": "Focus" | ||
}, | ||
"generalSettings": { | ||
"reset": { | ||
"description": "Reset all settings options to default options (refresh page after reset)", | ||
"text": "Reset", | ||
"title": "Reset settings options" | ||
}, | ||
"title": "General" | ||
}, | ||
"typewriterSettings": { | ||
"code": { | ||
"description": "Scroll in lines when focus is inside a code block", | ||
"title": "Code Block Line Focus Follow" | ||
}, | ||
"enable": { | ||
"description": "When Typewriter Mode is enabled, the block with focus will automatically scroll to the middle of the editing area", | ||
"title": "Enable Typewriter Mode" | ||
}, | ||
"table": { | ||
"description": "Scroll in cells when focus is inside a table block", | ||
"title": "Table Block Cell Focus Follow" | ||
}, | ||
"timeout": { | ||
"description": "Set the time interval between edit actions and the start of scrolling.<br/>Unit: milliseconds", | ||
"title": "Scroll Delay Time" | ||
}, | ||
"title": "Typewriter", | ||
"view": { | ||
"description": "Scroll in cells when the focus is inside the database block", | ||
"title": "Database Block Cell Focus" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"menu": { | ||
"switch": { | ||
"command": { | ||
"text": "開啟/關閉打字機模式" | ||
}, | ||
"disabled": "打字機模式 🚫", | ||
"enabled": "打字機模式 ✅", | ||
"title": "打字機模式" | ||
} | ||
}, | ||
"settings": { | ||
"focusSettings": { | ||
"enable": { | ||
"description": "開啟後在編輯器中顯示當前正在編輯的塊", | ||
"title": "顯示當前焦點" | ||
}, | ||
"title": "焦點設置" | ||
}, | ||
"generalSettings": { | ||
"reset": { | ||
"description": "重置所有設置選項為默認選項(重置後將刷新頁面)", | ||
"text": "重置", | ||
"title": "重置設置選項" | ||
}, | ||
"title": "常規設置" | ||
}, | ||
"typewriterSettings": { | ||
"code": { | ||
"description": "焦點位於代碼塊內部時以行為單位進行滾動", | ||
"title": "代碼塊焦點跟隨行" | ||
}, | ||
"enable": { | ||
"description": "開啟打字機模式後,編輯時焦點所在塊將自動滾動至編輯區中間", | ||
"title": "啟用打字機模式" | ||
}, | ||
"table": { | ||
"description": "焦點位於表格塊內部時以單元格為單位進行滾動", | ||
"title": "表格塊焦點跟隨單元格" | ||
}, | ||
"timeout": { | ||
"description": "設置編輯操作與開始滾動之間的時間間隔<br/>單位:毫秒", | ||
"title": "滾動延時時間" | ||
}, | ||
"title": "打字機設置", | ||
"view": { | ||
"description": "焦點位於數據庫塊內部時以單元格為單位進行滾動", | ||
"title": "數據庫焦點跟隨單元格" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"menu": { | ||
"switch": { | ||
"command": { | ||
"text": "开启/关闭打字机模式" | ||
}, | ||
"disabled": "打字机模式 🚫", | ||
"enabled": "打字机模式 ✅", | ||
"title": "打字机模式" | ||
} | ||
}, | ||
"settings": { | ||
"focusSettings": { | ||
"enable": { | ||
"description": "开启后在编辑器中显示当前正在编辑的块", | ||
"title": "显示当前焦点" | ||
}, | ||
"title": "焦点设置" | ||
}, | ||
"generalSettings": { | ||
"reset": { | ||
"description": "重置所有设置选项为默认选项(重置后将刷新页面)", | ||
"text": "重置", | ||
"title": "重置设置选项" | ||
}, | ||
"title": "常规设置" | ||
}, | ||
"typewriterSettings": { | ||
"code": { | ||
"description": "焦点位于代码块内部时以行为单位进行滚动", | ||
"title": "代码块焦点跟随行" | ||
}, | ||
"enable": { | ||
"description": "开启打字机模式后,编辑时焦点所在块将自动滚动至编辑区中间", | ||
"title": "启用打字机模式" | ||
}, | ||
"table": { | ||
"description": "焦点位于表格块内部时以单元格为单位进行滚动", | ||
"title": "表格块焦点跟随单元格" | ||
}, | ||
"timeout": { | ||
"description": "设置编辑操作与开始滚动之间的时间间隔<br/>单位:毫秒", | ||
"title": "滚动延时时间" | ||
}, | ||
"title": "打字机设置", | ||
"view": { | ||
"description": "焦点位于数据库块内部时以单元格为单位进行滚动", | ||
"title": "数据库焦点跟随单元格" | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.