Documentation ¶
Index ¶
- Constants
- func ProviderToStr(provider int) string
- type AI
- type API
- type Account
- type Appearance
- type Bazaar
- type BoxConf
- type D3
- type Editor
- type Export
- type FileTree
- type Flashcard
- type GlobalGraph
- type Graph
- type Keymap
- type Lang
- type LocalGraph
- type NetworkProxy
- type OpenAI
- type Repo
- type S3
- type Search
- type Snippet
- type Snpt
- type Stat
- type Sync
- type System
- type Tag
- type TypeFilter
- type UILayout
- type User
- type UserTitle
- type WebDAV
Constants ¶
View Source
const ( MinDynamicLoadBlocks = 48 MaxDynamicLoadBlocks = 1024 )
View Source
const ( ProviderSiYuan = 0 // ProviderSiYuan 为思源官方提供的云端存储服务 ProviderS3 = 2 // ProviderS3 为 S3 协议对象存储提供的云端存储服务 ProviderWebDAV = 3 // ProviderWebDAV 为 WebDAV 协议提供的云端存储服务 )
Variables ¶
This section is empty.
Functions ¶
func ProviderToStr ¶
Types ¶
type Account ¶
func NewAccount ¶
func NewAccount() *Account
type Appearance ¶
type Appearance struct { Mode int `json:"mode"` // 模式:0:明亮,1:暗黑 ModeOS bool `json:"modeOS"` // 模式是否跟随系统 DarkThemes []string `json:"darkThemes"` // 暗黑模式外观主题列表 LightThemes []string `json:"lightThemes"` // 明亮模式外观主题列表 ThemeDark string `json:"themeDark"` // 选择的暗黑模式外观主题 ThemeLight string `json:"themeLight"` // 选择的明亮模式外观主题 ThemeVer string `json:"themeVer"` // 选择的主题版本 Icons []string `json:"icons"` // 图标列表 Icon string `json:"icon"` // 选择的图标 IconVer string `json:"iconVer"` // 选择的图标版本 CodeBlockThemeLight string `json:"codeBlockThemeLight"` // 明亮模式下代码块主题 CodeBlockThemeDark string `json:"codeBlockThemeDark"` // 暗黑模式下代码块主题 Lang string `json:"lang"` // 选择的界面语言,同 AppConf.Lang ThemeJS bool `json:"themeJS"` // 是否启用了主题 JavaScript CloseButtonBehavior int `json:"closeButtonBehavior"` // 关闭按钮行为,0:退出,1:最小化到托盘 HideStatusBar bool `json:"hideStatusBar"` // 是否隐藏底部状态栏 }
func NewAppearance ¶
func NewAppearance() *Appearance
type BoxConf ¶
type BoxConf struct { Name string `json:"name"` // 笔记本名称 Sort int `json:"sort"` // 排序字段 Icon string `json:"icon"` // 图标 Closed bool `json:"closed"` // 是否处于关闭状态 RefCreateSaveBox string `json:"refCreateSaveBox"` // 块引时新建文档存储笔记本 RefCreateSavePath string `json:"refCreateSavePath"` // 块引时新建文档存储路径 DocCreateSaveBox string `json:"docCreateSaveBox"` // 新建文档存储笔记本 DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径 DailyNoteSavePath string `json:"dailyNoteSavePath"` // 新建日记存储路径 DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径 SortMode int `json:"sortMode"` // 排序方式 }
BoxConf 维护 .siyuan/conf.json 笔记本配置。
func NewBoxConf ¶
func NewBoxConf() *BoxConf
type D3 ¶
type D3 struct { NodeSize float64 `json:"nodeSize"` LineWidth float64 `json:"linkWidth"` LineOpacity float64 `json:"lineOpacity"` CenterStrength float64 `json:"centerStrength"` CollideRadius float64 `json:"collideRadius"` CollideStrength float64 `json:"collideStrength"` LinkDistance int `json:"linkDistance"` Arrow bool `json:"arrow"` }
type Editor ¶
type Editor struct { AllowHTMLBLockScript bool `json:"allowHTMLBLockScript"` // 允许执行 HTML 块内脚本 FontSize int `json:"fontSize"` // 字体大小 FontSizeScrollZoom bool `json:"fontSizeScrollZoom"` // 字体大小是否支持滚轮缩放 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"` // 是否显示网络图片角标 GenerateHistoryInterval int `json:"generateHistoryInterval"` // 生成历史时间间隔,单位:分钟 HistoryRetentionDays int `json:"historyRetentionDays"` // 历史保留天数 Emoji []string `json:"emoji"` // 常用表情 VirtualBlockRef bool `json:"virtualBlockRef"` // 是否启用虚拟引用 VirtualBlockRefExclude string `json:"virtualBlockRefExclude"` // 虚拟引用关键字排除列表 VirtualBlockRefInclude string `json:"virtualBlockRefInclude"` // 虚拟引用关键字包含列表 BlockRefDynamicAnchorTextMaxLen int `json:"blockRefDynamicAnchorTextMaxLen"` // 块引动态锚文本最大长度 PlantUMLServePath string `json:"plantUMLServePath"` // PlantUML 伺服地址 FullWidth bool `json:"fullWidth"` // 是否使用最大宽度 KaTexMacros string `json:"katexMacros"` // KeTex 宏定义 ReadOnly bool `json:"readOnly"` // 只读模式 EmbedBlockBreadcrumb bool `json:"embedBlockBreadcrumb"` // 嵌入块是否显示面包屑 ListLogicalOutdent bool `json:"listLogicalOutdent"` // 列表逻辑反向缩进 ListItemDotNumberClickFocus bool `json:"listItemDotNumberClickFocus"` // 单击列表项标记聚焦 FloatWindowMode int `json:"floatWindowMode"` // 浮窗触发模式,0:光标悬停,1:按住 Ctrl 悬停,2:不触发浮窗 DynamicLoadBlocks int `json:"dynamicLoadBlocks"` // 块动态数,可配置区间 [48, 1024] Justify bool `json:"justify"` // 是否两端对齐 RTL bool `json:"rtl"` // 是否从右到左显示 Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查 OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块 BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量 BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量 Markdown *util.Markdown `json:"markdown"` // Markdown 配置 }
type Export ¶
type Export struct { ParagraphBeginningSpace bool `json:"paragraphBeginningSpace"` // 是否使用中文排版段落开头空两格 AddTitle bool `json:"addTitle"` // 是否添加标题 // 内容块引用导出模式 // 2:锚文本块链 // 3:仅锚文本 // 4:块引转脚注 // 5:锚点哈希 https://github.com/siyuan-note/siyuan/issues/10265 // (0:使用原始文本,1:使用 Blockquote。0 和 1 都已经废弃 https://github.com/siyuan-note/siyuan/issues/3155) BlockRefMode int `json:"blockRefMode"` BlockEmbedMode int `json:"blockEmbedMode"` // 内容块引用导出模式,0:使用原始文本,1:使用 Blockquote BlockRefTextLeft string `json:"blockRefTextLeft"` // 内容块引用导出锚文本左侧符号,默认留空 BlockRefTextRight string `json:"blockRefTextRight"` // 内容块引用导出锚文本右侧符号,默认留空 TagOpenMarker string `json:"tagOpenMarker"` // 标签开始标记符,默认是 # TagCloseMarker string `json:"tagCloseMarker"` // 标签结束标记符,默认是 # FileAnnotationRefMode int `json:"fileAnnotationRefMode"` // 文件标注引用导出模式,0:文件名 - 页码 - 锚文本,1:仅锚文本 PandocBin string `json:"pandocBin"` // Pandoc 可执行文件路径 MarkdownYFM bool `json:"markdownYFM"` // Markdown 导出时是否添加 YAML Front Matter https://github.com/siyuan-note/siyuan/issues/7727 DocxTemplate string `json:"docxTemplate"` // Docx 导出时模板文件路径 PDFWatermarkStr string `json:"pdfWatermarkStr"` // PDF 导出时水印文本或水印文件路径 PDFWatermarkDesc string `json:"pdfWatermarkDesc"` // PDF 导出时水印位置、大小和样式等 ImageWatermarkStr string `json:"imageWatermarkStr"` // 图片导出时水印文本或水印文件路径 ImageWatermarkDesc string `json:"imageWatermarkDesc"` // 图片导出时水印位置、大小和样式等 }
type FileTree ¶
type FileTree struct { AlwaysSelectOpenedFile bool `json:"alwaysSelectOpenedFile"` // 是否自动选中当前打开的文件 OpenFilesUseCurrentTab bool `json:"openFilesUseCurrentTab"` // 在当前页签打开文件 RefCreateSaveBox string `json:"refCreateSaveBox"` // 块引时新建文档存储笔记本 RefCreateSavePath string `json:"refCreateSavePath"` // 块引时新建文档存储路径 DocCreateSaveBox string `json:"docCreateSaveBox"` // 新建文档存储笔记本 DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径 MaxListCount int `json:"maxListCount"` // 最大列出数量 MaxOpenTabCount int `json:"maxOpenTabCount"` // 最大打开页签数量 AllowCreateDeeper bool `json:"allowCreateDeeper"` // 允许创建超过 7 层深度的子文档 RemoveDocWithoutConfirm bool `json:"removeDocWithoutConfirm"` // 删除文档时是否不需要确认 CloseTabsOnStart bool `json:"closeTabsOnStart"` // 启动时关闭所有页签 UseSingleLineSave bool `json:"useSingleLineSave"` // 使用单行保存文档 .sy 和属性视图 .json Sort int `json:"sort"` // 排序方式 }
func NewFileTree ¶
func NewFileTree() *FileTree
type Flashcard ¶
type Flashcard struct { NewCardLimit int `json:"newCardLimit"` // 新卡上限 https://github.com/siyuan-note/siyuan/issues/7695 ReviewCardLimit int `json:"reviewCardLimit"` // 复习卡上限 https://github.com/siyuan-note/siyuan/issues/7703 Mark bool `json:"mark"` // 是否启用标记制卡 https://github.com/siyuan-note/siyuan/issues/7794 List bool `json:"list"` // 是否启用列表块制卡 https://github.com/siyuan-note/siyuan/issues/7701 SuperBlock bool `json:"superBlock"` // 是否启用超级块制卡 https://github.com/siyuan-note/siyuan/issues/7702 Heading bool `json:"heading"` // 是否启用标题块制卡 https://github.com/siyuan-note/siyuan/issues/9005 Deck bool `json:"deck"` // 是否启用卡包制卡 https://github.com/siyuan-note/siyuan/issues/7724 ReviewMode int `json:"reviewMode"` // 复习模式,0:新旧混合,1:新卡优先,2:旧卡优先 https://github.com/siyuan-note/siyuan/issues/10303 // Apply result optimized by FSRS optimizer https://github.com/siyuan-note/siyuan/issues/9309 RequestRetention float64 `json:"requestRetention"` MaximumInterval int `json:"maximumInterval"` Weights string `json:"weights"` }
func NewFlashcard ¶
func NewFlashcard() *Flashcard
type GlobalGraph ¶
type GlobalGraph struct { MinRefs int `json:"minRefs"` // 引用次数 DailyNote bool `json:"dailyNote"` *TypeFilter `json:"type"` *D3 `json:"d3"` }
func NewGlobalGraph ¶
func NewGlobalGraph() *GlobalGraph
type Graph ¶
type Graph struct { MaxBlocks int `json:"maxBlocks"` // 内容块最大显示数 Local *LocalGraph `json:"local"` // 局部图 Global *GlobalGraph `json:"global"` // 全局图 }
type LocalGraph ¶
type LocalGraph struct { DailyNote bool `json:"dailyNote"` *TypeFilter `json:"type"` *D3 `json:"d3"` }
func NewLocalGraph ¶
func NewLocalGraph() *LocalGraph
type NetworkProxy ¶
type NetworkProxy struct { Scheme string `json:"scheme"` Host string `json:"host"` Port string `json:"port"` }
func (*NetworkProxy) String ¶
func (np *NetworkProxy) String() string
type OpenAI ¶
type OpenAI struct { APIKey string `json:"apiKey"` APITimeout int `json:"apiTimeout"` APIProxy string `json:"apiProxy"` APIModel string `json:"apiModel"` APIMaxTokens int `json:"apiMaxTokens"` APITemperature float64 `json:"apiTemperature"` APIMaxContexts int `json:"apiMaxContexts"` APIBaseURL string `json:"apiBaseURL"` APIUserAgent string `json:"apiUserAgent"` APIProvider string `json:"apiProvider"` // OpenAI, Azure APIVersion string `json:"apiVersion"` // Azure API version }
type Repo ¶
type Repo struct { Key []byte `json:"key"` // AES 密钥 // 同步索引计时,单位毫秒,超过该时间则提示用户索引性能下降 // If the data repo indexing time is greater than 12s, prompt user to purge the data repo https://github.com/siyuan-note/siyuan/issues/9613 // Supports configuring data sync index time-consuming prompts https://github.com/siyuan-note/siyuan/issues/9698 SyncIndexTiming int64 `json:"syncIndexTiming"` }
func (*Repo) GetSaveDir ¶
type S3 ¶
type S3 struct { Endpoint string `json:"endpoint"` // 服务端点 AccessKey string `json:"accessKey"` // Access Key SecretKey string `json:"secretKey"` // Secret Key Bucket string `json:"bucket"` // 存储空间 Region string `json:"region"` // 存储区域 PathStyle bool `json:"pathStyle"` // 是否使用路径风格 SkipTlsVerify bool `json:"skipTlsVerify"` // 是否跳过 TLS 验证 Timeout int `json:"timeout"` // 超时时间,单位:秒 }
type Search ¶
type Search struct { Document bool `json:"document"` Heading bool `json:"heading"` List bool `json:"list"` ListItem bool `json:"listItem"` CodeBlock bool `json:"codeBlock"` MathBlock bool `json:"mathBlock"` Table bool `json:"table"` Blockquote bool `json:"blockquote"` SuperBlock bool `json:"superBlock"` Paragraph bool `json:"paragraph"` HTMLBlock bool `json:"htmlBlock"` EmbedBlock bool `json:"embedBlock"` DatabaseBlock bool `json:"databaseBlock"` AudioBlock bool `json:"audioBlock"` VideoBlock bool `json:"videoBlock"` IFrameBlock bool `json:"iframeBlock"` WidgetBlock bool `json:"widgetBlock"` Limit int `json:"limit"` CaseSensitive bool `json:"caseSensitive"` Name bool `json:"name"` Alias bool `json:"alias"` Memo bool `json:"memo"` IAL bool `json:"ial"` IndexAssetPath bool `json:"indexAssetPath"` BacklinkMentionName bool `json:"backlinkMentionName"` BacklinkMentionAlias bool `json:"backlinkMentionAlias"` BacklinkMentionAnchor bool `json:"backlinkMentionAnchor"` BacklinkMentionDoc bool `json:"backlinkMentionDoc"` BacklinkMentionKeywordsLimit int `json:"backlinkMentionKeywordsLimit"` VirtualRefName bool `json:"virtualRefName"` VirtualRefAlias bool `json:"virtualRefAlias"` VirtualRefAnchor bool `json:"virtualRefAnchor"` VirtualRefDoc bool `json:"virtualRefDoc"` }
func (*Search) TypeFilter ¶
type Stat ¶
type Stat struct { TreeCount int `json:"treeCount"` CTreeCount int `json:"cTreeCount"` BlockCount int `json:"blockCount"` CBlockCount int `json:"cBlockCount"` DataSize int64 `json:"dataSize"` CDataSize int64 `json:"cDataSize"` AssetsSize int64 `json:"assetsSize"` CAssetsSize int64 `json:"cAssetsSize"` }
type Sync ¶
type Sync struct { CloudName string `json:"cloudName"` // 云端同步目录名称 Enabled bool `json:"enabled"` // 是否开启同步 Perception bool `json:"perception"` // 是否开启感知 Mode int `json:"mode"` // 同步模式,0:未设置(为兼容已有配置,initConf 函数中会转换为 1),1:自动,2:手动 https://github.com/siyuan-note/siyuan/issues/5089,3:完全手动 https://github.com/siyuan-note/siyuan/issues/7295 Synced int64 `json:"synced"` // 最近同步时间 Stat string `json:"stat"` // 最近同步统计信息 GenerateConflictDoc bool `json:"generateConflictDoc"` // 云端同步冲突时是否生成冲突文档 Provider int `json:"provider"` // 云端存储服务提供者 S3 *S3 `json:"s3"` // S3 对象存储服务配置 WebDAV *WebDAV `json:"webdav"` // WebDAV 服务配置 }
type System ¶
type System struct { ID string `json:"id"` Name string `json:"name"` KernelVersion string `json:"kernelVersion"` OS string `json:"os"` OSPlatform string `json:"osPlatform"` Container string `json:"container"` // docker, android, ios, std IsMicrosoftStore bool `json:"isMicrosoftStore"` IsInsider bool `json:"isInsider"` HomeDir string `json:"homeDir"` WorkspaceDir string `json:"workspaceDir"` AppDir string `json:"appDir"` ConfDir string `json:"confDir"` DataDir string `json:"dataDir"` NetworkServe bool `json:"networkServe"` // 是否开启网络伺服 NetworkProxy *NetworkProxy `json:"networkProxy"` UploadErrLog bool `json:"uploadErrLog"` DisableGoogleAnalytics bool `json:"disableGoogleAnalytics"` DownloadInstallPkg bool `json:"downloadInstallPkg"` AutoLaunch2 int `json:"autoLaunch2"` // 0:不自动启动,1:自动启动,2:自动启动+隐藏主窗口 LockScreenMode int `json:"lockScreenMode"` // 0:手动,1:手动+跟随系统 https://github.com/siyuan-note/siyuan/issues/9087 }
type TypeFilter ¶
type TypeFilter struct { Tag bool `json:"tag"` Paragraph bool `json:"paragraph"` Heading bool `json:"heading"` Math bool `json:"math"` Code bool `json:"code"` Table bool `json:"table"` List bool `json:"list"` ListItem bool `json:"listItem"` Blockquote bool `json:"blockquote"` Super bool `json:"super"` }
type User ¶
type User struct { UserId string `json:"userId"` UserName string `json:"userName"` UserAvatarURL string `json:"userAvatarURL"` UserHomeBImgURL string `json:"userHomeBImgURL"` UserTitles []*UserTitle `json:"userTitles"` UserIntro string `json:"userIntro"` UserNickname string `json:"userNickname"` UserCreateTime string `json:"userCreateTime"` UserSiYuanProExpireTime float64 `json:"userSiYuanProExpireTime"` UserToken string `json:"userToken"` UserTokenExpireTime string `json:"userTokenExpireTime"` UserSiYuanRepoSize float64 `json:"userSiYuanRepoSize"` UserSiYuanPointExchangeRepoSize float64 `json:"userSiYuanPointExchangeRepoSize"` UserSiYuanAssetSize float64 `json:"userSiYuanAssetSize"` UserTrafficUpload float64 `json:"userTrafficUpload"` UserTrafficDownload float64 `json:"userTrafficDownload"` UserTrafficAPIGet float64 `json:"userTrafficAPIGet"` UserTrafficAPIPut float64 `json:"userTrafficAPIPut"` UserTrafficTime float64 `json:"userTrafficTime"` UserSiYuanSubscriptionPlan float64 `json:"userSiYuanSubscriptionPlan"` // -1:未订阅,0:标准订阅,1:教育订阅,2:试用 UserSiYuanSubscriptionStatus float64 `json:"userSiYuanSubscriptionStatus"` // -1:未订阅,0:订阅可用,1:订阅封禁,2:订阅过期 UserSiYuanSubscriptionType float64 `json:"userSiYuanSubscriptionType"` // 0 年付;1 终生;2 月付 UserSiYuanOneTimePayStatus float64 `json:"userSiYuanOneTimePayStatus"` // 0 未付费;1 已付费 }
func (*User) GetCloudRepoAvailableSize ¶
Click to show internal directories.
Click to hide internal directories.