Versions in this module Expand all Collapse all v0 v0.0.2 Jan 30, 2023 Changes in this version + const HistoryOpClean + const HistoryOpDelete + const HistoryOpFormat + const HistoryOpSync + const HistoryOpUpdate + const HistoryTypeAsset + const HistoryTypeDoc + const HistoryTypeDocName + const MaskedAccessAuthCode + const MaskedUserData + const TxErrCodeBlockNotFound + const TxErrCodeUnableAccessFile + const TxErrCodeWriteTree + var BootSyncSucc = -1 + var CustomEmojis = sync.Map + var Decks = map[string]*riff.Deck + var ErrBlockNotFound = errors.New("block not found") + var ErrBoxNotFound = errors.New("notebook not found") + var ErrFailedToConnectCloudServer = errors.New("failed to connect cloud server") + var ErrTreeNotFound = errors.New("tree not found") + var ExitSyncSucc = -1 + 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 struct + Id string + Title string + URL string + func GetAnnouncements() (ret []*Announcement) + type AppConf struct + AccessAuthCode string + Account *conf.Account + Api *conf.API + Appearance *conf.Appearance + Editor *conf.Editor + Export *conf.Export + FileTree *conf.FileTree + Graph *conf.Graph + Keymap *conf.Keymap + Lang string + Langs []*conf.Lang + LocalIPs []string + LogLevel string + Newbie bool + ReadOnly bool + Repo *conf.Repo + Search *conf.Search + Stat *conf.Stat + Sync *conf.Sync + System *conf.System + Tag *conf.Tag + UILayout *conf.UILayout + User *conf.User + UserData string + var Conf *AppConf + func GetMaskedConf() (ret *AppConf, err error) + 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 struct + BlockPaths []*BlockPath + DOM string + Expand bool + func GetBacklinkDoc(defID, refTreeID, keyword string) (ret []*Backlink) + func GetBackmentionDoc(defID, refTreeID, keyword string) (ret []*Backlink) + type Backup struct + HSize string + SaveDir string + Size int64 + Updated string + type Block struct + Alias string + Box string + Children []*Block + Content string + Count int + Created string + DefID string + DefPath string + Defs []*Block + Depth int + FContent string + Folded bool + HPath string + IAL map[string]string + ID string + Markdown string + Memo string + Name string + ParentID string + Path string + RefText string + Refs []*Block + RootID string + Sort int + SubType string + Tag string + Type string + Updated string + 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) + func (block *Block) IsContainerBlock() bool + type BlockInfo struct + IAL map[string]string + ID string + Icon string + Name string + RefCount int + RefIDs []string + SubFileCount int + func GetDocInfo(rootID string) (ret *BlockInfo) + type BlockPath struct + Children []*BlockPath + ID string + Name string + SubType string + Type string + func BuildBlockBreadcrumb(id string, excludeTypes []string) (ret []*BlockPath, err error) + type Bookmark struct + Blocks []*Block + Count int + Depth int + Name BookmarkLabel + Type string + type BookmarkBlocks []*Block + type BookmarkLabel string + type Bookmarks []*Bookmark + func BuildBookmark() (ret *Bookmarks) + func (s Bookmarks) Len() int + func (s Bookmarks) Less(i, j int) bool + func (s Bookmarks) Swap(i, j int) + type Box struct + Closed bool + ID string + Icon string + Name string + Sort int + func ListNotebooks() (ret []*Box, err error) + 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 struct + Group int + HPath string + HasReplace bool + IDPath []string + K string + Method int + Name string + R string + Sort int + Types *CriterionTypes + func GetCriteria() (ret []*Criterion) + type CriterionTypes struct + Blockquote bool + CodeBlock bool + Document bool + Heading bool + HtmlBlock bool + List bool + ListItem bool + MathBlock bool + Paragraph bool + SuperBlock bool + Table bool + type DiffFile struct + FileID string + Title string + type DiffIndex struct + Created int64 + ID string + type EmbedBlock struct + Block *Block + BlockPaths []*BlockPath + func SearchEmbedBlock(embedBlockID, stmt string, excludeIDs []string, headingMode int, ...) (ret []*EmbedBlock) + type File struct + Alias string + Bookmark string + CTime int64 + Count int + HCtime string + HMtime string + HSize string + ID string + Icon string + Memo string + Mtime int64 + Name string + Name1 string + Path string + Size uint64 + Sort int + SubFileCount int + func ListDocTree(boxID, path string, sortMode int) (ret []*File, totals int, err error) + type FileInfo struct + type Flashcard struct + BlockID string + DeckID string + NextDues map[riff.Rating]string + func GetDueFlashcards(deckID string) (ret []*Flashcard, err error) + type GraphArrows struct + To *GraphArrowsTo + type GraphArrowsTo struct + Enabled bool + type GraphLink struct + Arrows *GraphArrows + Color *GraphLinkColor + From string + Ref bool + To string + type GraphLinkColor struct + Color string + type GraphNode struct + Box string + Color *GraphNodeColor + Defs int + ID string + Label string + Path string + Refs int + Size float64 + Title string + Type string + type GraphNodeColor struct + Background string + type History struct + HCreated string + Items []*HistoryItem + func GetNotebookHistory() (ret []*History, err error) + type HistoryItem struct + Path string + Title string + func FullTextSearchHistoryItems(created, query, box, op string, typ int) (ret []*HistoryItem) + type LeftRightDiff struct + AddsLeft []*DiffFile + LeftIndex *DiffIndex + RemovesRight []*DiffFile + RightIndex *DiffIndex + UpdatesLeft []*DiffFile + UpdatesRight []*DiffFile + func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) + type Operation struct + Action string + Data interface{} + ID string + NextID string + ParentID string + PreviousID string + RetData interface{} + type Path struct + Blocks []*Block + Box string + Children []*Path + Count int + Created string + Depth int + HPath string + ID string + Name string + NodeType string + SubType string + Type string + Updated string + 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 struct + Icon string + RootID string + Title string + func GetRecentDocs() (ret []*RecentDoc, err error) + type Snapshot struct + TypesCount []*TypeCount + func GetRepoSnapshots(page int) (ret []*Snapshot, pageCount, totalCount int, err error) + func GetTagSnapshots() (ret []*Snapshot, err error) + type Sync struct + CloudName string + HSize string + SaveDir string + Size int64 + Updated string + func ListCloudSyncDir() (syncDirs []*Sync, hSize string, err error) + type Tag struct + Children Tags + Count int + Depth int + Label string + Name string + Type string + type TagBlocks []*Block + func (s TagBlocks) Len() int + func (s TagBlocks) Less(i, j int) bool + func (s TagBlocks) Swap(i, j int) + type Tags []*Tag + func BuildTags() (ret *Tags) + type Transaction struct + DoOperations []*Operation + UndoOperations []*Operation + func GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error) + func GetHeadingLevelTransaction(id string, level int) (transaction *Transaction, err error) + type TxErr struct + type TypeCount struct + Count int + Type string