Skip to content

Commit

Permalink
docs(custom-block): 添加预览图 | Add preview image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuoqiu-Yingyi committed Jul 9, 2023
1 parent cba05e7 commit 5d4b32d
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 新增快捷键与命令 | Add keyboard shortcuts and commands.
- 新增设置面板 | Add settings panel.
- 添加预览图 | Add preview image.

## 2023-07-08

Expand Down
24 changes: 23 additions & 1 deletion workspace/plugins/custom-block/public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Use <kbd>Block Menu</kbd> > <kbd>Plugins</kbd> > <kbd>Custom Block Styles</kbd>
| Display Block ID | `block-render`:`id` | Document Block: Display block ID for all blocks in this document<br />Other Blocks: Display block ID for the block and its subblocks ||||||||||||||||||
| Display Block Index | `block-render`:`index` | Display the index of top-level blocks in the document || | | | | | | | | | | | | | | | |
| Display Block Content | `block-render`:`content` | Document Block: Display hidden content for all blocks in this document<br />Other Blocks: Display hidden content for all blocks within the block<br />Display link address for hyperlinks<br />Display formula text for inline formulas<br />Display note text for inline notes<br />Display formula text for formula blocks<br />Display corresponding text for other renderable blocks ||||||||||| | | | | || |
| Display Block Outline | `block-render`:`outline` | Document Block: Display outline for all blocks in this document<br />Other Blocks: Display outline for the block and its subblocks ||||||||||||||||||
| Display Block Outline | `block-render`:`outline` | Document Block: Display outline for all blocks in this document<br />Other Blocks: Display outline for this block ||||||||||||||||||
| Layout Mode | `block-writing-mode`:`vertical-rl`<br />`block-writing-mode`:`vertical-lr` | Document Block: Switch the writing mode for all blocks in this document<br />Other Blocks: Switch the writing mode for the block and its subblocks<br />`vertical-rl`: Display text vertically from right to left<br />`vertical-lr`: Display text vertically from left to right |||||||| || | | | | | | | |
| Table - Default Width | None | Default style<br />Columns in the table without manually adjusted width will not wrap | | | | | | | | || | | | | | | | |
| Table - Auto Width | `block-table-width`:`auto` | Table maximum width is the same as the width of the document<br />Content in table cells wraps automatically | | | | | | | | || | | | | | | | |
Expand All @@ -52,6 +52,28 @@ Use <kbd>Block Menu</kbd> > <kbd>Plugins</kbd> > <kbd>Custom Block Styles</kbd>

### Setting Introduction

* `General Settings`

* `Reset Settings Options`

* This is a button
* Reset all settings options to their default values
* Clicking this button will trigger a confirmation dialog

* Clicking the confirm button in the dialog will reset all options of this plugin to their default values and automatically refresh the current interface
* `Menu Settings`

* `Menu`

* This is a switch
* Default state: *On*
* Turn off the switch to disable the corresponding menu items
* `Style`

* This is a switch
* Default state: *On*
* Turn off the switch to disable the built-in styles of the plugin
* If the theme is compatible with the corresponding style, you can turn off this switch

## CHANGELOG

Expand Down
25 changes: 24 additions & 1 deletion workspace/plugins/custom-block/public/README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
| 显示块 ID | `block-render`:`id` | 文档块: 该文档下所有块都在其下方显示块 ID<br />其他块: 该块及其下级块都在其下方显示块 ID ||||||||||||||||||
| 显示块序号 | `block-render`:`index` | 显示文档下顶层块在文档中的序号 || | | | | | | | | | | | | | | | |
| 显示块内容 | `block-render`:`content` | 文档块: 该文档下所有的块都显示隐藏的内容<br />其他块: 该块内所有的块都显示隐藏的内容<br />超链接显示链接地址<br />行内公式显示公式文本<br />行内备注显示备注文本<br />公式块显示公式文本<br />其他需要渲染的块显示对应的文本 |||||||||||| | | | | ||
| 显示块轮廓 | `block-render`:`outline` | 文档块: 该文档下所有块显示其轮廓<br />其他块: 该块及其下级块显示其轮廓 ||||||||||||||||||
| 显示块轮廓 | `block-render`:`outline` | 文档块: 该文档下所有块显示其轮廓<br />其他块: 显示该块轮廓 ||||||||||||||||||
| 排版模式 | `block-writing-mode`:`vertical-rl`<br />`block-writing-mode`:`vertical-lr`<br /> | 文档块: 切换该文档下所有块的书写模式<br />其他块: 切换该块及其下级块的书写模式<br />`vertical-rl`: 从右向左竖排显示文本<br />`vertical-lr`: 从左向右竖排显示文本<br /> |||||||| || | | | | | | | |
| 表格-默认宽度 || 默认样式<br />表格中未手动调整宽度的列不会自动换行<br /> | | | | | | | | || | | | | | | | |
| 表格-自动宽度 | `block-table-width`:`auto` | 表格最大宽度与文档宽度一致<br />表格单元格中的内容自动换行 | | | | | | | | || | | | | | | | |
Expand All @@ -52,6 +52,29 @@

### 设置项介绍

* `常规设置`

* `重置设置选项`

* 这是一个按钮
* 重置所有设置选项为默认选项
* 点击该按钮后会弹出确认对话框

* 点击对话框确认按钮后会重置本插件所有选项为默认选项, 之后会自动刷新当前界面
* `菜单设置`

* `菜单`

* 这是一个开关
* 默认状态: *打开*
* 关闭该开关后禁用对应的菜单项
* `样式`

* 这是一个开关
* 默认状态: *打开*
* 关闭该开关后禁用插件对应的内置样式
* 若主题兼容对应的样式, 可关闭该开关

## 更改日志

[CHANGELOG.md](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-block/blob/main/CHANGELOG.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,37 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

/* 显示块 ID */

.outline() {
outline: 1px dotted var(--b3-theme-on-surface);

&:hover {
outline-style: solid;
}
}

:root {

&[plugin-custom-block~=render-outline] {
.protyle-wysiwyg {

&[custom-block-render~=outline],
[custom-block-render~=outline] {
// 文档下所有块显示其轮廓
&[custom-block-render~=outline] {

&[data-node-id],
& [data-node-id] {
[data-node-id] {
margin: 2px !important;
padding: 2px !important;
outline: 1px dotted var(--b3-theme-on-surface);

&:hover {
outline-style: solid;
}

.outline();
}
}

// 显示该块轮廓
[custom-block-render~=outline] {

&[data-node-id] {

.outline();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion workspace/plugins/custom-block/src/styles/define.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
--custom-block-border-radius: 4px;

/* 列表看板视图 - 看板项最小宽度 */
--custom-block-list-board-min-width: 24%;
--custom-block-list-board-min-width: 16em;

/* 列表表格视图 - 表格项最小宽度 */
--custom-block-list-view-table-min-width: 8em;
Expand Down

0 comments on commit 5d4b32d

Please # to comment.