2022-05-26 15:18:53 +08:00
|
|
|
|
// SiYuan - Build Your Eternal Digital Garden
|
|
|
|
|
|
// Copyright (c) 2020-present, b3log.org
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
package conf
|
|
|
|
|
|
|
|
|
|
|
|
type Editor struct {
|
2022-10-17 10:37:01 +08:00
|
|
|
|
FontSize int `json:"fontSize"` // 字体大小
|
|
|
|
|
|
FontFamily string `json:"fontFamily"` // 字体
|
|
|
|
|
|
CodeSyntaxHighlightLineNum bool `json:"codeSyntaxHighlightLineNum"` // 代码块是否显示行号
|
|
|
|
|
|
CodeTabSpaces int `json:"codeTabSpaces"` // 代码块中 Tab 转换空格数,配置为 0 则表示不转换
|
|
|
|
|
|
CodeLineWrap bool `json:"codeLineWrap"` // 代码块是否自动折行
|
|
|
|
|
|
CodeLigatures bool `json:"codeLigatures"` // 代码块是否连字
|
|
|
|
|
|
DisplayBookmarkIcon bool `json:"displayBookmarkIcon"` // 是否显示书签图标
|
|
|
|
|
|
DisplayNetImgMark bool `json:"displayNetImgMark"` // 是否显示网络图片角标
|
2022-05-26 15:18:53 +08:00
|
|
|
|
GenerateHistoryInterval int `json:"generateHistoryInterval"` // 生成历史时间间隔,单位:分钟
|
|
|
|
|
|
HistoryRetentionDays int `json:"historyRetentionDays"` // 历史保留天数
|
|
|
|
|
|
Emoji []string `json:"emoji"` // 常用表情
|
|
|
|
|
|
VirtualBlockRef bool `json:"virtualBlockRef"` // 是否启用虚拟引用
|
|
|
|
|
|
VirtualBlockRefExclude string `json:"virtualBlockRefExclude"` // 虚拟引用关键字排除列表
|
2022-10-26 09:24:07 +08:00
|
|
|
|
VirtualBlockRefInclude string `json:"virtualBlockRefInclude"` // 虚拟引用关键字包含列表
|
2022-05-26 15:18:53 +08:00
|
|
|
|
BlockRefDynamicAnchorTextMaxLen int `json:"blockRefDynamicAnchorTextMaxLen"` // 块引动态锚文本最大长度
|
|
|
|
|
|
PlantUMLServePath string `json:"plantUMLServePath"` // PlantUML 伺服地址
|
2022-06-30 21:30:18 +08:00
|
|
|
|
FullWidth bool `json:"fullWidth"` // 是否使用最大宽度
|
2022-08-27 22:19:42 +08:00
|
|
|
|
KaTexMacros string `json:"katexMacros"` // KeTex 宏定义
|
2022-10-11 20:00:59 +08:00
|
|
|
|
ReadOnly bool `json:"readOnly"` // 只读模式
|
2022-10-17 10:37:01 +08:00
|
|
|
|
EmbedBlockBreadcrumb bool `json:"embedBlockBreadcrumb"` // 嵌入块是否显示面包屑
|
2022-10-24 11:17:10 +08:00
|
|
|
|
ListLogicalOutdent bool `json:"listLogicalOutdent"` // 列表逻辑反向缩进
|
2022-10-28 20:01:30 +08:00
|
|
|
|
FloatWindowMode int `json:"floatWindowMode"` // 浮窗触发模式,0:光标悬停,1:按住 Ctrl 悬停
|
2022-10-31 15:54:58 +08:00
|
|
|
|
DynamicLoadBlocks int `json:"dynamicLoadBlocks"` // 块动态数,可配置区间 [48, 1024]
|
|
|
|
|
|
Justify bool `json:"justify"` // 是否两端对齐
|
|
|
|
|
|
RTL bool `json:"rtl"` // 是否从右到左显示
|
2022-12-30 11:27:26 +08:00
|
|
|
|
Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查
|
2023-01-09 22:51:16 +08:00
|
|
|
|
BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量
|
2023-03-22 14:35:22 +08:00
|
|
|
|
BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量
|
2022-05-26 15:18:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewEditor() *Editor {
|
|
|
|
|
|
return &Editor{
|
|
|
|
|
|
FontSize: 16,
|
|
|
|
|
|
CodeSyntaxHighlightLineNum: true,
|
|
|
|
|
|
CodeTabSpaces: 0,
|
|
|
|
|
|
CodeLineWrap: false,
|
|
|
|
|
|
CodeLigatures: false,
|
|
|
|
|
|
DisplayBookmarkIcon: true,
|
2022-06-03 11:45:42 +08:00
|
|
|
|
DisplayNetImgMark: true,
|
2022-05-26 15:18:53 +08:00
|
|
|
|
GenerateHistoryInterval: 10,
|
|
|
|
|
|
HistoryRetentionDays: 30,
|
|
|
|
|
|
Emoji: []string{},
|
|
|
|
|
|
VirtualBlockRef: false,
|
2022-06-08 00:39:18 +08:00
|
|
|
|
BlockRefDynamicAnchorTextMaxLen: 96,
|
2022-05-26 15:18:53 +08:00
|
|
|
|
PlantUMLServePath: "https://www.plantuml.com/plantuml/svg/~1",
|
2022-08-19 23:30:41 +08:00
|
|
|
|
FullWidth: true,
|
2022-08-27 21:46:32 +08:00
|
|
|
|
KaTexMacros: "{}",
|
2022-10-11 20:00:59 +08:00
|
|
|
|
ReadOnly: false,
|
2022-10-17 10:37:01 +08:00
|
|
|
|
EmbedBlockBreadcrumb: false,
|
2022-10-24 11:17:10 +08:00
|
|
|
|
ListLogicalOutdent: false,
|
2022-10-28 20:01:30 +08:00
|
|
|
|
FloatWindowMode: 0,
|
2022-10-30 22:45:47 +08:00
|
|
|
|
DynamicLoadBlocks: 128,
|
2022-10-31 15:54:58 +08:00
|
|
|
|
Justify: false,
|
|
|
|
|
|
RTL: false,
|
2023-01-09 22:51:16 +08:00
|
|
|
|
BacklinkExpandCount: 8,
|
2023-03-22 14:35:22 +08:00
|
|
|
|
BackmentionExpandCount: 8,
|
2022-05-26 15:18:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|