Documentation
¶
Index ¶
- Constants
- Variables
- func AddFlashcards(deckID string, blockIDs []string) (err error)
- func AddPDFOutline(id, p string, merge bool) (err error)
- func AutoFixIndex()
- func AutoFlushAssetsTexts()
- func AutoFlushTx()
- func AutoGenerateDocHistory()
- func AutoOCRAssets()
- func AutoRefreshCheck()
- func AutoSpace(rootID string) (err error)
- func AutoStat()
- func AutoSync()
- func BatchExportMarkdown(boxID, folderPath string) (zipPath string)
- func BazaarIcons() (icons []*bazaar.Icon)
- func BazaarTemplates() (templates []*bazaar.Template)
- func BazaarThemes() (ret []*bazaar.Theme)
- func BazaarWidgets() (widgets []*bazaar.Widget)
- func BlocksWordCount(ids []string) (ret *util.BlockStatResult)
- func BookmarkLabels() (ret []string)
- func BootSyncData()
- func BuildGraph(query string) (boxID string, nodes []*GraphNode, links []*GraphLink)
- func BuildTreeGraph(id, query string) (boxID string, nodes []*GraphNode, links []*GraphLink)
- func ChangeBoxSort(boxIDs []string)
- func ChangeFileTreeSort(boxID string, paths []string)
- func ChangeHistoryTick(minutes int)
- func CheckActivationcode(code string) (retCode int, msg string)
- func CheckAuth(c *gin.Context)
- func CheckReadonly(c *gin.Context)
- func CheckUpdate(showMsg bool)
- func CheckoutRepo(id string) (err error)
- func ClearWorkspaceHistory() (err error)
- func Close(force bool, execInstallPkg int) (exitCode int)
- func CloseWatchAssets()
- func ContentStat(content string) (ret *util.BlockStatResult)
- func CreateBox(name string) (id string, err error)
- func CreateCloudSyncDir(name string) (err error)
- func CreateDailyNote(boxID string) (p string, existed bool, err error)
- func CreateDeck(name string) (deck *riff.Deck, err error)
- func CreateDocByMd(boxID, p, title, md string, sorts []string) (err error)
- func CreateWithMarkdown(boxID, hPath, md string) (id string, err error)
- func DeactivateUser() (err error)
- func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath string, err error)
- func DocImageAssets(rootID string) (ret []string, err error)
- func DocSaveAsTemplate(id string, overwrite bool) (code int, err error)
- func DownloadCloudSnapshot(tag, id string) (err error)
- func DuplicateDoc(rootID string) (ret *parse.Tree, err error)
- func Export2Liandi(id string) (err error)
- func ExportData() (zipPath string, err error)
- func ExportDataInFolder(exportFolder string) (name string, err error)
- func ExportDocx(id, savePath string, removeAssets, merge bool) (err error)
- func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, dom string)
- func ExportMarkdown(id string) (name, zipPath string)
- func ExportMarkdownContent(id string) (hPath, exportedMd string)
- func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string)
- func ExportNotebookSY(id string) (zipPath string)
- func ExportSY(id string) (name, zipPath string)
- func ExportStdMarkdown(id string) string
- func ExportSystemLog() (zipPath string)
- func FindReplace(keyword, replacement string, ids []string, method int) (err error)
- func FullReindex()
- func FullTextSearchHistory(query, box, op string, typ, page int) (ret []string, pageCount, totalCount int)
- func GetAssetAbsPath(relativePath string) (absPath string, err error)
- func GetBlockAttrs(id string) (ret map[string]string)
- func GetBlockDOM(id string) (ret string)
- func GetBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string)
- func GetBlockIndex(id string) (ret int)
- func GetBlockKramdown(id string) (ret string)
- func GetBlockRefIDs(id string) (refIDs, refTexts, defIDs []string)
- func GetBlockRefIDsByFileAnnotationID(id string) (refIDs, refTexts []string)
- func GetBlockRefText(id string) string
- func GetCaptcha(c *gin.Context)
- func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error)
- func GetCloudShorthand(id string) (ret map[string]interface{}, err error)
- func GetCloudShorthands(page int) (result map[string]interface{}, err error)
- func GetCloudSpace() (s *Sync, b *Backup, ...)
- func GetDecks() (decks []*riff.Deck)
- func GetDoc(startID, endID, id string, index int, keyword string, mode int, size int, ...) (blockCount, childBlockCount int, dom, parentID, parent2ID, rootID, typ string, ...)
- func GetDocHistoryContent(historyPath, keyword string) (id, rootID, content string, isLargeDoc bool, err error)
- func GetFullHPathByID(id string) (hPath string, err error)
- func GetHPathByID(id string) (hPath string, err error)
- func GetHPathByPath(boxID, p string) (hPath string, err error)
- func GetHPathsByPaths(paths []string) (hPaths []string, err error)
- func GetHeadingChildrenDOM(id string) (ret string)
- func GetHeadingChildrenIDs(id string) (ret []string)
- func GetHistoryDir(suffix string) (ret string, err error)
- func GetLocalStorage() (ret map[string]interface{}, err error)
- func GetPackageREADME(repoURL, repoHash string) (ret string)
- func HTML2Markdown(htmlStr string) (markdown string, err error)
- func HandleSignal()
- func Heading2Doc(srcHeadingID, targetBoxID, targetPath string) (srcRootBlockID, newTargetPath string, err error)
- func HookDesktopUIProc()
- func HumanizeTime(then time.Time) string
- func ImportData(zipPath string) (err error)
- func ImportFromLocalPath(boxID, localPath string, toPath string) (err error)
- func ImportRepoKey(base64Key string) (err error)
- func ImportSY(zipPath, boxID, toPath string) (err error)
- func IncSync()
- func IndexRefs()
- func IndexRepo(memo string) (err error)
- func InitAppearance()
- func InitBoxes()
- func InitConf()
- func InitFlashcards()
- func InitRepoKey() (err error)
- func InitRepoKeyFromPassphrase(passphrase string) (err error)
- func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap map[string]interface{}, err error)
- func InstallBazaarIcon(repoURL, repoHash, iconName string) error
- func InstallBazaarTemplate(repoURL, repoHash, templateName string) error
- func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bool) error
- func InstallBazaarWidget(repoURL, repoHash, widgetName string) error
- func InstalledIcons() (icons []*bazaar.Icon)
- func InstalledTemplates() (templates []*bazaar.Template)
- func InstalledThemes() (ret []*bazaar.Theme)
- func InstalledWidgets() (widgets []*bazaar.Widget)
- func IsFoldHeading(transactions *[]*Transaction) bool
- func IsSubscriber() bool
- func IsSyncingFile(rootID string) (ret bool)
- func IsUnfoldHeading(transactions *[]*Transaction) bool
- func IsUserGuide(boxID string) bool
- func ListItem2Doc(srcListItemID, targetBoxID, targetPath string) (srcRootBlockID, newTargetPath string, err error)
- func LoadAssetsTexts()
- func LoadSnippets() (ret []*conf.Snippet, err error)
- func LoadTree(boxID, p string) (*parse.Tree, error)
- func LoadUploadToken() (err error)
- func Login(userName, password, captcha string) (ret *gulu.Result, err error)
- func Login2fa(token, code string) (map[string]interface{}, error)
- func LoginAuth(c *gin.Context)
- func LogoutAuth(c *gin.Context)
- func LogoutUser()
- func Mount(boxID string) (alreadyMount bool, err error)
- func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error)
- func NetImg2LocalAssets(rootID string) (err error)
- func NewLute() (ret *lute.Lute)
- func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc bool, err error)
- func PerformTransactions(transactions *[]*Transaction) (err error)
- func Preview(id string) string
- func ReadCustomCSS(themeName string) (ret map[string]map[string]string, err error)
- func RefreshBacklink(id string)
- func RefreshUser(token string) error
- func ReindexHistory() (err error)
- func RemoveBookmark(bookmark string) (err error)
- func RemoveBox(boxID string) (err error)
- func RemoveCloudRepoTag(tag string) (err error)
- func RemoveCloudShorthands(ids []string) (err error)
- func RemoveCloudSyncDir(name string) (err error)
- func RemoveCriterion(name string) (err error)
- func RemoveDeck(deckID string) (err error)
- func RemoveDoc(boxID, p string) (err error)
- func RemoveDocs(paths []string) (err error)
- func RemoveFlashcards(deckID string, blockIDs []string) (err error)
- func RemoveLocalStorageVal(key string) (err error)
- func RemoveRecentDoc(ids []string)
- func RemoveSnippet(id string) (ret *conf.Snippet, err error)
- func RemoveTag(label string) (err error)
- func RemoveTagSnapshot(tag string) (err error)
- func RemoveUnusedAsset(p string) (ret string)
- func RemoveUnusedAssets() (ret []string)
- func RenameAsset(oldPath, newName string) (err error)
- func RenameBookmark(oldBookmark, newBookmark string) (err error)
- func RenameBox(boxID, name string) (err error)
- func RenameDeck(deckID, name string) (err error)
- func RenameDoc(boxID, p, title string) (err error)
- func RenameTag(oldLabel, newLabel string) (err error)
- func RenderGoTemplate(templateContent string) (ret string, err error)
- func RenderTemplate(p, id string) (string, error)
- func ResetBlockAttrs(id string, nameValues map[string]string) (err error)
- func ResetRepo() (err error)
- func ReviewFlashcard(deckID string, blockID string, rating riff.Rating) (err error)
- func RollbackAssetsHistory(historyPath string) (err error)
- func RollbackDocHistory(boxID, historyPath string) (err error)
- func RollbackNotebookHistory(historyPath string) (err error)
- func SaveAssetsTexts()
- func SearchAssetsByName(keyword string) (ret []*cache.Asset)
- func SearchDocsByKeyword(keyword string) (ret []map[string]string)
- func SearchTags(keyword string) (ret []string)
- func ServeFile(c *gin.Context, filePath string) (err error)
- func SetBlockAttrs(id string, nameValues map[string]string) (err error)
- func SetBlockReminder(id string, timed string) (err error)
- func SetBoxIcon(boxID, icon string)
- func SetCloudBlockReminder(id, data string, timed int64) (err error)
- func SetCloudSyncDir(name string)
- func SetCriterion(criterion *Criterion) (err error)
- func SetLocalStorage(val interface{}) (err error)
- func SetLocalStorageVal(key string, val interface{}) (err error)
- func SetRecentDoc(doc *RecentDoc) (err error)
- func SetRecentDocByTree(tree *parse.Tree)
- func SetSnippet(snippets []*conf.Snippet) (err error)
- func SetSyncEnable(b bool) (err error)
- func SetSyncGenerateConflictDoc(b bool)
- func SetSyncMode(mode int) (err error)
- func SetSyncProvider(provider int) (err error)
- func SetSyncProviderS3(s3 *conf.S3) (err error)
- func SetSyncProviderWebDAV(webdav *conf.WebDAV) (err error)
- func StartFreeTrial() (err error)
- func StatTree(id string) (ret *util.BlockStatResult)
- func SwapBlockRef(refID, defID string, includeChildren bool) (err error)
- func SyncData(boot, exit, byHand bool)
- func TagSnapshot(id, name string) (err error)
- func TryAccessFileByBlockID(id string) (ok bool)
- func UninstallBazaarIcon(iconName string) error
- func UninstallBazaarTemplate(templateName string) error
- func UninstallBazaarTheme(themeName string) error
- func UninstallBazaarWidget(widgetName string) error
- func Unmount(boxID string)
- func UnusedAssets() (ret []string)
- func Upload(c *gin.Context)
- func UploadAssets2Cloud(rootID string) (err error)
- func UploadCloudSnapshot(tag, id string) (err error)
- func UseActivationcode(code string) (err error)
- func WaitForWritingFiles()
- func WatchAssets()
- func WriteCustomCSS(themeName string, cssMap map[string]interface{}) (err error)
- type Announcement
- type AppConf
- func (conf *AppConf) Box(boxID string) *Box
- func (conf *AppConf) BoxNames(boxIDs []string) (ret map[string]string)
- func (conf *AppConf) Close()
- func (conf *AppConf) GetBoxes() (ret []*Box)
- func (conf *AppConf) GetClosedBoxes() (ret []*Box)
- func (conf *AppConf) GetOpenedBoxes() (ret []*Box)
- func (conf *AppConf) Language(num int) (ret string)
- func (conf *AppConf) Save()
- type Backlink
- type Backup
- type Block
- func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, ...) (ret []*Block, matchedBlockCount, matchedRootCount int)
- func GetBlock(id string) (ret *Block, err error)
- func GetFlashcards(deckID string, page int) (blocks []*Block, total, pageCount int)
- func RecentUpdatedBlocks() (ret []*Block)
- func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, newDoc bool)
- func SearchTemplate(keyword string) (ret []*Block)
- func SearchWidget(keyword string) (ret []*Block)
- type BlockInfo
- type BlockPath
- type Bookmark
- type BookmarkBlocks
- type BookmarkLabel
- type Bookmarks
- type Box
- func (box *Box) Exist(p string) bool
- func (box *Box) GetConf() (ret *conf.BoxConf)
- func (box *Box) Index(fullRebuildIndex bool) (treeCount int, treeSize int64)
- func (box *Box) ListFiles(path string) (ret []*FileInfo)
- func (box *Box) Ls(p string) (ret []*FileInfo, totals int, err error)
- func (box *Box) Mkdir(path string) error
- func (box *Box) MkdirAll(path string) error
- func (box *Box) Move(oldPath, newPath string) error
- func (box *Box) Remove(path string) error
- func (box *Box) SaveConf(conf *conf.BoxConf)
- func (box *Box) Stat(p string) (ret *FileInfo)
- func (box *Box) Unindex()
- func (box *Box) UpdateHistoryGenerated()
- type Criterion
- type CriterionTypes
- type DiffFile
- type DiffIndex
- type EmbedBlock
- type File
- type FileInfo
- type Flashcard
- type GraphArrows
- type GraphArrowsTo
- type GraphLink
- type GraphLinkColor
- type GraphNode
- type GraphNodeColor
- type History
- type HistoryItem
- type LeftRightDiff
- type Operation
- type Path
- func GetBacklink(id, keyword, mentionKeyword string, beforeLen int) (boxID string, linkPaths, mentionPaths []*Path, ...)
- func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode int) (boxID string, backlinks, backmentions []*Path, ...)
- func Outline(rootID string) (ret []*Path, err error)
- type RecentDoc
- type Snapshot
- type Sync
- type Tag
- type TagBlocks
- type Tags
- type Transaction
- type TxErr
- type TypeCount
Constants ¶
View Source
const ( MaskedUserData = "" MaskedAccessAuthCode = "*******" )
View Source
const ( HistoryOpClean = "clean" HistoryOpUpdate = "update" HistoryOpDelete = "delete" HistoryOpFormat = "format" HistoryOpSync = "sync" )
View Source
const ( HistoryTypeDocName = 0 HistoryTypeDoc = 1 HistoryTypeAsset = 2 )
View Source
const ( TxErrCodeBlockNotFound = 0 TxErrCodeUnableAccessFile = 1 TxErrCodeWriteTree = 2 )
Variables ¶
View Source
var ( BootSyncSucc = -1 // -1:未执行,0:执行成功,1:执行失败 ExitSyncSucc = -1 )
View Source
var CustomEmojis = sync.Map{}
View Source
var Decks = map[string]*riff.Deck{}
View Source
var ErrBlockNotFound = errors.New("block not found")
View Source
var ErrBoxNotFound = errors.New("notebook not found")
View Source
var ErrFailedToConnectCloudServer = errors.New("failed to connect cloud server")
View Source
var ErrTreeNotFound = errors.New("tree not found")
Functions ¶
func AddFlashcards ¶
func AddPDFOutline ¶
func AutoFixIndex ¶
func AutoFixIndex()
AutoFixIndex 自动校验数据库索引 https://github.com/siyuan-note/siyuan/issues/7016
func AutoFlushAssetsTexts ¶
func AutoFlushAssetsTexts()
func AutoFlushTx ¶
func AutoFlushTx()
func AutoGenerateDocHistory ¶
func AutoGenerateDocHistory()
func AutoOCRAssets ¶
func AutoOCRAssets()
func AutoRefreshCheck ¶
func AutoRefreshCheck()
func BatchExportMarkdown ¶
func BazaarIcons ¶
func BazaarTemplates ¶
func BazaarThemes ¶
func BazaarWidgets ¶
func BlocksWordCount ¶
func BlocksWordCount(ids []string) (ret *util.BlockStatResult)
func BookmarkLabels ¶
func BookmarkLabels() (ret []string)
func BootSyncData ¶
func BootSyncData()
func BuildGraph ¶
func BuildTreeGraph ¶
func ChangeBoxSort ¶
func ChangeBoxSort(boxIDs []string)
func ChangeFileTreeSort ¶
func ChangeHistoryTick ¶
func ChangeHistoryTick(minutes int)
func CheckActivationcode ¶
func CheckReadonly ¶
func CheckUpdate ¶
func CheckUpdate(showMsg bool)
func CheckoutRepo ¶
func ClearWorkspaceHistory ¶
func ClearWorkspaceHistory() (err error)
func Close ¶
Close 退出内核进程.
force:是否不执行同步过程而直接退出 execInstallPkg:是否执行新版本安装包 0:默认按照设置项 System.DownloadInstallPkg 检查并推送提示 1:不执行新版本安装 2:执行新版本安装
func CloseWatchAssets ¶
func CloseWatchAssets()
func ContentStat ¶
func ContentStat(content string) (ret *util.BlockStatResult)
func CreateCloudSyncDir ¶
func CreateDocByMd ¶
func CreateWithMarkdown ¶
func DeactivateUser ¶
func DeactivateUser() (err error)
func Doc2Heading ¶
func DocImageAssets ¶
func DownloadCloudSnapshot ¶
func Export2Liandi ¶
func ExportData ¶
func ExportDataInFolder ¶
func ExportDocx ¶
func ExportHTML ¶
func ExportMarkdown ¶
func ExportMarkdownContent ¶
func ExportMarkdownHTML ¶
func ExportNotebookSY ¶
func ExportStdMarkdown ¶
func ExportSystemLog ¶
func ExportSystemLog() (zipPath string)
func FindReplace ¶
func FullReindex ¶
func FullReindex()
func FullTextSearchHistory ¶
func GetAssetAbsPath ¶
func GetBlockAttrs ¶
func GetBlockDOM ¶
func GetBlockDefIDsByRefText ¶
func GetBlockIndex ¶
func GetBlockKramdown ¶
func GetBlockRefIDs ¶
func GetBlockRefText ¶
func GetCaptcha ¶
func GetCloudShorthand ¶
func GetCloudShorthands ¶
func GetCloudSpace ¶
func GetDocHistoryContent ¶
func GetFullHPathByID ¶
func GetHPathByID ¶
func GetHPathByPath ¶
func GetHPathsByPaths ¶
func GetHeadingChildrenDOM ¶
func GetHeadingChildrenIDs ¶
func GetHistoryDir ¶
func GetLocalStorage ¶
func GetPackageREADME ¶
func HTML2Markdown ¶
func HandleSignal ¶
func HandleSignal()
func Heading2Doc ¶
func HookDesktopUIProc ¶
func HookDesktopUIProc()
func HumanizeTime ¶
func ImportData ¶
func ImportFromLocalPath ¶
func ImportRepoKey ¶
func InitAppearance ¶
func InitAppearance()
func InitFlashcards ¶
func InitFlashcards()
func InitRepoKey ¶
func InitRepoKey() (err error)
func InsertLocalAssets ¶
func InstallBazaarIcon ¶
func InstallBazaarTemplate ¶
func InstallBazaarTheme ¶
func InstallBazaarWidget ¶
func InstalledIcons ¶
func InstalledTemplates ¶
func InstalledThemes ¶
func InstalledWidgets ¶
func IsFoldHeading ¶
func IsFoldHeading(transactions *[]*Transaction) bool
func IsSubscriber ¶
func IsSubscriber() bool
func IsSyncingFile ¶
func IsUnfoldHeading ¶
func IsUnfoldHeading(transactions *[]*Transaction) bool
func IsUserGuide ¶
func ListItem2Doc ¶
func LoadAssetsTexts ¶
func LoadAssetsTexts()
func LoadSnippets ¶
func LoadUploadToken ¶
func LoadUploadToken() (err error)
func LogoutAuth ¶
func LogoutUser ¶
func LogoutUser()
func NetImg2LocalAssets ¶
func OpenRepoSnapshotDoc ¶
func PerformTransactions ¶
func PerformTransactions(transactions *[]*Transaction) (err error)
func ReadCustomCSS ¶
func RefreshBacklink ¶
func RefreshBacklink(id string)
func RefreshUser ¶
func ReindexHistory ¶
func ReindexHistory() (err error)
func RemoveBookmark ¶
func RemoveCloudRepoTag ¶
func RemoveCloudShorthands ¶
func RemoveCloudSyncDir ¶
func RemoveCriterion ¶
func RemoveDeck ¶
func RemoveDocs ¶
func RemoveFlashcards ¶
func RemoveLocalStorageVal ¶
func RemoveRecentDoc ¶
func RemoveRecentDoc(ids []string)
func RemoveTagSnapshot ¶
func RemoveUnusedAsset ¶
func RemoveUnusedAssets ¶
func RemoveUnusedAssets() (ret []string)
func RenameAsset ¶
func RenameBookmark ¶
func RenameDeck ¶
func RenderGoTemplate ¶
func RenderTemplate ¶
func ReviewFlashcard ¶
func RollbackAssetsHistory ¶
func RollbackDocHistory ¶
func RollbackNotebookHistory ¶
func SaveAssetsTexts ¶
func SaveAssetsTexts()
func SearchAssetsByName ¶
func SearchDocsByKeyword ¶
func SearchTags ¶
func SetBlockReminder ¶
func SetBoxIcon ¶
func SetBoxIcon(boxID, icon string)
func SetCloudBlockReminder ¶
func SetCloudSyncDir ¶
func SetCloudSyncDir(name string)
func SetCriterion ¶
func SetLocalStorage ¶
func SetLocalStorage(val interface{}) (err error)
func SetLocalStorageVal ¶
func SetRecentDoc ¶
func SetRecentDocByTree ¶
func SetSnippet ¶
func SetSyncEnable ¶
func SetSyncGenerateConflictDoc ¶
func SetSyncGenerateConflictDoc(b bool)
func SetSyncMode ¶
func SetSyncProvider ¶
func SetSyncProviderS3 ¶
func SetSyncProviderWebDAV ¶
func StartFreeTrial ¶
func StartFreeTrial() (err error)
func StatTree ¶
func StatTree(id string) (ret *util.BlockStatResult)
func SwapBlockRef ¶
func TagSnapshot ¶
func TryAccessFileByBlockID ¶
func UninstallBazaarIcon ¶
func UninstallBazaarTemplate ¶
func UninstallBazaarTheme ¶
func UninstallBazaarWidget ¶
func UnusedAssets ¶
func UnusedAssets() (ret []string)
func UploadAssets2Cloud ¶
func UploadCloudSnapshot ¶
func UseActivationcode ¶
func WaitForWritingFiles ¶
func WaitForWritingFiles()
func WatchAssets ¶
func WatchAssets()
func WriteCustomCSS ¶
Types ¶
type Announcement ¶
type Announcement struct {
Id string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
}
func GetAnnouncements ¶
func GetAnnouncements() (ret []*Announcement)
type AppConf ¶
type AppConf struct {
LogLevel string `json:"logLevel"` // 日志级别:Off, Trace, Debug, Info, Warn, Error, Fatal
Appearance *conf.Appearance `json:"appearance"` // 外观
Langs []*conf.Lang `json:"langs"` // 界面语言列表
Lang string `json:"lang"` // 选择的界面语言,同 Appearance.Lang
FileTree *conf.FileTree `json:"fileTree"` // 文档面板
Tag *conf.Tag `json:"tag"` // 标签面板
Editor *conf.Editor `json:"editor"` // 编辑器配置
Export *conf.Export `json:"export"` // 导出配置
Graph *conf.Graph `json:"graph"` // 关系图配置
UILayout *conf.UILayout `json:"uiLayout"` // 界面布局
UserData string `json:"userData"` // 社区用户信息,对 User 加密存储
User *conf.User `json:"-"` // 社区用户内存结构,不持久化
Account *conf.Account `json:"account"` // 帐号配置
ReadOnly bool `json:"readonly"` // 是否是以只读模式运行
LocalIPs []string `json:"localIPs"` // 本地 IP 列表
AccessAuthCode string `json:"accessAuthCode"` // 访问授权码
System *conf.System `json:"system"` // 系统配置
Keymap *conf.Keymap `json:"keymap"` // 快捷键配置
Sync *conf.Sync `json:"sync"` // 同步配置
Search *conf.Search `json:"search"` // 搜索配置
Stat *conf.Stat `json:"stat"` // 统计
Api *conf.API `json:"api"` // API
Repo *conf.Repo `json:"repo"` // 数据仓库
Newbie bool `json:"newbie"` // 是否是安装后第一次启动
}
AppConf 维护应用元数据,保存在 ~/.siyuan/conf.json。
var Conf *AppConf
func GetMaskedConf ¶
func (*AppConf) GetClosedBoxes ¶
func (*AppConf) GetOpenedBoxes ¶
type Backlink ¶
type Backlink struct {
DOM string `json:"dom"`
BlockPaths []*BlockPath `json:"blockPaths"`
Expand bool `json:"expand"`
}
func GetBacklinkDoc ¶
func GetBackmentionDoc ¶
type Block ¶
type Block struct {
Box string `json:"box"`
Path string `json:"path"`
HPath string `json:"hPath"`
ID string `json:"id"`
RootID string `json:"rootID"`
ParentID string `json:"parentID"`
Name string `json:"name"`
Alias string `json:"alias"`
Memo string `json:"memo"`
Tag string `json:"tag"`
Content string `json:"content"`
FContent string `json:"fcontent"`
Markdown string `json:"markdown"`
Folded bool `json:"folded"`
Type string `json:"type"`
SubType string `json:"subType"`
RefText string `json:"refText"`
Defs []*Block `json:"-"` // 当前块引用了这些块,避免序列化 JSON 时产生循环引用
Refs []*Block `json:"refs"` // 当前块被这些块引用
DefID string `json:"defID"`
DefPath string `json:"defPath"`
IAL map[string]string `json:"ial"`
Children []*Block `json:"children"`
Depth int `json:"depth"`
Count int `json:"count"`
Sort int `json:"sort"`
Created string `json:"created"`
Updated string `json:"updated"`
}
Block 描述了内容块。
func FullTextSearchBlock ¶
func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, method, orderBy, groupBy int) (ret []*Block, matchedBlockCount, matchedRootCount int)
FullTextSearchBlock 搜索内容块。
method:0:关键字,1:查询语法,2:SQL,3:正则表达式 orderBy: 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时),6:按相关度升序,7:按相关度降序 groupBy:0:不分组,1:按文档分组
func GetFlashcards ¶
func RecentUpdatedBlocks ¶
func RecentUpdatedBlocks() (ret []*Block)
func SearchRefBlock ¶
func SearchTemplate ¶
func SearchWidget ¶
func (*Block) IsContainerBlock ¶
type BlockInfo ¶
type BlockInfo struct {
ID string `json:"id"`
Name string `json:"name"`
RefCount int `json:"refCount"`
SubFileCount int `json:"subFileCount"`
RefIDs []string `json:"refIDs"`
IAL map[string]string `json:"ial"`
Icon string `json:"icon"`
}
func GetDocInfo ¶
type BlockPath ¶
type Bookmark ¶
type Bookmark struct {
Name BookmarkLabel `json:"name"`
Blocks []*Block `json:"blocks"`
Type string `json:"type"` // "bookmark"
Depth int `json:"depth"`
Count int `json:"count"`
}
type BookmarkBlocks ¶
type BookmarkBlocks []*Block
type BookmarkLabel ¶
type BookmarkLabel string
type Bookmarks ¶
type Bookmarks []*Bookmark
func BuildBookmark ¶
func BuildBookmark() (ret *Bookmarks)
type Box ¶
type Box struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Sort int `json:"sort"`
Closed bool `json:"closed"`
// contains filtered or unexported fields
}
Box 笔记本。
func ListNotebooks ¶
func (*Box) UpdateHistoryGenerated ¶
func (box *Box) UpdateHistoryGenerated()
type Criterion ¶
type Criterion struct {
Name string `json:"name"`
Sort int `json:"sort"` // 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时)
Group int `json:"group"` // 0:不分组,1:按文档分组
HasReplace bool `json:"hasReplace"` // 是否有替换
Method int `json:"method"` // 0:文本,1:查询语法,2:SQL,3:正则表达式
HPath string `json:"hPath"`
IDPath []string `json:"idPath"`
K string `json:"k"` // 搜索关键字
R string `json:"r"` // 替换关键字
Types *CriterionTypes `json:"types"` // 类型过滤选项
}
func GetCriteria ¶
func GetCriteria() (ret []*Criterion)
type CriterionTypes ¶
type CriterionTypes struct {
MathBlock bool `json:"mathBlock"`
Table bool `json:"table"`
Blockquote bool `json:"blockquote"`
SuperBlock bool `json:"superBlock"`
Paragraph bool `json:"paragraph"`
Document bool `json:"document"`
Heading bool `json:"heading"`
List bool `json:"list"`
ListItem bool `json:"listItem"`
CodeBlock bool `json:"codeBlock"`
HtmlBlock bool `json:"htmlBlock"`
}
type EmbedBlock ¶
func SearchEmbedBlock ¶
func SearchEmbedBlock(embedBlockID, stmt string, excludeIDs []string, headingMode int, breadcrumb bool) (ret []*EmbedBlock)
type File ¶
type File struct {
Path string `json:"path"`
Name string `json:"name"` // 标题,即 ial["title"]
Icon string `json:"icon"`
Name1 string `json:"name1"` // 命名,即 ial["name"]
Alias string `json:"alias"`
Memo string `json:"memo"`
Bookmark string `json:"bookmark"`
ID string `json:"id"`
Count int `json:"count"`
Size uint64 `json:"size"`
HSize string `json:"hSize"`
Mtime int64 `json:"mtime"`
CTime int64 `json:"ctime"`
HMtime string `json:"hMtime"`
HCtime string `json:"hCtime"`
Sort int `json:"sort"`
SubFileCount int `json:"subFileCount"`
}
type Flashcard ¶
type Flashcard struct {
DeckID string `json:"deckID"`
BlockID string `json:"blockID"`
NextDues map[riff.Rating]string `json:"nextDues"`
}
func GetDueFlashcards ¶
type GraphArrows ¶
type GraphArrows struct {
To *GraphArrowsTo `json:"to"`
}
type GraphArrowsTo ¶
type GraphArrowsTo struct {
Enabled bool `json:"enabled"`
}
type GraphLink ¶
type GraphLink struct {
From string `json:"from"`
To string `json:"to"`
Ref bool `json:"-"`
Color *GraphLinkColor `json:"color"`
Arrows *GraphArrows `json:"arrows"`
}
type GraphLinkColor ¶
type GraphLinkColor struct {
Color string `json:"color"`
}
type GraphNodeColor ¶
type GraphNodeColor struct {
Background string `json:"background"`
}
type History ¶
type History struct {
HCreated string `json:"hCreated"`
Items []*HistoryItem `json:"items"`
}
func GetNotebookHistory ¶
type HistoryItem ¶
func FullTextSearchHistoryItems ¶
func FullTextSearchHistoryItems(created, query, box, op string, typ int) (ret []*HistoryItem)
type LeftRightDiff ¶
type LeftRightDiff struct {
LeftIndex *DiffIndex `json:"leftIndex"`
RightIndex *DiffIndex `json:"rightIndex"`
AddsLeft []*DiffFile `json:"addsLeft"`
UpdatesLeft []*DiffFile `json:"updatesLeft"`
UpdatesRight []*DiffFile `json:"updatesRight"`
RemovesRight []*DiffFile `json:"removesRight"`
}
func DiffRepoSnapshots ¶
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error)
type Path ¶
type Path struct {
ID string `json:"id"` // 块 ID
Box string `json:"box"` // 块 Box
Name string `json:"name"` // 当前路径
HPath string `json:"hPath"` // 人类可读路径
Type string `json:"type"` // "path"
NodeType string `json:"nodeType"` // 节点类型
SubType string `json:"subType"` // 节点子类型
Blocks []*Block `json:"blocks,omitempty"` // 子块节点
Children []*Path `json:"children,omitempty"` // 子路径节点
Depth int `json:"depth"` // 层级深度
Count int `json:"count"` // 子块计数
Updated string `json:"updated"` // 更新时间
Created string `json:"created"` // 创建时间
}
func GetBacklink ¶
func GetBacklink2 ¶
type RecentDoc ¶
type RecentDoc struct {
RootID string `json:"rootID"`
Icon string `json:"icon"`
Title string `json:"title"`
}
func GetRecentDocs ¶
type Sync ¶
type Sync struct {
Size int64 `json:"size"`
HSize string `json:"hSize"`
Updated string `json:"updated"`
CloudName string `json:"cloudName"` // 云端同步数据存放目录名
SaveDir string `json:"saveDir"` // 本地同步数据存放目录路径
}
func ListCloudSyncDir ¶
type Transaction ¶
type Transaction struct {
DoOperations []*Operation `json:"doOperations"`
UndoOperations []*Operation `json:"undoOperations"`
// contains filtered or unexported fields
}
func GetHeadingDeleteTransaction ¶
func GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error)
func GetHeadingLevelTransaction ¶
func GetHeadingLevelTransaction(id string, level int) (transaction *Transaction, err error)
Source Files
¶
- appearance.go
- assets.go
- assets_watcher.go
- backlink.go
- bazzar.go
- block.go
- blockial.go
- blockinfo.go
- bookmark.go
- box.go
- conf.go
- css.go
- export.go
- export_katex.go
- export_merge.go
- file.go
- flashcard.go
- format.go
- graph.go
- heading.go
- history.go
- import.go
- index.go
- liandi.go
- listitem.go
- mount.go
- ocr.go
- outline.go
- path.go
- process.go
- render.go
- repository.go
- search.go
- session.go
- snippet.go
- storage.go
- sync.go
- tag.go
- template.go
- transaction.go
- tree.go
- updater.go
- upload.go
- virutalref.go
- widget.go
Click to show internal directories.
Click to hide internal directories.