diff --git a/.obsidian/plugins/obsidian-calibre-plugin/main.js b/.obsidian/plugins/obsidian-calibre-plugin/main.js new file mode 100644 index 00000000..a5bcbd96 --- /dev/null +++ b/.obsidian/plugins/obsidian-calibre-plugin/main.js @@ -0,0 +1,610 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// node_modules/ip/lib/ip.js +var require_ip = __commonJS({ + "node_modules/ip/lib/ip.js"(exports) { + var ip2 = exports; + var { Buffer: Buffer2 } = require("buffer"); + var os = require("os"); + ip2.toBuffer = function(ip3, buff, offset) { + offset = ~~offset; + var result; + if (this.isV4Format(ip3)) { + result = buff || new Buffer2(offset + 4); + ip3.split(/\./g).map((byte) => { + result[offset++] = parseInt(byte, 10) & 255; + }); + } else if (this.isV6Format(ip3)) { + var sections = ip3.split(":", 8); + var i; + for (i = 0; i < sections.length; i++) { + var isv4 = this.isV4Format(sections[i]); + var v4Buffer; + if (isv4) { + v4Buffer = this.toBuffer(sections[i]); + sections[i] = v4Buffer.slice(0, 2).toString("hex"); + } + if (v4Buffer && ++i < 8) { + sections.splice(i, 0, v4Buffer.slice(2, 4).toString("hex")); + } + } + if (sections[0] === "") { + while (sections.length < 8) + sections.unshift("0"); + } else if (sections[sections.length - 1] === "") { + while (sections.length < 8) + sections.push("0"); + } else if (sections.length < 8) { + for (i = 0; i < sections.length && sections[i] !== ""; i++) + ; + var argv = [i, 1]; + for (i = 9 - sections.length; i > 0; i--) { + argv.push("0"); + } + sections.splice.apply(sections, argv); + } + result = buff || new Buffer2(offset + 16); + for (i = 0; i < sections.length; i++) { + var word = parseInt(sections[i], 16); + result[offset++] = word >> 8 & 255; + result[offset++] = word & 255; + } + } + if (!result) { + throw Error(`Invalid ip address: ${ip3}`); + } + return result; + }; + ip2.toString = function(buff, offset, length) { + offset = ~~offset; + length = length || buff.length - offset; + var result = []; + var i; + if (length === 4) { + for (i = 0; i < length; i++) { + result.push(buff[offset + i]); + } + result = result.join("."); + } else if (length === 16) { + for (i = 0; i < length; i += 2) { + result.push(buff.readUInt16BE(offset + i).toString(16)); + } + result = result.join(":"); + result = result.replace(/(^|:)0(:0)*:0(:|$)/, "$1::$3"); + result = result.replace(/:{3,4}/, "::"); + } + return result; + }; + var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; + var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; + ip2.isV4Format = function(ip3) { + return ipv4Regex.test(ip3); + }; + ip2.isV6Format = function(ip3) { + return ipv6Regex.test(ip3); + }; + function _normalizeFamily(family) { + if (family === 4) { + return "ipv4"; + } + if (family === 6) { + return "ipv6"; + } + return family ? family.toLowerCase() : "ipv4"; + } + ip2.fromPrefixLen = function(prefixlen, family) { + if (prefixlen > 32) { + family = "ipv6"; + } else { + family = _normalizeFamily(family); + } + var len = 4; + if (family === "ipv6") { + len = 16; + } + var buff = new Buffer2(len); + for (var i = 0, n = buff.length; i < n; ++i) { + var bits = 8; + if (prefixlen < 8) { + bits = prefixlen; + } + prefixlen -= bits; + buff[i] = ~(255 >> bits) & 255; + } + return ip2.toString(buff); + }; + ip2.mask = function(addr, mask) { + addr = ip2.toBuffer(addr); + mask = ip2.toBuffer(mask); + var result = new Buffer2(Math.max(addr.length, mask.length)); + var i; + if (addr.length === mask.length) { + for (i = 0; i < addr.length; i++) { + result[i] = addr[i] & mask[i]; + } + } else if (mask.length === 4) { + for (i = 0; i < mask.length; i++) { + result[i] = addr[addr.length - 4 + i] & mask[i]; + } + } else { + for (i = 0; i < result.length - 6; i++) { + result[i] = 0; + } + result[10] = 255; + result[11] = 255; + for (i = 0; i < addr.length; i++) { + result[i + 12] = addr[i] & mask[i + 12]; + } + i += 12; + } + for (; i < result.length; i++) { + result[i] = 0; + } + return ip2.toString(result); + }; + ip2.cidr = function(cidrString) { + var cidrParts = cidrString.split("/"); + var addr = cidrParts[0]; + if (cidrParts.length !== 2) { + throw new Error(`invalid CIDR subnet: ${addr}`); + } + var mask = ip2.fromPrefixLen(parseInt(cidrParts[1], 10)); + return ip2.mask(addr, mask); + }; + ip2.subnet = function(addr, mask) { + var networkAddress = ip2.toLong(ip2.mask(addr, mask)); + var maskBuffer = ip2.toBuffer(mask); + var maskLength = 0; + for (var i = 0; i < maskBuffer.length; i++) { + if (maskBuffer[i] === 255) { + maskLength += 8; + } else { + var octet = maskBuffer[i] & 255; + while (octet) { + octet = octet << 1 & 255; + maskLength++; + } + } + } + var numberOfAddresses = Math.pow(2, 32 - maskLength); + return { + networkAddress: ip2.fromLong(networkAddress), + firstAddress: numberOfAddresses <= 2 ? ip2.fromLong(networkAddress) : ip2.fromLong(networkAddress + 1), + lastAddress: numberOfAddresses <= 2 ? ip2.fromLong(networkAddress + numberOfAddresses - 1) : ip2.fromLong(networkAddress + numberOfAddresses - 2), + broadcastAddress: ip2.fromLong(networkAddress + numberOfAddresses - 1), + subnetMask: mask, + subnetMaskLength: maskLength, + numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, + length: numberOfAddresses, + contains(other) { + return networkAddress === ip2.toLong(ip2.mask(other, mask)); + } + }; + }; + ip2.cidrSubnet = function(cidrString) { + var cidrParts = cidrString.split("/"); + var addr = cidrParts[0]; + if (cidrParts.length !== 2) { + throw new Error(`invalid CIDR subnet: ${addr}`); + } + var mask = ip2.fromPrefixLen(parseInt(cidrParts[1], 10)); + return ip2.subnet(addr, mask); + }; + ip2.not = function(addr) { + var buff = ip2.toBuffer(addr); + for (var i = 0; i < buff.length; i++) { + buff[i] = 255 ^ buff[i]; + } + return ip2.toString(buff); + }; + ip2.or = function(a, b) { + var i; + a = ip2.toBuffer(a); + b = ip2.toBuffer(b); + if (a.length === b.length) { + for (i = 0; i < a.length; ++i) { + a[i] |= b[i]; + } + return ip2.toString(a); + } + var buff = a; + var other = b; + if (b.length > a.length) { + buff = b; + other = a; + } + var offset = buff.length - other.length; + for (i = offset; i < buff.length; ++i) { + buff[i] |= other[i - offset]; + } + return ip2.toString(buff); + }; + ip2.isEqual = function(a, b) { + var i; + a = ip2.toBuffer(a); + b = ip2.toBuffer(b); + if (a.length === b.length) { + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) + return false; + } + return true; + } + if (b.length === 4) { + var t = b; + b = a; + a = t; + } + for (i = 0; i < 10; i++) { + if (b[i] !== 0) + return false; + } + var word = b.readUInt16BE(10); + if (word !== 0 && word !== 65535) + return false; + for (i = 0; i < 4; i++) { + if (a[i] !== b[i + 12]) + return false; + } + return true; + }; + ip2.isPrivate = function(addr) { + return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); + }; + ip2.isPublic = function(addr) { + return !ip2.isPrivate(addr); + }; + ip2.isLoopback = function(addr) { + return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); + }; + ip2.loopback = function(family) { + family = _normalizeFamily(family); + if (family !== "ipv4" && family !== "ipv6") { + throw new Error("family must be ipv4 or ipv6"); + } + return family === "ipv4" ? "127.0.0.1" : "fe80::1"; + }; + ip2.address = function(name, family) { + var interfaces = os.networkInterfaces(); + family = _normalizeFamily(family); + if (name && name !== "private" && name !== "public") { + var res = interfaces[name].filter((details) => { + var itemFamily = _normalizeFamily(details.family); + return itemFamily === family; + }); + if (res.length === 0) { + return void 0; + } + return res[0].address; + } + var all = Object.keys(interfaces).map((nic) => { + var addresses = interfaces[nic].filter((details) => { + details.family = _normalizeFamily(details.family); + if (details.family !== family || ip2.isLoopback(details.address)) { + return false; + } + if (!name) { + return true; + } + return name === "public" ? ip2.isPrivate(details.address) : ip2.isPublic(details.address); + }); + return addresses.length ? addresses[0].address : void 0; + }).filter(Boolean); + return !all.length ? ip2.loopback(family) : all[0]; + }; + ip2.toLong = function(ip3) { + var ipl = 0; + ip3.split(".").forEach((octet) => { + ipl <<= 8; + ipl += parseInt(octet); + }); + return ipl >>> 0; + }; + ip2.fromLong = function(ipl) { + return `${ipl >>> 24}.${ipl >> 16 & 255}.${ipl >> 8 & 255}.${ipl & 255}`; + }; + } +}); + +// src/main.tsx +__export(exports, { + default: () => CalibrePlugin +}); +var import_obsidian3 = __toModule(require("obsidian")); + +// src/CalibreView.tsx +var import_obsidian = __toModule(require("obsidian")); +var ip = __toModule(require_ip()); +var CALIBRE_VIEW_TYPE = "calibre-view"; +var CalibreView = class extends import_obsidian.ItemView { + constructor(leaf, settings) { + super(leaf); + this.settings = settings; + } + getViewType() { + return CALIBRE_VIEW_TYPE; + } + getDisplayText() { + return this.settings.displayText; + } + onOpen() { + return __async(this, null, function* () { + const container = this.containerEl.children[1]; + try { + const iframe = container.createEl("iframe"); + iframe.setAttribute("sandbox", "allow-forms allow-presentation allow-same-origin allow-scripts allow-modals allow-downloads allow-popups"); + iframe.src = this.settings.replaceLocalIp ? this.settings.address.replace("localhost", ip.address()) : this.settings.address; + } catch (e) { + console.error(e); + const error = container.createDiv({ text: e.toString() }); + error.style.color = "var(--text-title-h1)"; + } + }); + } + onClose() { + return __async(this, null, function* () { + }); + } +}; + +// src/settings.tsx +var import_obsidian2 = __toModule(require("obsidian")); + +// src/tools.ts +var CALIBRE_ICON_ID = "calibre"; +var CALIBRE_ICON_SVG = ` + + +`; + +// src/settings.tsx +var DEBOUNCE_TIMEOUT = 1e3; +var DEFAULT_SETTINGS = { + address: "http://localhost:8080", + displayText: "CALIBRE", + splitDirection: "horizontal", + ribbonIcon: CALIBRE_ICON_ID, + hideRibbonIcon: false, + replaceLocalIp: true +}; +var CalibreSettingTab = class extends import_obsidian2.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl("h2", { text: "Calibre Settings" }); + new import_obsidian2.Setting(containerEl).setName("Server Address").setDesc("The address of calibre Content server.").addText((text) => { + text.inputEl.size = 25; + text.setPlaceholder(DEFAULT_SETTINGS.address).setValue(this.plugin.settings.address).onChange((0, import_obsidian2.debounce)((value) => __async(this, null, function* () { + this.plugin.settings.address = value; + this.plugin.saveData(this.plugin.settings); + }), DEBOUNCE_TIMEOUT)); + }); + new import_obsidian2.Setting(containerEl).setName("Use the local IP address instead of 'localhost'").addToggle((toggle) => toggle.setValue(this.plugin.settings.replaceLocalIp).onChange((value) => __async(this, null, function* () { + this.plugin.settings.replaceLocalIp = value; + this.plugin.saveData(this.plugin.settings); + }))); + new import_obsidian2.Setting(containerEl).setName("View Display Text").setDesc("The title of calibre view.").addText((text) => { + text.inputEl.size = 25; + text.setPlaceholder(DEFAULT_SETTINGS.displayText).setValue(this.plugin.settings.displayText).onChange((0, import_obsidian2.debounce)((value) => __async(this, null, function* () { + this.plugin.settings.displayText = value; + this.plugin.saveData(this.plugin.settings); + }), DEBOUNCE_TIMEOUT)); + }); + new import_obsidian2.Setting(containerEl).setName("Split Direction").addDropdown((dropdown) => dropdown.addOption("horizontal", "Horizontal").addOption("vertical", "Vertical").setValue(this.plugin.settings.splitDirection).onChange((value) => __async(this, null, function* () { + this.plugin.settings.splitDirection = value; + this.plugin.saveData(this.plugin.settings); + }))); + new import_obsidian2.Setting(containerEl).setName("Hide Ribbon Icon").addToggle((toggle) => toggle.setValue(this.plugin.settings.hideRibbonIcon).onChange((value) => __async(this, null, function* () { + this.plugin.settings.hideRibbonIcon = value; + this.plugin.saveData(this.plugin.settings); + }))); + new import_obsidian2.Setting(containerEl).setName("Ribbon Icon").setDesc("The icon name to be used.").addText((text) => text.setValue(this.plugin.settings.ribbonIcon).onChange((value) => __async(this, null, function* () { + this.plugin.settings.ribbonIcon = value; + this.plugin.saveData(this.plugin.settings); + }))); + if (import_obsidian2.Platform.isDesktopApp) { + const donation = containerEl.createDiv({ cls: "calibre-donation" }); + donation.createEl("p", { text: "Make a donation to support Calibre plugin development." }); + const link = donation.createEl("a", { href: "https://paypal.me/caronchenhz", cls: "paypal" }); + const img = link.createEl("img"); + img.src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI0cHgiIGhlaWdodD0iMzNweCIgdmlld0JveD0iMCAwIDEyNCAzMyIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTI0IDMzIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiMyNTNCODAiIGQ9Ik00Ni4yMTEsNi43NDloLTYuODM5Yy0wLjQ2OCwwLTAuODY2LDAuMzQtMC45MzksMC44MDJsLTIuNzY2LDE3LjUzN2MtMC4wNTUsMC4zNDYsMC4yMTMsMC42NTgsMC41NjQsMC42NTgNCgloMy4yNjVjMC40NjgsMCwwLjg2Ni0wLjM0LDAuOTM5LTAuODAzbDAuNzQ2LTQuNzNjMC4wNzItMC40NjMsMC40NzEtMC44MDMsMC45MzgtMC44MDNoMi4xNjVjNC41MDUsMCw3LjEwNS0yLjE4LDcuNzg0LTYuNQ0KCWMwLjMwNi0xLjg5LDAuM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jQ5LDAuMzAxLDAuOTMyLDAuNzk1LDAuOTMyaDUuNzkxDQoJbDEuNDU0LTkuMjI1TDkuNjE0LDcuNjk5eiIvPg0KPC9zdmc+DQo="; + img.alt = "PayPal"; + } + } +}; + +// src/main.tsx +var CalibrePlugin = class extends import_obsidian3.Plugin { + onload() { + return __async(this, null, function* () { + try { + yield this.loadSettings(); + this.addSettingTab(new CalibreSettingTab(this.app, this)); + (0, import_obsidian3.addIcon)(CALIBRE_ICON_ID, CALIBRE_ICON_SVG); + this.registerView(CALIBRE_VIEW_TYPE, (leaf) => new CalibreView(leaf, this.settings)); + if (!this.settings.hideRibbonIcon) { + this.addRibbonIcon(this.settings.ribbonIcon, "Calibre", () => __async(this, null, function* () { + this.activateView(); + })); + } + this.addCommand({ + id: "calibre-open-horizontally", + name: "Open horizontally", + callback: () => this.activateView("horizontal") + }); + this.addCommand({ + id: "calibre-open-vertically", + name: "Open vertically", + callback: () => this.activateView("vertical") + }); + } catch (error) { + console.log(`Load error. ${error}`); + } + }); + } + loadSettings() { + return __async(this, null, function* () { + this.settings = Object.assign(DEFAULT_SETTINGS, yield this.loadData()); + }); + } + activateView(direction) { + return __async(this, null, function* () { + const leaf = this.app.workspace.splitActiveLeaf(direction != null ? direction : this.settings.splitDirection); + yield leaf.setViewState({ + type: CALIBRE_VIEW_TYPE, + active: true + }); + this.app.workspace.revealLeaf(leaf); + }); + } + onunload() { + this.app.workspace.detachLeavesOfType(CALIBRE_VIEW_TYPE); + } +}; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-calibre-plugin/manifest.json b/.obsidian/plugins/obsidian-calibre-plugin/manifest.json new file mode 100644 index 00000000..6007118a --- /dev/null +++ b/.obsidian/plugins/obsidian-calibre-plugin/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-calibre-plugin", + "name": "Calibre", + "version": "1.0.8", + "minAppVersion": "0.12.0", + "description": "This plugin allows you to access your calibre libraries and read books directly in Obsidian.", + "author": "caronchen", + "authorUrl": "https://github.com/caronchen/obsidian-calibre-plugin", + "isDesktopOnly": true +} diff --git a/.obsidian/plugins/obsidian-calibre-plugin/styles.css b/.obsidian/plugins/obsidian-calibre-plugin/styles.css new file mode 100644 index 00000000..0043aee5 --- /dev/null +++ b/.obsidian/plugins/obsidian-calibre-plugin/styles.css @@ -0,0 +1,23 @@ +.calibre-donation { + width: fit-content; + margin: 25px auto; + text-align: center; + position: absolute; + left: 200px; + right: 0; + bottom: 0; +} + +.calibre-donation a.paypal { + display: inline-block; +} + +div.workspace-leaf-content[data-type=calibre-view] div.view-content { + overflow: hidden; +} + +div.workspace-leaf-content[data-type=calibre-view] iframe { + width: 100%; + height: 100%; + border: 0; +} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 015d3fc6..f0f86728 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -260,8 +260,8 @@ }, "active": "5faa79a40cb3e05b", "lastOpenFiles": [ - "工作日记/2025-07-02.md", "工作日记/2025-07-03.md", + "工作日记/2025-07-02.md", "工作日记/2025-07-04.md", "未命名看板.md", "待办事宜.md", diff --git a/.obsidian/workspaces.json b/.obsidian/workspaces.json new file mode 100644 index 00000000..5cbb1b76 --- /dev/null +++ b/.obsidian/workspaces.json @@ -0,0 +1,268 @@ +{ + "workspaces": { + "StudyDiary": { + "main": { + "id": "5264d0ea8ac8807f", + "type": "split", + "children": [ + { + "id": "bf98cf6da4108c0f", + "type": "tabs", + "children": [ + { + "id": "0887794f3fbe68a8", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "待办事宜.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "待办事宜" + } + }, + { + "id": "5faa79a40cb3e05b", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "工作日记/2025-07-03.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "2025-07-03" + } + } + ], + "currentTab": 1 + } + ], + "direction": "vertical" + }, + "left": { + "id": "191fe3de41bb119c", + "type": "split", + "children": [ + { + "id": "40fe3c4d6bdf609d", + "type": "tabs", + "children": [ + { + "id": "472183c37fecefe7", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "文件列表" + } + }, + { + "id": "7522de70b2eb7bc3", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "tag:#todo06", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "搜索" + } + }, + { + "id": "79928a14ed0d8b2d", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "书签" + } + } + ] + } + ], + "direction": "horizontal", + "width": 272.5 + }, + "right": { + "id": "343fa5e3edfc32ef", + "type": "split", + "children": [ + { + "id": "6eb65634f662a76d", + "type": "tabs", + "children": [ + { + "id": "255862dc8754e160", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "反向链接" + } + }, + { + "id": "1c71ec70483dbf0f", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "出链" + } + }, + { + "id": "6e8956314744a59d", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "标签" + } + }, + { + "id": "deab112f742d4e72", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "工作日记/2025-07-04.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "2025-07-04 的大纲" + } + }, + { + "id": "d6059cc1a4b1cbf5", + "type": "leaf", + "state": { + "type": "calendar", + "state": {}, + "icon": "calendar-with-checkmark", + "title": "Calendar" + } + }, + { + "id": "c89ec91335fdf5fc", + "type": "leaf", + "state": { + "type": "git-view", + "state": {}, + "icon": "git-pull-request", + "title": "Source Control" + } + }, + { + "id": "c7bf0061bec289e4", + "type": "leaf", + "pinned": true, + "state": { + "type": "dictionary-view", + "state": {}, + "pinned": true, + "icon": "quote-glyph", + "title": "词典" + } + }, + { + "id": "1a13f9ce80085cc2", + "type": "leaf", + "state": { + "type": "planner-timeline", + "state": {}, + "icon": "calendar-with-checkmark", + "title": "Timeline" + } + }, + { + "id": "11b811ce34134e28", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency", + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-archive", + "title": "添加笔记属性" + } + }, + { + "id": "61523dba4992de80", + "type": "leaf", + "state": { + "type": "reminder-list", + "state": {}, + "icon": "clock", + "title": "Reminders" + } + } + ], + "currentTab": 4 + } + ], + "direction": "horizontal", + "width": 524.5 + }, + "left-ribbon": { + "hiddenItems": { + "switcher:打开快速切换": false, + "graph:查看关系图谱": false, + "canvas:新建白板": false, + "daily-notes:打开/创建今天的日记": false, + "templates:插入模板": false, + "command-palette:打开命令面板": false, + "obsidian-git:Open Git source control": false, + "obsidian-excalidraw-plugin:新建绘图文件": false, + "obsidian-day-planner:Open Timeline": false, + "obsidian-day-planner:Open Multi-Day View": false, + "obsidian-kanban:创建新看板": false, + "publish:发布更改": false, + "remotely-save:Remotely Save": false, + "obsidian-wordpress:发布到 WordPress": false, + "workspaces:管理工作区布局": false, + "audio-recorder:开始/结束录音": false, + "templater-obsidian:Templater": false + } + }, + "active": "5faa79a40cb3e05b", + "mtime": "2025-07-04T10:45:22+08:00" + } + }, + "active": "StudyDiary" +} \ No newline at end of file