Skip to content

Commit

Permalink
兼容最新编辑器宽度插件,修复了诸多bug(除了打开文件树时还没办法触发刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
WingDr committed Aug 23, 2023
1 parent e4b5df1 commit 2f9d89d
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 47 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

# Sidebar Memo

> Display your memos in the sidebar
## Usage Instructions

## Usage
After installing the plugin, you can open the sidebar display by clicking on the "Sidebar Memo" button in the top bar and selecting "Open Sidebar Memos". Clicking again will close it (at this point, the button text will change to "Close Sidebar Memos").

After installing the plugin, you can open the sidebar display by clicking on the "Sidebar Memo" button in the top bar and selecting "Toggle Sidebar Memo Display". Clicking again will close it.
## Reasons for Sidebar Not Displaying

1. Check if the window width of SiYuan Note is sufficiently large. The sidebar won't be displayed if the window width is less than 500px.
2. Ensure that the right-side blank space of the note editor is large enough. The sidebar won't be displayed if the right-side blank space is less than 250px.

## Theme Compatibility / Customizing Memo Styles

Expand All @@ -22,8 +25,8 @@ Most of the memo styles are set using CSS variables. Here's the specific code:
--sidebar-memo-number-background-color: var(--b3-theme-primary);
--sidebar-memo-number-not-only-child-width: 18px;
--sidebar-memo-number-not-only-child-color: var(--b3-theme-background);
--sidebar-memo-editor-padding-right: 250px;
--sidebar-memo-sidebar-right: -80px;
--sidebar-memo-editor-padding-right: 280px;
--sidebar-memo-sidebar-right: -50px;
--sidebar-memo-text-max-width: 150px;
}
```
Expand Down
13 changes: 8 additions & 5 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

# 侧边备注

> 让你的备注再侧边显示
## 使用方法

安装插件后,通过`顶栏“侧边备注”按钮->“切换备注的侧边显示”`即可打开侧边显示,再按一次就是关闭。
安装插件后,通过`顶栏“侧边备注”按钮->“打开备注的侧边显示”`即可打开侧边显示,再按一次就是关闭(此时按钮文本为`“关闭备注的侧边显示”`)。

## 不显示侧边栏的原因

1. 检查思源笔记的窗口宽度是否足够大,目前小于500px的窗口宽度就不会显示侧边栏。
2. 检查笔记编辑器的右侧空白是否足够大,右侧空白小于250px就不会显示侧边栏。

## 主题适配/备注样式修改

Expand All @@ -22,8 +25,8 @@
--sidebar-memo-number-background-color:var(--b3-theme-primary);
--sidebar-memo-number-not-only-child-width:18px;
--sidebar-memo-number-not-only-child-color:var(--b3-theme-background);
--sidebar-memo-editor-padding-right: 250px;
--sidebar-memo-sidebar-right: -80px;
--sidebar-memo-editor-padding-right: 280px;
--sidebar-memo-sidebar-right: -50px;
--sidebar-memo-text-max-width: 150px;
}
```
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-plugin-sidebar-memo",
"author": "WingDr",
"url": "https://github.com/WingDr/siyuan-plugin-sidebar-memo",
"version": "0.1.0",
"version": "0.2.0",
"minAppVersion": "2.10.0",
"backends": ["all"],
"frontends": ["desktop", "desktop-window", "browser-desktop"],
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"confirmRemove": "Confirm to delete the data in ${name}?",
"insertEmoji": "Insert Emoji",
"name": "Sidebar Memos",
"switchSidebarMemo": "Toggle Sidebar Memos Display"
"openSidebarMemo": "Open Sidebar Memos",
"closeSidebarMemo": "Close Sidebar Memos",
"noEnoughPaddingRight": "No enough padding at the right of editor."
}
4 changes: 3 additions & 1 deletion src/i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"confirmRemove": "确认删除 ${name} 中的数据?",
"insertEmoji": "插入表情",
"name": "侧边备注",
"switchSidebarMemo": "切换备注的侧边显示"
"openSidebarMemo": "打开备注的侧边显示",
"closeSidebarMemo": "关闭备注的侧边显示",
"noEnoughPaddingRight": "编辑器右侧没有足够的空间"
}
12 changes: 6 additions & 6 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
--sidebar-memo-number-background-color:var(--b3-theme-primary);
--sidebar-memo-number-not-only-child-width:18px;
--sidebar-memo-number-not-only-child-color:var(--b3-theme-background);
--sidebar-memo-editor-padding-right: 250px;
--sidebar-memo-sidebar-right: -80px;
--sidebar-memo-editor-padding-right: 280px;
--sidebar-memo-sidebar-right: -50px;
--sidebar-memo-disapear-screen-width: 1280px;
--sidebar-memo-text-max-width: 150px;
--sidebar-memo-text-max-width: calc(90% - 24px);

[data-content-type="number"]{
height:var(--sidebar-memo-number-height);
Expand Down Expand Up @@ -62,7 +62,7 @@
margin: auto;
}

@media screen and (min-width: 1280px){
@media screen and (min-width: 500px){
.protyle-content[data-fullwidth="true"]:has(span[data-type*="inline-memo"]):has(div[id="protyle-sidebar"]) .protyle-wysiwyg{
padding-right:var(--sidebar-memo-editor-padding-right)!important;
}
Expand All @@ -71,13 +71,13 @@
}
}

@media screen and (max-width: 1279px) {
@media screen and (max-width: 499px) {
.protyle-content #protyle-sidebar{
display:none;
}
}

@media screen and (min-width: 1280px){
@media screen and (min-width: 500px){
.protyle-content[data-fullwidth="true"]:has(span[data-type*="inline-memo"]):has(div[id="protyle-sidebar"]) .protyle-wysiwyg{
padding-right:var(--sidebar-memo-editor-padding-right)!important;
}
Expand Down
Loading

0 comments on commit 2f9d89d

Please sign in to comment.