vault backup: 2025-03-07 22:23:38

This commit is contained in:
SeedList
2025-03-07 22:23:38 +08:00
parent 3354593ec6
commit 14f468632b
43 changed files with 1 additions and 44432 deletions

1
.obsidian Symbolic link
View File

@ -0,0 +1 @@
E:/learning materials/My Programming Learning Notes/.obsidian

10
.obsidian/app.json vendored
View File

@ -1,10 +0,0 @@
{
"newFileLocation": "current",
"newLinkFormat": "relative",
"attachmentFolderPath": "./assets",
"strictLineBreaks": true,
"useMarkdownLinks": true,
"showLineNumber": false,
"trashOption": "local",
"alwaysUpdateLinks": true
}

View File

@ -1,6 +0,0 @@
{
"nativeMenus": true,
"cssTheme": "ITS Theme",
"accentColor": "",
"theme": "obsidian"
}

View File

@ -1,10 +0,0 @@
[
"consistent-attachments-and-links",
"nuke-orphans",
"hidden-folder-obsidian",
"update-relative-links",
"better-export-pdf",
"easy-typing-obsidian",
"file-explorer-note-count",
"obsidian-git"
]

View File

@ -1,31 +0,0 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": false,
"outgoing-link": true,
"tag-pane": false,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": false,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false,
"webviewer": false
}

View File

@ -1,4 +0,0 @@
{
"intervalMinutes": 20,
"keepDays": 7
}

37
.obsidian/graph.json vendored
View File

@ -1,37 +0,0 @@
{
"collapse-filter": false,
"search": "path:SanPinPLM ",
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"showOrphans": true,
"collapse-color-groups": false,
"colorGroups": [
{
"query": "path:KMmpm ",
"color": {
"a": 1,
"rgb": 14701138
}
},
{
"query": "path:SanPinPLM ",
"color": {
"a": 1,
"rgb": 14725458
}
}
],
"collapse-display": true,
"showArrow": false,
"textFadeMultiplier": 0,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 0.7514342322277586,
"close": true
}

140
.obsidian/hotkeys.json vendored
View File

@ -1,140 +0,0 @@
{
"update-relative-links:update-all-relative-links": [
{
"modifiers": [
"Alt",
"Mod"
],
"key": "U"
}
],
"better-export-pdf:export-current-file-to-pdf": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "P"
}
],
"nuke-orphans:nuke-orphaned": [
{
"modifiers": [
"Alt",
"Mod"
],
"key": "D"
}
],
"workspace:goto-tab-1": [],
"workspace:goto-tab-2": [],
"workspace:goto-tab-3": [],
"workspace:goto-tab-4": [],
"workspace:goto-tab-5": [],
"workspace:goto-tab-6": [],
"workspace:goto-tab-7": [],
"workspace:goto-tab-8": [],
"workspace:goto-last-tab": [],
"editor:set-heading-1": [
{
"modifiers": [
"Mod"
],
"key": "1"
}
],
"editor:set-heading-2": [
{
"modifiers": [
"Mod"
],
"key": "2"
}
],
"editor:set-heading-3": [
{
"modifiers": [
"Mod"
],
"key": "3"
}
],
"editor:set-heading-4": [
{
"modifiers": [
"Mod"
],
"key": "4"
}
],
"editor:set-heading-5": [
{
"modifiers": [
"Mod"
],
"key": "5"
}
],
"editor:set-heading-6": [
{
"modifiers": [
"Mod"
],
"key": "6"
}
],
"open-with-default-app:open": [
{
"modifiers": [
"Alt",
"Mod"
],
"key": "L"
}
],
"editor:insert-codeblock": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "K"
}
],
"editor:toggle-blockquote": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "Q"
}
],
"editor:toggle-highlight": [
{
"modifiers": [
"Alt",
"Mod"
],
"key": "H"
}
],
"editor:toggle-bullet-list": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "]"
}
],
"editor:toggle-numbered-list": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "["
}
]
}

View File

@ -1,29 +0,0 @@
{
"showTitle": false,
"maxLevel": "6",
"displayHeader": true,
"displayFooter": true,
"headerTemplate": "<div style=\"width: 100vw;font-size:10px;text-align:center;\"><span class=\"title\"></span></div>",
"footerTemplate": "<div style=\"width: 100vw;font-size:10px;text-align:center;\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>",
"printBackground": false,
"generateTaggedPDF": false,
"displayMetadata": false,
"debug": false,
"isTimestamp": false,
"enabledCss": false,
"prevConfig": {
"pageSize": "A4",
"marginType": "1",
"showTitle": true,
"open": false,
"scale": 100,
"landscape": false,
"marginTop": "10",
"marginBottom": "10",
"marginLeft": "10",
"marginRight": "10",
"displayHeader": true,
"displayFooter": true,
"cssSnippet": "0"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
{
"id": "better-export-pdf",
"name": "Better Export PDF",
"version": "1.10.2",
"minAppVersion": "0.15.0",
"description": "Export your notes to PDF, support export preview, add bookmarks outline and header/footer.",
"author": "l1xnan",
"authorUrl": "https://github.com/l1xnan",
"fundingUrl": "https://www.buymeacoffee.com/l1xnan",
"isDesktopOnly": true
}

View File

@ -1,61 +0,0 @@
#better-export-pdf {
display: flex;
flex-direction: row;
height: 75vh;
}
#better-export-pdf .pdf-preview {
flex: auto;
position: relative;
display: flex;
flex-direction: column;
overflow-x: hidden;
overflow-y: scroll;
align-content: flex-start;
}
#better-export-pdf .pdf-preview .webview-wrapper {
position: relative;
height: 100%;
width: 100%;
}
#better-export-pdf .pdf-preview .print-size {
position: absolute;
right: 8px;
top: 8px;
z-index: 99;
font-size: 0.6rem;
white-space: pre-wrap;
text-align: right;
visibility: hidden;
}
#better-export-pdf .pdf-preview > div {
flex: 1;
height: 100%;
width: 100%;
}
#better-export-pdf .pdf-preview .filename {
font-size: 0.75rem;
color: var(--color-base-60);
}
#better-export-pdf .pdf-preview .filename:not(:first-child) {
padding-top: calc(var(--p-spacing));
}
#better-export-pdf webview {
flex: 1;
height: 100%;
width: 100%;
}
#better-export-pdf .setting-wrapper {
width: 320px;
margin-left: 16px;
}
#better-export-pdf .setting-wrapper .setting-item[hidden] {
display: none;
}

View File

@ -1,16 +0,0 @@
{
"autoCollectAttachments": false,
"changeNoteBacklinksAlt": false,
"consistencyReportFile": "consistency-report.md",
"deleteAttachmentsWithNote": true,
"deleteEmptyFolders": true,
"deleteExistFilesWhenMoveNote": true,
"moveAttachmentsWithNote": true,
"showBackupWarning": false,
"updateLinks": true,
"excludePaths": [
".git/",
".obsidian/"
],
"includePaths": []
}

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
{
"id": "consistent-attachments-and-links",
"name": "Consistent Attachments and Links",
"version": "3.24.13",
"minAppVersion": "1.8.7",
"description": "This plugin ensures the consistency of attachments and links",
"author": "Dmitry Savosh",
"authorUrl": "https://github.com/dy-sh/",
"isDesktopOnly": false,
"fundingUrl": "https://www.buymeacoffee.com/mnaoumov"
}

View File

@ -1,63 +0,0 @@
{
"Tabout": true,
"SelectionEnhance": true,
"IntrinsicSymbolPairs": true,
"BaseObEditEnhance": true,
"FW2HWEnhance": true,
"BetterCodeEdit": true,
"BetterBackspace": true,
"AutoFormat": true,
"ExcludeFiles": "",
"ChineseEnglishSpace": false,
"ChineseNumberSpace": false,
"EnglishNumberSpace": false,
"ChineseNoSpace": false,
"QuoteSpace": true,
"PunctuationSpace": false,
"AutoCapital": false,
"AutoCapitalMode": "typing",
"PunctuationSpaceMode": "typing",
"InlineCodeSpaceMode": 1,
"InlineFormulaSpaceMode": 1,
"InlineLinkSpaceMode": 2,
"InlineLinkSmartSpace": false,
"UserDefinedRegSwitch": true,
"UserDefinedRegExp": "{{.*?}}|++\n<.*?>|--\n\\[\\!.*?\\][-+]{0,1}|-+\n(file:///|https?://|ftp://|obsidian://|zotero://|www.)[^\\s《》。,;;:“”‘’\\)\\(\\[\\]\\{\\}']+|--\n\n[a-zA-Z0-9_\\-.]+@[a-zA-Z0-9_\\-.]+|++\n(?<!#)#[\\u4e00-\\u9fa5\\w-\\/]+|++",
"debug": false,
"userSelRepRuleTrigger": [
"-",
"#"
],
"userSelRepRuleValue": [
{
"left": "~~",
"right": "~~"
},
{
"left": "#",
"right": " "
}
],
"userDeleteRulesStrList": [
[
"demo|",
"|"
]
],
"userConvertRulesStrList": [
[
":)|",
"😀|"
]
],
"userSelRuleSettingsOpen": true,
"userDelRuleSettingsOpen": true,
"userCvtRuleSettingsOpen": true,
"StrictModeEnter": true,
"StrictLineMode": "enter_twice",
"EnhanceModA": false,
"TryFixChineseIM": true,
"PuncRectify": false,
"FixMacOSContextMenu": false,
"TryFixMSIME": false
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
{
"id": "easy-typing-obsidian",
"name": "Easy Typing",
"version": "5.5.11",
"minAppVersion": "0.15.0",
"description": "This plugin aims to enhance and optimize the editing experience in Obsidian",
"author": "yaozhuwa",
"authorUrl": "https://github.com/Yaozhuwa",
"isDesktopOnly": false,
"fundingUrl": "https://www.buymeacoffee.com/yaozhuwa"
}

View File

@ -1,17 +0,0 @@
span[class="easy-typing-tabstops"] {
border-radius: 2px;
background-color: #87cefa2e;
outline: #87cefa6e solid 1px;
}
span[class="easy-typing-cursor-widget"] {
color: #1364ce6e;
/* animation: blink 1s step-start 0s infinite; */
display: inline;
position: absolute;
white-space: pre;
}
/* @keyframes blink {
50% { opacity: 0; }
} */

View File

@ -1,8 +0,0 @@
{
"showAllNumbers": true,
"filterList": [
"md"
],
"blacklist": false,
"addRootFolder": false
}

View File

@ -1,970 +0,0 @@
'use strict';
var obsidian = require('obsidian');
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
// 'path' module extracted from Node.js v8.11.1 (only the posix part)
function assertPath(path) {
if (typeof path !== 'string') {
throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
}
}
// Resolves . and .. elements in a path with directory names
function normalizeStringPosix(path, allowAboveRoot) {
var res = '';
var lastSegmentLength = 0;
var lastSlash = -1;
var dots = 0;
var code;
for (var i = 0; i <= path.length; ++i) {
if (i < path.length)
code = path.charCodeAt(i);
else if (code === 47 /*/*/)
break;
else
code = 47 /*/*/;
if (code === 47 /*/*/) {
if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
if (res.length > 2) {
var lastSlashIndex = res.lastIndexOf('/');
if (lastSlashIndex !== res.length - 1) {
if (lastSlashIndex === -1) {
res = '';
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
}
lastSlash = i;
dots = 0;
continue;
}
} else if (res.length === 2 || res.length === 1) {
res = '';
lastSegmentLength = 0;
lastSlash = i;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
if (res.length > 0)
res += '/..';
else
res = '..';
lastSegmentLength = 2;
}
} else {
if (res.length > 0)
res += '/' + path.slice(lastSlash + 1, i);
else
res = path.slice(lastSlash + 1, i);
lastSegmentLength = i - lastSlash - 1;
}
lastSlash = i;
dots = 0;
} else if (code === 46 /*.*/ && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
function _format(sep, pathObject) {
var dir = pathObject.dir || pathObject.root;
var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
if (!dir) {
return base;
}
if (dir === pathObject.root) {
return dir + base;
}
return dir + sep + base;
}
var posix = {
// path.resolve([from ...], to)
resolve: function resolve() {
var resolvedPath = '';
var resolvedAbsolute = false;
var cwd;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path;
if (i >= 0)
path = arguments[i];
else {
if (cwd === undefined)
cwd = process.cwd();
path = cwd;
}
assertPath(path);
// Skip empty entries
if (path.length === 0) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
if (resolvedAbsolute) {
if (resolvedPath.length > 0)
return '/' + resolvedPath;
else
return '/';
} else if (resolvedPath.length > 0) {
return resolvedPath;
} else {
return '.';
}
},
normalize: function normalize(path) {
assertPath(path);
if (path.length === 0) return '.';
var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
// Normalize the path
path = normalizeStringPosix(path, !isAbsolute);
if (path.length === 0 && !isAbsolute) path = '.';
if (path.length > 0 && trailingSeparator) path += '/';
if (isAbsolute) return '/' + path;
return path;
},
isAbsolute: function isAbsolute(path) {
assertPath(path);
return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
},
join: function join() {
if (arguments.length === 0)
return '.';
var joined;
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments[i];
assertPath(arg);
if (arg.length > 0) {
if (joined === undefined)
joined = arg;
else
joined += '/' + arg;
}
}
if (joined === undefined)
return '.';
return posix.normalize(joined);
},
relative: function relative(from, to) {
assertPath(from);
assertPath(to);
if (from === to) return '';
from = posix.resolve(from);
to = posix.resolve(to);
if (from === to) return '';
// Trim any leading backslashes
var fromStart = 1;
for (; fromStart < from.length; ++fromStart) {
if (from.charCodeAt(fromStart) !== 47 /*/*/)
break;
}
var fromEnd = from.length;
var fromLen = fromEnd - fromStart;
// Trim any leading backslashes
var toStart = 1;
for (; toStart < to.length; ++toStart) {
if (to.charCodeAt(toStart) !== 47 /*/*/)
break;
}
var toEnd = to.length;
var toLen = toEnd - toStart;
// Compare paths to find the longest common path from root
var length = fromLen < toLen ? fromLen : toLen;
var lastCommonSep = -1;
var i = 0;
for (; i <= length; ++i) {
if (i === length) {
if (toLen > length) {
if (to.charCodeAt(toStart + i) === 47 /*/*/) {
// We get here if `from` is the exact base path for `to`.
// For example: from='/foo/bar'; to='/foo/bar/baz'
return to.slice(toStart + i + 1);
} else if (i === 0) {
// We get here if `from` is the root
// For example: from='/'; to='/foo'
return to.slice(toStart + i);
}
} else if (fromLen > length) {
if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
// We get here if `to` is the exact base path for `from`.
// For example: from='/foo/bar/baz'; to='/foo/bar'
lastCommonSep = i;
} else if (i === 0) {
// We get here if `to` is the root.
// For example: from='/foo'; to='/'
lastCommonSep = 0;
}
}
break;
}
var fromCode = from.charCodeAt(fromStart + i);
var toCode = to.charCodeAt(toStart + i);
if (fromCode !== toCode)
break;
else if (fromCode === 47 /*/*/)
lastCommonSep = i;
}
var out = '';
// Generate the relative path based on the path difference between `to`
// and `from`
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
if (out.length === 0)
out += '..';
else
out += '/..';
}
}
// Lastly, append the rest of the destination (`to`) path that comes after
// the common path parts
if (out.length > 0)
return out + to.slice(toStart + lastCommonSep);
else {
toStart += lastCommonSep;
if (to.charCodeAt(toStart) === 47 /*/*/)
++toStart;
return to.slice(toStart);
}
},
_makeLong: function _makeLong(path) {
return path;
},
dirname: function dirname(path) {
assertPath(path);
if (path.length === 0) return '.';
var code = path.charCodeAt(0);
var hasRoot = code === 47 /*/*/;
var end = -1;
var matchedSlash = true;
for (var i = path.length - 1; i >= 1; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
if (!matchedSlash) {
end = i;
break;
}
} else {
// We saw the first non-path separator
matchedSlash = false;
}
}
if (end === -1) return hasRoot ? '/' : '.';
if (hasRoot && end === 1) return '//';
return path.slice(0, end);
},
basename: function basename(path, ext) {
if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
assertPath(path);
var start = 0;
var end = -1;
var matchedSlash = true;
var i;
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
if (ext.length === path.length && ext === path) return '';
var extIdx = ext.length - 1;
var firstNonSlashEnd = -1;
for (i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else {
if (firstNonSlashEnd === -1) {
// We saw the first non-path separator, remember this index in case
// we need it if the extension ends up not matching
matchedSlash = false;
firstNonSlashEnd = i + 1;
}
if (extIdx >= 0) {
// Try to match the explicit extension
if (code === ext.charCodeAt(extIdx)) {
if (--extIdx === -1) {
// We matched the extension, so mark this as the end of our path
// component
end = i;
}
} else {
// Extension does not match, so our result is the entire path
// component
extIdx = -1;
end = firstNonSlashEnd;
}
}
}
}
if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
return path.slice(start, end);
} else {
for (i = path.length - 1; i >= 0; --i) {
if (path.charCodeAt(i) === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// path component
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) return '';
return path.slice(start, end);
}
},
extname: function extname(path) {
assertPath(path);
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
for (var i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1)
startDot = i;
else if (preDotState !== 1)
preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (startDot === -1 || end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return '';
}
return path.slice(startDot, end);
},
format: function format(pathObject) {
if (pathObject === null || typeof pathObject !== 'object') {
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
}
return _format('/', pathObject);
},
parse: function parse(path) {
assertPath(path);
var ret = { root: '', dir: '', base: '', ext: '', name: '' };
if (path.length === 0) return ret;
var code = path.charCodeAt(0);
var isAbsolute = code === 47 /*/*/;
var start;
if (isAbsolute) {
ret.root = '/';
start = 1;
} else {
start = 0;
}
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
var i = path.length - 1;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
// Get non-dir info
for (; i >= start; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (startDot === -1 || end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
if (end !== -1) {
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
}
} else {
if (startPart === 0 && isAbsolute) {
ret.name = path.slice(1, startDot);
ret.base = path.slice(1, end);
} else {
ret.name = path.slice(startPart, startDot);
ret.base = path.slice(startPart, end);
}
ret.ext = path.slice(startDot, end);
}
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
return ret;
},
sep: '/',
delimiter: ':',
win32: null,
posix: null
};
posix.posix = posix;
var pathBrowserify = posix;
const withSubfolderClass = 'oz-with-subfolder';
const showAllNumbersClass = 'oz-show-all-num';
const isFolder = (item) => item.file instanceof obsidian.TFolder;
const iterateItems = (items, callback) => {
for (const key in items) {
if (!Object.prototype.hasOwnProperty.call(items, key))
continue;
callback(items[key]);
}
};
const getParentPath = (src) => {
if (src === '/')
return null;
const path = pathBrowserify.dirname(src);
if (path === '.')
return '/';
else
return path;
};
const equals = (arr1, arr2) => {
// if the other array is a falsy value, return
if (!Array.isArray(arr1) || !Array.isArray(arr2))
return false;
// compare lengths - can save a lot of time
if (arr1.length != arr2.length)
return false;
return arr1.every((v, i) => v === arr2[i]);
};
const isParent = (parent, child) => {
if (child === parent)
return false;
if (parent === '/')
parent = '';
if (child === '/')
child = '';
const parentTokens = parent.split('/').filter((i) => i.length);
return parentTokens.every((t, i) => child.split('/')[i] === t);
};
// Helper to play with the File Explorer (if exists)
const doWithFileExplorer = (plugin, callback) => {
let leaves;
let count = 0;
const tryGetView = () => {
leaves = plugin.app.workspace.getLeavesOfType('file-explorer');
if (leaves.length === 0) {
if (count++ > 5)
console.error('failed to get file-explorer');
else {
console.log('file-explorer not found, retrying...');
setTimeout(tryGetView, 500);
}
}
else {
if (leaves.length > 1)
console.warn('more then one file-explorer');
callback(leaves[0].view);
}
};
tryGetView();
};
function around(obj, factories) {
const removers = Object.keys(factories).map(key => around1(obj, key, factories[key]));
return removers.length === 1 ? removers[0] : function () { removers.forEach(r => r()); };
}
function around1(obj, method, createWrapper) {
const original = obj[method], hadOwn = obj.hasOwnProperty(method);
let current = createWrapper(original);
// Let our wrapper inherit static props from the wrapping method,
// and the wrapping method, props from the original method
if (original)
Object.setPrototypeOf(current, original);
Object.setPrototypeOf(wrapper, current);
obj[method] = wrapper;
// Return a callback to allow safe removal
return remove;
function wrapper(...args) {
// If we have been deactivated and are no longer wrapped, remove ourselves
if (current === original && obj[method] === wrapper)
remove();
return current.apply(this, args);
}
function remove() {
// If no other patches, just do a direct removal
if (obj[method] === wrapper) {
if (hadOwn)
obj[method] = original;
else
delete obj[method];
}
if (current === original)
return;
// Else pass future calls through, and remove wrapper from the prototype chain
current = original;
Object.setPrototypeOf(wrapper, original || Function);
}
}
const countFolderChildren = (folder, filter) => {
let count = 0;
for (const af of folder.children) {
if (filter(af))
count++;
if (af instanceof obsidian.TFolder)
count += countFolderChildren(af, filter);
}
return count;
};
/** filter out all path that is the parent of existing path */
const filterParent = (pathList) => {
const list = Array.from(pathList);
list.sort();
for (let i = 0; i < list.length; i++) {
if (i < list.length - 1 && (list[i] === list[i + 1] || isParent(list[i], list[i + 1]))) {
list.shift();
i--;
}
}
return new Set(list);
};
/** get all parents and add to set if not exist */
const getAllParents = (path, set) => {
let parent = getParentPath(path);
while (parent && !set.has(parent)) {
set.add(parent);
parent = getParentPath(parent);
}
};
/**
* Update folder count of target's parent
*/
const updateCount = (targetList, plugin) => {
const set = filterParent(targetList);
for (const path of targetList) {
getAllParents(path, set);
}
// set count of path
const { fileExplorer, fileFilter } = plugin;
if (!fileExplorer) {
console.error('fileExplorer missing');
return;
}
for (const path of set) {
// check if path available
if (!fileExplorer.fileItems[path])
continue;
setCount(fileExplorer.fileItems[path], fileFilter);
}
// Update root separately
if (plugin.rootFolderEl && plugin.settings.addRootFolder) {
setupRootCount(plugin);
}
// empty waitingList
targetList.length = 0;
};
const setupRootCount = (plugin) => {
if (plugin.rootFolderEl) {
let rootFolderElChildren = plugin.rootFolderEl.children;
if (rootFolderElChildren && rootFolderElChildren.length > 0) {
let totalCount = countFolderChildren(plugin.app.vault.getAbstractFileByPath('/'), plugin.fileFilter);
rootFolderElChildren[0].setAttr('data-count', totalCount.toString());
}
}
};
const setupCount = (plugin, revert = false) => {
if (!plugin.fileExplorer)
throw new Error('fileExplorer not found');
// For each setup, first setup the root folder
plugin.setupRootFolder();
setupRootCount(plugin);
// Iterate other items and include new counts
iterateItems(plugin.fileExplorer.fileItems, (item) => {
if (!isFolder(item))
return;
if (revert)
removeCount(item);
else
setCount(item, plugin.fileFilter);
});
};
const setCount = (item, filter) => {
// if (item.file.isRoot()) return;
const count = countFolderChildren(item.file, filter);
item.selfEl.dataset['count'] = count.toString();
item.selfEl.toggleClass(withSubfolderClass, Array.isArray(item.file.children) && item.file.children.some((af) => af instanceof obsidian.TFolder));
};
const removeCount = (item) => {
if (item.selfEl.dataset['count'])
delete item.selfEl.dataset['count'];
item.selfEl.removeClass(withSubfolderClass);
};
class VaultHandler {
get app() {
return this.plugin.app;
}
get vault() {
return this.plugin.app.vault;
}
constructor(plugin) {
this.waitingList = [];
this.update = obsidian.debounce(() => updateCount(this.waitingList, this.plugin), 500, true);
this.handler = (...args) => {
var _a;
for (const arg of args) {
const path = arg instanceof obsidian.TAbstractFile ? arg.path : arg;
this.waitingList.push((_a = getParentPath(path)) !== null && _a !== void 0 ? _a : '/');
}
this.update();
};
this.registerVaultEvent = () => {
this.plugin.registerEvent(this.vault.on('create', this.handler));
this.plugin.registerEvent(this.vault.on('rename', this.handler));
this.plugin.registerEvent(this.vault.on('delete', this.handler));
};
this.plugin = plugin;
}
}
const DEFAULT_SETTINGS = {
showAllNumbers: false,
filterList: ['md'],
blacklist: false,
addRootFolder: false,
};
class FENoteCountSettingTab extends obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
get showOnlyNoteValue() {
const { settings } = this.plugin;
return settings.blacklist === DEFAULT_SETTINGS.blacklist && equals(settings.filterList, DEFAULT_SETTINGS.filterList);
}
set showOnlyNoteValue(value) {
const { blacklist, filterList } = DEFAULT_SETTINGS;
this.plugin.settings.blacklist = blacklist;
if (value) {
// do deep copy
this.plugin.settings.filterList = Array.from(filterList);
}
else {
this.plugin.settings.filterList.length = 0;
}
}
display() {
let { containerEl } = this;
containerEl.empty();
containerEl.createEl('h2', {
text: 'File Explorer Note Count Settings',
});
new obsidian.Setting(containerEl)
.setName('Show All Numbers')
.setDesc('Turn on this option if you want to see the number of notes even after you expand the collapsed folders')
.addToggle((toggle) => toggle.setValue(this.plugin.settings.showAllNumbers).onChange((value) => {
document.body.toggleClass('oz-show-all-num', value);
this.plugin.settings.showAllNumbers = value;
this.plugin.saveSettings();
}));
new obsidian.Setting(containerEl)
.setName('Add Root Folder')
.setDesc('By default, there is no root folder provided by Obsidian. It is moved to drop-down menu to switch between vaults. ' +
'Enable this option if you want to see root folder and its count in the file explorer')
.addToggle((toggle) => toggle.setValue(this.plugin.settings.addRootFolder).onChange((value) => {
this.plugin.settings.addRootFolder = value;
this.plugin.saveSettings();
this.plugin.reloadCount();
}));
this.filterOpt();
}
filterOpt() {
new obsidian.Setting(this.containerEl)
.setName('Show Only Markdown Notes')
.setDesc('Turn off this option to choose file that should be counted')
.addToggle((toggle) => toggle.setValue(this.showOnlyNoteValue).onChange((value) => {
this.showOnlyNoteValue = value;
this.plugin.reloadCount();
this.plugin.saveSettings();
this.display();
}));
if (!this.showOnlyNoteValue) {
new obsidian.Setting(this.containerEl)
.setName('Filter List')
.setDesc(createFragment((descEl) => {
descEl.appendText('Extension list to include/exclude file during counting');
descEl.appendChild(document.createElement('br'));
descEl.appendText('Separated by comma');
}))
.addTextArea((text) => {
const onChange = (value) => __awaiter(this, void 0, void 0, function* () {
const list = value.split(',').map((v) => v.trim());
this.plugin.settings.filterList = list;
this.plugin.reloadCount();
yield this.plugin.saveSettings();
});
text.setPlaceholder('Leave it empty to count all types of files');
text.setValue(this.plugin.settings.filterList.join(', ')).onChange(obsidian.debounce(onChange, 500, true));
text.inputEl.rows = 2;
text.inputEl.cols = 25;
});
new obsidian.Setting(this.containerEl)
.setName('Enable Blacklist')
.setDesc('Turn on this option to use Filter List to exclude files')
.addToggle((toggle) => toggle.setValue(this.plugin.settings.blacklist).onChange((value) => {
this.plugin.settings.blacklist = value;
this.plugin.reloadCount();
this.plugin.saveSettings();
}));
}
}
}
class FileExplorerNoteCount extends obsidian.Plugin {
constructor() {
super(...arguments);
this.settings = DEFAULT_SETTINGS;
this.vaultHandler = new VaultHandler(this);
this.rootFolderEl = null;
this.explorerNavHeaderSelector = '.workspace-leaf-content[data-type="file-explorer"] .nav-header';
this.rootFolderClassName = 'oz-explorer-root-folder';
this.initialize = (revert = false) => {
let plugin = this;
// First Check if the root folder exists
let explorerHeaderEl = document.querySelector(`${this.explorerNavHeaderSelector} .${this.rootFolderClassName}`);
if (explorerHeaderEl)
this.rootFolderEl = explorerHeaderEl;
const getViewHandler = (revert) => (view) => {
this.fileExplorer = view;
setupCount(this, revert);
this.setupRootFolder(revert);
if (!revert) {
this.registerEvent(this.app.workspace.on('css-change', this.setupRootFolder));
this.vaultHandler.registerVaultEvent();
if (this.settings.showAllNumbers)
document.body.addClass('oz-show-all-num');
}
else {
for (const el of document.getElementsByClassName(withSubfolderClass)) {
el.removeClass(withSubfolderClass);
}
document.body.removeClass(showAllNumbersClass);
}
if (!revert) {
// when file explorer is closed (workspace changed)
// try to update fehanlder with new file explorer instance
this.register(around(view, {
onClose: (next) => function () {
setTimeout(() => doWithFileExplorer(plugin, getViewHandler(false)), 1e3);
return next.apply(this);
},
}));
}
};
doWithFileExplorer(plugin, getViewHandler(revert));
};
this.setupRootFolder = (revert = false) => {
var _a, _b, _c;
if (!this.fileExplorer) {
console.error('file-explorer not found');
return;
}
if (this.rootFolderEl && !this.settings.addRootFolder) {
this.rootFolderEl.remove();
this.rootFolderEl = null;
}
// Check if root is provided by Obsidian (it shouldn't be in the new releases)
const root = (_c = (_b = (_a = this.fileExplorer) === null || _a === void 0 ? void 0 : _a.fileItems) === null || _b === void 0 ? void 0 : _b['/']) !== null && _c !== void 0 ? _c : null;
if (!root) {
// Get the Nav Header
let explorerHeaderEl = document.querySelector(this.explorerNavHeaderSelector);
if (!explorerHeaderEl)
return;
if (!this.rootFolderEl && this.settings.addRootFolder) {
this.rootFolderEl = explorerHeaderEl.createEl('div', {
cls: ['tree-item', 'nav-folder', this.rootFolderClassName],
});
this.rootFolderEl.innerHTML = `
<div class="oz-explorer-root-nav-folder-title" data-path="/">
<div class="tree-item-inner nav-folder-title-content">${this.app.vault.getName()}</div>
</div>
`;
}
}
};
}
onload() {
return __awaiter(this, void 0, void 0, function* () {
console.log('loading FileExplorerNoteCount');
this.addSettingTab(new FENoteCountSettingTab(this.app, this));
yield this.loadSettings();
this.app.workspace.onLayoutReady(this.initialize);
});
}
onunload() {
console.log('unloading FileExplorerNoteCount');
this.initialize(true);
}
loadSettings() {
return __awaiter(this, void 0, void 0, function* () {
this.settings = Object.assign(Object.assign({}, this.settings), (yield this.loadData()));
});
}
saveSettings() {
return __awaiter(this, void 0, void 0, function* () {
yield this.saveData(this.settings);
});
}
reloadCount() {
setupCount(this);
}
get fileFilter() {
let list = this.settings.filterList;
return (af) => {
if (af instanceof obsidian.TFile) {
const { extension: target } = af;
// if list is empty, filter nothing
if (list.length === 0)
return true;
else if (this.settings.blacklist)
return !list.includes(target);
else
return list.includes(target);
}
else
return false;
};
}
}
module.exports = FileExplorerNoteCount;
/* nosourcemap */

View File

@ -1,10 +0,0 @@
{
"id": "file-explorer-note-count",
"name": "File Explorer Note Count",
"version": "1.2.3",
"minAppVersion": "1.2.0",
"description": "The plugin helps you to see the number of notes under each folder within the file explorer.",
"author": "Ozan Tellioglu",
"authorUrl": "https://www.ozan.pl",
"isDesktopOnly": false
}

View File

@ -1,34 +0,0 @@
.nav-folder-title[data-count]::after {
content: attr(data-count);
display: inline-block;
position: relative;
font-size: calc(100% * 0.8);
margin-right: 4px;
/* border-radius: 3px; */
padding: 2px 0;
/* background-color: var(--background-secondary-alt); */
transition: opacity 100ms ease-in-out;
}
.oz-explorer-root-nav-folder-title {
display: flex;
}
.oz-explorer-root-nav-folder-title[data-count]::after {
content: attr(data-count);
margin-right: 4px;
font-size: calc(100% * 0.8);
display: inline-block;
}
body:not(.oz-show-all-num) .nav-folder:not(.is-collapsed) > .nav-folder-title.oz-with-subfolder[data-count]:not([data-path='/'])::after {
opacity: 0;
}
.nav-folder-title-content {
flex-grow: 1;
}
.oz-explorer-root-folder {
margin-top: 15px;
}

View File

@ -1,4 +0,0 @@
{
"folders": "assets",
"enable": true
}

View File

@ -1,248 +0,0 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// main.ts
var main_exports = {};
__export(main_exports, {
default: () => main_default
});
module.exports = __toCommonJS(main_exports);
// src/plugin.ts
var import_obsidian2 = require("obsidian");
// src/lang/en.ts
var en_default = {};
// src/lang/zh.ts
var zh_default = {
"Not Found Files List": "\u627E\u4E0D\u5230\u6587\u4EF6\u5217\u8868",
"Hidden Folder": "\u6587\u4EF6\u9690\u85CF",
"Restore display": "\u6062\u590D\u663E\u793A",
"folders": "\u6587\u4EF6\u5939",
"Folders": "\u6587\u4EF6\u5939",
"folder": "\u6587\u4EF6\u5939",
"Hidden display": "\u9690\u85CF\u663E\u793A",
"Show Folders": "\u663E\u793A\u6587\u4EF6\u5939",
"Hidden Folders": "\u9690\u85CF\u6587\u4EF6\u5939",
"Rules": "\u89C4\u5219",
"Regular expression": "\u6B63\u5219\u8868\u8FBE\u5F0F",
"Example": "\u4F8B\u5B50",
"Enable": "\u5F00\u542F",
"Enable to hidden folder": "\u662F\u5426\u5F00\u542F\u9690\u85CF",
"Saving": "\u4FDD\u5B58\u4E2D",
"Settings is saved": "\u914D\u7F6E\u5DF2\u4FDD\u5B58",
"Save": "\u4FDD\u5B58"
};
// src/lang/index.ts
var lang = {
en: en_default,
zh: zh_default,
get
};
function get(text, args) {
var _a;
const language = ((_a = window.i18next) == null ? void 0 : _a.language) || "en";
const map = lang[language] || en_default;
let result = map[text] || en_default[text] || text;
if (args) {
for (let i in args) {
result = result.replace(new RegExp(`\\{\\{${i}\\}\\}`, "g"), args[i]);
}
}
return result;
}
lang.get = get;
var lang_default = lang;
// src/setting.ts
var import_obsidian = require("obsidian");
var HiddenFolderSettingTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: lang_default.get("Hidden Folder") });
const settings = {
folders: this.plugin.settings.folders,
enable: this.plugin.settings.enable
};
new import_obsidian.Setting(containerEl).setName(lang_default.get("Rules")).setDesc(lang_default.get("Regular expression")).addTextArea((text) => {
text.inputEl.style.minWidth = "350px";
text.inputEl.style.minHeight = "150px";
text.setPlaceholder(lang_default.get("Example") + ":\n.*\\/?attachments\n^abc$\nuse multi lines for multi folders").setValue(this.plugin.settings.folders).onChange(async (value) => {
settings.folders = value;
});
return text;
});
new import_obsidian.Setting(containerEl).setName(lang_default.get("Enable")).setDesc(lang_default.get("Enable to hidden folder")).addToggle((toggle) => toggle.setValue(this.plugin.settings.enable).onChange((enable) => {
settings.enable = enable;
}));
new import_obsidian.Setting(containerEl).addButton((button) => button.setButtonText(lang_default.get("Save")).onClick(async () => {
new import_obsidian.Notice(lang_default.get("Hidden Folder") + " - " + lang_default.get("Saving"));
this.plugin.settings.folders = settings.folders;
this.plugin.settings.enable = settings.enable;
await this.plugin.saveSettings();
this.plugin.restoreFolder();
if (this.plugin.settings.enable) {
this.plugin.hiddenFolder();
}
new import_obsidian.Notice(lang_default.get("Hidden Folder") + " - " + lang_default.get("Settings is saved"));
}));
}
};
// src/plugin.ts
var DEFAULT_SETTINGS = {
folders: "",
enable: false
};
var HiddenFolder = class extends import_obsidian2.Plugin {
getFilters() {
if (!this.settings.folders)
return null;
const result = [];
const folders = this.settings.folders.split("\n");
if (folders.length) {
for (let i of folders) {
result.push(new RegExp(i));
}
}
return result;
}
getFolderElements() {
const folders = document.querySelectorAll(".nav-folder");
const result = [];
for (let i = 0; i < folders.length; i++) {
const el = folders[i];
if (el.classList.contains("mod-root"))
continue;
result.push(el);
}
return result;
}
restoreFolder() {
const folders = document.querySelectorAll(".hidden-folder-flag-hidden");
if (folders == null ? void 0 : folders.length) {
new import_obsidian2.Notice(lang_default.get("Restore display") + "\r\n" + folders.length + " " + lang_default.get(folders.length > 1 ? "folders" : "folder"));
for (let i = 0; i < folders.length; i++) {
const el = folders[i];
el.classList.remove("hidden-folder-flag-hidden");
}
}
}
hiddenFolder() {
if (!this.settings.enable)
return;
const filters = this.getFilters();
if (!(filters == null ? void 0 : filters.length))
return;
const elements = this.getFolderElements();
let count = 0;
for (let el of elements) {
const title = el.querySelector(".nav-folder-title");
const path = title == null ? void 0 : title.getAttribute("data-path");
if (!path)
continue;
if (el.classList.contains("hidden-folder-flag-hidden"))
continue;
for (let filter of filters) {
if (filter.test(path)) {
el.classList.add("hidden-folder-flag-hidden");
count++;
}
}
}
if (count) {
new import_obsidian2.Notice(lang_default.get("Hidden display") + "\r\n" + count + " " + lang_default.get(count > 1 ? "folders" : "folder"));
}
}
async onload() {
await this.loadSettings();
this.start(0);
}
observe() {
if (!this.container)
return;
this.observer = new MutationObserver(() => {
this.hiddenFolder();
});
this.observer.observe(this.container, { attributes: true, childList: true, subtree: true });
}
start(loop) {
if (loop > 20) {
new import_obsidian2.Notice(lang_default.get("Not Found Files List"));
return;
}
this.container = document.querySelector(".nav-files-container");
if (!this.container) {
setTimeout(() => {
this.start(loop + 1);
}, 100);
return;
}
this.observe();
this.app.workspace.on("layout-change", () => {
const container = document.querySelector(".nav-files-container");
if (container !== this.container) {
this.container = container;
this.observe();
}
});
this.addSettingTab(new HiddenFolderSettingTab(this.app, this));
this.hiddenFolder();
setTimeout(() => {
const el = this.addRibbonIcon("ghost", lang_default.get(this.settings.enable ? "Show Folders" : "Hidden Folders"), (evt) => {
this.settings.enable = !this.settings.enable;
this.saveSettings();
el.setAttribute("aria-label", lang_default.get(this.settings.enable ? "Show Folders" : "Hidden Folders"));
if (this.settings.enable) {
this.hiddenFolder();
} else {
this.restoreFolder();
}
});
}, 10);
}
onunload() {
if (!this.observer)
return;
this.restoreFolder();
this.observer.disconnect();
}
async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
}
async saveSettings() {
await this.saveData(this.settings);
}
};
// main.ts
var main_default = HiddenFolder;
/* nosourcemap */

View File

@ -1,9 +0,0 @@
{
"id": "hidden-folder-obsidian",
"name": "Hidden Folder",
"version": "1.0.7",
"minAppVersion": "0.15.0",
"description": "Hidden Folder",
"author": "ptrsvltns",
"isDesktopOnly": true
}

View File

@ -1,3 +0,0 @@
.hidden-folder-flag-hidden {
display: none;
}

View File

@ -1,11 +0,0 @@
{
"attachmentsPaths": [
"./assets"
],
"trashFolderOverride": "",
"ignorePatterns": [
"./Files",
".md"
],
"alternativeAttachmentAlg": false
}

View File

@ -1,314 +0,0 @@
/*
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 __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());
});
};
// src/main.ts
__export(exports, {
default: () => NukeOrphansPlugin
});
var import_obsidian3 = __toModule(require("obsidian"));
// src/settings.ts
var import_obsidian = __toModule(require("obsidian"));
var DEFAULT_SETTINGS = {
attachmentsPaths: [],
trashFolderOverride: "",
ignorePatterns: [],
alternativeAttachmentAlg: false
};
var CSS_CLASS_CHECK_PASS = "nuke-orphans-pass";
var CSS_CLASS_CHECK_FAIL = "nuke-orphans-fail";
var NukeOrphansSettingsTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h3", {
attr: {
"style": "text-align: center;"
},
text: "Nuke Orphans Plugin Settings"
});
new import_obsidian.Setting(containerEl).setName("Override Attachment Folder").setDesc("Where attachments are stored").addTextArea((text) => text.setPlaceholder(this.app.vault.config.attachmentFolderPath).setValue(this.plugin.settings.attachmentsPaths.join("\n")).onChange((value) => __async(this, null, function* () {
this.plugin.settings.attachmentsPaths = value.split("\n").map((x) => x.trim()).filter((x) => x.length > 0);
yield this.plugin.saveSettings();
})));
new import_obsidian.Setting(containerEl).setName("Override Trash Folder").setDesc("Trash folder path, will be created if it does not exist").addText((text) => text.setPlaceholder(this.plugin.shouldUseSystemTrash() ? "system trash" : ".trash/").setValue(this.plugin.settings.trashFolderOverride).onChange((value) => __async(this, null, function* () {
this.plugin.settings.trashFolderOverride = value;
yield this.plugin.saveSettings();
})));
new import_obsidian.Setting(containerEl).setName("Ignore Patterns").setDesc("Add regex patterns to ignore when searching for orphans").addTextArea((text) => text.setValue(this.plugin.settings.ignorePatterns.join("\n")).onChange((value) => __async(this, null, function* () {
this.plugin.settings.ignorePatterns = value.split("\n").map((x) => x.trim()).filter((x) => x.length > 0);
yield this.plugin.saveSettings();
})));
new import_obsidian.Setting(containerEl).setName("Test Settings").setDesc("If the path is ignored it will be red, otherwise green").addText((text) => {
function resetColor() {
text.inputEl.classList.remove(CSS_CLASS_CHECK_PASS, CSS_CLASS_CHECK_FAIL);
}
text.onChange((value) => {
resetColor();
if (value.length == 0)
return;
if (this.plugin.getIgnoreFilter().test(value))
text.inputEl.classList.add(CSS_CLASS_CHECK_FAIL);
else
text.inputEl.classList.add(CSS_CLASS_CHECK_PASS);
});
text.inputEl.addEventListener("focusout", () => resetColor());
text.inputEl.addEventListener("focusin", () => text.onChanged());
});
containerEl.createEl("h3", {
attr: {
style: "font-weight: bold"
},
text: "Advanced Settings"
});
new import_obsidian.Setting(containerEl).setName("Alternative Attachments Finding Algorithm").setDesc("Try enabling this if attachments are not found in subfolders").addToggle((btn) => btn.setValue(this.plugin.settings.alternativeAttachmentAlg).onChange((value) => __async(this, null, function* () {
this.plugin.settings.alternativeAttachmentAlg = value;
yield this.plugin.saveSettings();
})));
}
};
// src/trash_modal.ts
var import_obsidian2 = __toModule(require("obsidian"));
var path = __toModule(require("path"));
var TrashFilesModal = class extends import_obsidian2.Modal {
constructor(app, files, trashFolderPath, useSystemTrash) {
super(app);
this.files = files;
this.trashFolderPath = trashFolderPath;
this.useSystemTrash = useSystemTrash;
}
onOpen() {
let { contentEl, titleEl } = this;
titleEl.setText("Move " + this.files.length + " files to trash?");
const div = contentEl.createDiv({
cls: "trash-modal-file-links"
});
this.files.forEach((file) => {
div.createEl("p", {
cls: "trash-modal-link",
text: file.path
}).addEventListener("click", () => __async(this, null, function* () {
this.close();
yield this.app.workspace.activeLeaf.openFile(file);
}));
});
contentEl.createEl("button", {
cls: ["trash-modal-button"],
text: "Cancel"
}).addEventListener("click", () => this.close());
contentEl.createEl("button", {
cls: ["trash-modal-button"],
text: "Copy list to clipboard"
}).addEventListener("click", () => __async(this, null, function* () {
yield navigator.clipboard.writeText(this.files.map((file) => file.path).join("\n"));
new import_obsidian2.Notice("Copied list to clipboard");
}));
contentEl.createEl("button", {
cls: ["mod-cta", "trash-modal-button"],
text: "Trash"
}).addEventListener("click", () => __async(this, null, function* () {
if (this.trashFolderPath.length > 0) {
if (!(yield this.app.vault.adapter.exists(this.trashFolderPath)))
yield this.app.vault.createFolder(this.trashFolderPath);
this.files.forEach((file) => __async(this, null, function* () {
return yield this.app.fileManager.renameFile(file, path.join(this.trashFolderPath, file.name));
}));
} else
this.files.forEach((file) => __async(this, null, function* () {
return yield this.app.vault.trash(file, this.useSystemTrash);
}));
new import_obsidian2.Notice("Trashed " + this.files.length + " files");
this.close();
}));
}
onClose() {
let { contentEl } = this;
contentEl.empty();
}
};
// src/main.ts
var CustomFilter = class {
constructor(regexes, strings) {
this.regexes = new Set(regexes.map((x) => RegExp(x)));
this.strings = new Set(strings);
}
test(input) {
return Array.from(this.regexes).some((x) => x.test(input)) || Array.from(this.strings).some((x) => x === input);
}
};
var NukeOrphansPlugin = class extends import_obsidian3.Plugin {
getIgnoreFilter() {
let strings = [];
if (this.settings.trashFolderOverride.length > 0)
strings.push(this.settings.trashFolderOverride);
return new CustomFilter(this.settings.ignorePatterns, strings);
}
shouldUseSystemTrash() {
switch (this.app.vault.config.trashOption) {
case "system":
return true;
default:
return false;
}
}
getAttachmentsPaths() {
if (this.settings.attachmentsPaths.length === 0)
return [this.app.vault.config.attachmentFolderPath];
return this.settings.attachmentsPaths;
}
isAttachment(file) {
return this.getAttachmentsPaths().some((element) => {
console.log(file.path);
if (element.startsWith("./")) {
if (this.settings.alternativeAttachmentAlg) {
let path2 = file.parent;
while (path2.name !== void 0 && path2.name.length > 0) {
if (path2.name == element.substring(2))
return true;
path2 = path2.parent;
}
} else {
return file.path.startsWith(element.substring(2)) || file.path.contains(element.substring(1) + "/");
}
} else {
if (file.parent.path == element)
return true;
if (file.path.startsWith(element))
return true;
}
return false;
});
}
getCanvasLinks() {
return __async(this, null, function* () {
let links = new Set();
yield Promise.all(this.app.vault.getFiles().filter((f) => f.extension === "canvas").map((f) => __async(this, null, function* () {
const content = yield this.app.vault.read(f);
try {
const canvas = JSON.parse(content);
canvas.nodes.filter((node) => node.type === "file").forEach((node) => links.add(node.file));
} catch (e) {
console.error("Error parsing canvas file " + f.path + "\n", e);
}
return Promise.resolve();
})));
return links;
});
}
getOrphans() {
return __async(this, null, function* () {
const links = new Set(Object.values(this.app.metadataCache.resolvedLinks).flatMap((x) => Object.keys(x)));
const canvasLinks = yield this.getCanvasLinks();
const filter = this.getIgnoreFilter();
return this.app.vault.getFiles().filter((file) => {
return ![
links.has(file.path),
canvasLinks.has(file.path),
filter.test(file.path)
].some((x) => x === true);
});
});
}
trash(files) {
if (files.length > 0)
new TrashFilesModal(this.app, files, this.settings.trashFolderOverride, this.shouldUseSystemTrash()).open();
else
new import_obsidian3.Notice("No orphaned files have been found");
}
onload() {
return __async(this, null, function* () {
yield this.loadSettings();
this.addCommand({
id: "nuke-orphaned-attachments",
name: "Trash orphaned attachments",
callback: () => __async(this, null, function* () {
new import_obsidian3.Notice("Gathering orphaned attachments..");
this.trash((yield this.getOrphans()).filter((file) => this.isAttachment(file)));
})
});
this.addCommand({
id: "nuke-orphaned-notes",
name: "Trash orphaned notes",
callback: () => __async(this, null, function* () {
new import_obsidian3.Notice("Gathering orphaned notes..");
this.trash((yield this.getOrphans()).filter((file) => file.extension === "md"));
})
});
this.addCommand({
id: "nuke-orphaned",
name: "Trash orphaned files",
callback: () => __async(this, null, function* () {
new import_obsidian3.Notice("Gathering orphaned files..");
this.trash(yield this.getOrphans());
})
});
this.addSettingTab(new NukeOrphansSettingsTab(this.app, this));
});
}
onunload() {
}
loadSettings() {
return __async(this, null, function* () {
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
});
}
saveSettings() {
return __async(this, null, function* () {
yield this.saveData(this.settings);
});
}
};
/* nosourcemap */

View File

@ -1,10 +0,0 @@
{
"id": "nuke-orphans",
"name": "Nuke Orphans",
"version": "1.2.5",
"minAppVersion": "1.3.0",
"description": "Plugin that trashes orphaned files and attachments",
"author": "Sandorex",
"authorUrl": "https://github.com/sandorex",
"isDesktopOnly": false
}

View File

@ -1,33 +0,0 @@
.trash-modal-button {
margin-left: 5px;
margin-right: 5px;
}
/* this is the confirm button so it should be separated */
.trash-modal-button:last-of-type {
float: right;
}
.trash-modal-file-links {
overflow-y: scroll;
max-height: 30vw;
margin: 1vw;
}
.trash-modal-link {
color: var(--text-accent);
text-decoration: underline;
cursor: pointer;
}
.trash-modal-link:hover {
color: var(--text-accent-hover, var(--text-accent));
}
.nuke-orphans-pass {
color: lightgreen !important;
}
.nuke-orphans-fail {
color: red !important;
}

View File

@ -1,59 +0,0 @@
{
"commitMessage": "vault backup: {{date}}",
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
"autoSaveInterval": 1,
"autoPushInterval": 60,
"autoPullInterval": 1,
"autoPullOnBoot": false,
"disablePush": false,
"pullBeforePush": true,
"disablePopups": false,
"disablePopupsForNoChanges": false,
"listChangedFilesInMessageBody": false,
"showStatusBar": true,
"updateSubmodules": false,
"syncMethod": "merge",
"customMessageOnAutoBackup": false,
"autoBackupAfterFileChange": true,
"treeStructure": false,
"refreshSourceControl": true,
"basePath": "",
"differentIntervalCommitAndPush": false,
"changedFilesInStatusBar": false,
"showedMobileNotice": true,
"refreshSourceControlTimer": 7000,
"showBranchStatusBar": true,
"setLastSaveToLastCommit": false,
"submoduleRecurseCheckout": false,
"gitDir": "",
"showFileMenu": true,
"authorInHistoryView": "hide",
"dateInHistoryView": false,
"diffStyle": "split",
"lineAuthor": {
"show": false,
"followMovement": "inactive",
"authorDisplay": "initials",
"showCommitHash": false,
"dateTimeFormatOptions": "date",
"dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
"dateTimeTimezone": "viewer-local",
"coloringMaxAge": "1y",
"colorNew": {
"r": 255,
"g": 150,
"b": 150
},
"colorOld": {
"r": 120,
"g": 160,
"b": 255
},
"textColorCss": "var(--text-muted)",
"ignoreWhitespace": false,
"gutterSpacingFallbackLength": 5,
"lastShownAuthorDisplay": "initials",
"lastShownDateTimeFormatOptions": "date"
},
"autoCommitMessage": "vault backup: {{date}}"
}

View File

@ -1 +0,0 @@
Username for 'https://github.com':

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
{
"author": "Vinzent",
"authorUrl": "https://github.com/Vinzent03",
"id": "obsidian-git",
"name": "Git",
"description": "Integrate Git version control with automatic backup and other advanced features.",
"isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent",
"version": "2.31.1"
}

View File

@ -1,23 +0,0 @@
#!/bin/sh
PROMPT="$1"
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
cleanup() {
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
}
trap cleanup EXIT
echo "$PROMPT" > "$TEMP_FILE"
while [ ! -e "$TEMP_FILE.response" ]; do
if [ ! -e "$TEMP_FILE" ]; then
echo "Trigger file got removed: Abort" >&2
exit 1
fi
sleep 0.1
done
RESPONSE=$(cat "$TEMP_FILE.response")
echo "$RESPONSE"

View File

@ -1,576 +0,0 @@
@keyframes loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.workspace-leaf-content[data-type="git-view"] .button-border {
border: 2px solid var(--interactive-accent);
border-radius: var(--radius-s);
}
.workspace-leaf-content[data-type="git-view"] .view-content {
padding: 0;
}
.workspace-leaf-content[data-type="git-history-view"] .view-content {
padding: 0;
}
.loading > svg {
animation: 2s linear infinite loading;
transform-origin: 50% 50%;
display: inline-block;
}
.obsidian-git-center {
margin: auto;
text-align: center;
width: 50%;
}
.obsidian-git-textarea {
display: block;
margin-left: auto;
margin-right: auto;
}
.obsidian-git-disabled {
opacity: 0.5;
}
.obsidian-git-center-button {
display: block;
margin: 20px auto;
}
.tooltip.mod-left {
overflow-wrap: break-word;
}
.tooltip.mod-right {
overflow-wrap: break-word;
}
.git-tools {
display: flex;
margin-left: auto;
}
.git-tools .type {
padding-left: var(--size-2-1);
display: flex;
align-items: center;
justify-content: center;
width: 11px;
}
.git-tools .type[data-type="M"] {
color: orange;
}
.git-tools .type[data-type="D"] {
color: red;
}
.git-tools .buttons {
display: flex;
}
.git-tools .buttons > * {
padding: 0 0;
height: auto;
}
.is-active .git-tools .buttons > * {
color: var(--nav-item-color-active);
}
.git-author {
color: var(--text-accent);
}
.git-date {
color: var(--text-accent);
}
.git-ref {
color: var(--text-accent);
}
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
display: none;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-wrapper {
text-align: left;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header {
background-color: var(--background-primary);
border-bottom: 1px solid var(--interactive-accent);
font-family: var(--font-monospace);
height: 35px;
padding: 5px 10px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header,
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
font-size: 14px;
margin-left: auto;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-added {
border: 1px solid #b4e2b4;
border-radius: 5px 0 0 5px;
color: #399839;
padding: 2px;
text-align: right;
vertical-align: middle;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted {
border: 1px solid #e9aeae;
border-radius: 0 5px 5px 0;
color: #c33;
margin-left: 1px;
padding: 2px;
text-align: left;
vertical-align: middle;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-name-wrapper {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 15px;
width: 100%;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-name {
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper {
border: 1px solid var(--background-modifier-border);
border-radius: 3px;
margin-bottom: 1em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border: 1px solid var(--background-modifier-border);
border-radius: 3px;
cursor: pointer;
display: none;
font-size: 12px;
justify-content: flex-end;
padding: 4px 8px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected {
background-color: #c8e1ff;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input {
margin: 0 4px 0 0;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-table {
border-collapse: collapse;
font-family: Menlo, Consolas, monospace;
font-size: 13px;
width: 100%;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-files-diff {
width: 100%;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-diff {
overflow-y: hidden;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff {
display: inline-block;
margin-bottom: -8px;
margin-right: -4px;
overflow-x: scroll;
overflow-y: hidden;
width: 50%;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line {
padding: 0 8em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line {
display: inline-block;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: 100%;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line {
padding: 0 4.5em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-ctn {
word-wrap: normal;
background: none;
display: inline-block;
padding: 0;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
vertical-align: middle;
white-space: pre;
width: 100%;
}
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
.theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
del {
background-color: #ffb6ba;
}
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
.theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
del {
background-color: #8d232881;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
border-radius: 0.2em;
display: inline-block;
margin-top: -1px;
text-decoration: none;
vertical-align: middle;
}
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
.theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
ins {
background-color: #97f295;
text-align: left;
}
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
.theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
ins {
background-color: #1d921996;
text-align: left;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix {
word-wrap: normal;
background: none;
display: inline;
padding: 0;
white-space: pre;
}
.workspace-leaf-content[data-type="diff-view"] .line-num1 {
float: left;
}
.workspace-leaf-content[data-type="diff-view"] .line-num1,
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
padding: 0 0.5em;
text-overflow: ellipsis;
width: 3.5em;
}
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
float: right;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-muted);
cursor: pointer;
display: inline-block;
position: absolute;
text-align: right;
width: 7.5em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after {
content: "\200b";
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-muted);
cursor: pointer;
display: inline-block;
overflow: hidden;
padding: 0 0.5em;
position: absolute;
text-align: right;
text-overflow: ellipsis;
width: 4em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr {
position: relative;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after {
content: "\200b";
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder,
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber,
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber {
direction: rtl;
}
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del {
background-color: #fee8e9;
border-color: #e9aeae;
}
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
background-color: #dfd;
border-color: #b4e2b4;
}
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del {
background-color: #521b1d83;
border-color: #691d1d73;
}
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
background-color: rgba(30, 71, 30, 0.5);
border-color: #13501381;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-info {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
color: var(--text-normal);
}
.theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-del.d2h-change {
background-color: #fdf2d0;
}
.theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-del.d2h-change {
background-color: #55492480;
}
.theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-ins.d2h-change {
background-color: #ded;
}
.theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-ins.d2h-change {
background-color: rgba(37, 78, 37, 0.418);
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper {
margin-bottom: 10px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a {
color: #3572b0;
text-decoration: none;
}
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-list-wrapper
a:visited {
color: #3572b0;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header {
text-align: left;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title {
font-weight: 700;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
text-align: left;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list {
display: block;
list-style: none;
margin: 0;
padding: 0;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li {
border-bottom: 1px solid var(--background-modifier-border);
margin: 0;
padding: 5px 10px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child {
border-bottom: none;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-file-switch {
cursor: pointer;
display: none;
font-size: 10px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-icon {
fill: currentColor;
margin-right: 10px;
vertical-align: middle;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted {
color: #c33;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-added {
color: #399839;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-changed {
color: #d0b44c;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-moved {
color: #3572b0;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-tag {
background-color: var(--background-primary);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 10px;
margin-left: 5px;
padding: 0 2px;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag {
border: 2px solid #c33;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-added-tag {
border: 1px solid #399839;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag {
border: 1px solid #d0b44c;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag {
border: 1px solid #3572b0;
}
/* ====================== Line Authoring Information ====================== */
.cm-gutterElement.obs-git-blame-gutter {
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
border-width: 0px 2px 0.2px 2px;
border-style: solid;
border-color: var(--background-secondary);
background-color: var(--background-secondary);
}
.cm-gutterElement.obs-git-blame-gutter > div,
.line-author-settings-preview {
/* delegate text color to settings */
color: var(--obs-git-gutter-text);
font-family: monospace;
height: 100%; /* ensure, that age-based background color occupies entire parent */
text-align: right;
padding: 0px 6px 0px 6px;
white-space: pre; /* Keep spaces and do not collapse them. */
}
@media (max-width: 800px) {
/* hide git blame gutter not to superpose text */
.cm-gutterElement.obs-git-blame-gutter {
display: none;
}
}
.git-unified-diff-view,
.git-split-diff-view .cm-deletedLine .cm-changedText {
background-color: #ee443330;
}
.git-unified-diff-view,
.git-split-diff-view .cm-insertedLine .cm-changedText {
background-color: #22bb2230;
}

View File

@ -1,174 +0,0 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// main.ts
var main_exports = {};
__export(main_exports, {
default: () => UpdateRelativeLinksPlugin
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");
// lib/path.ts
var SEP = "/";
function dirname(path) {
return stackToPath(pathToStack(path).slice(0, -1));
}
function relative(from, to) {
if (!from) {
return to;
}
const fromStack = pathToStack(from);
const toStack = pathToStack(to);
const firstDiffIdx = fromStack.findIndex((value, idx) => value != toStack[idx]);
const resultStack = [];
for (let i = firstDiffIdx; i < fromStack.length - 1; i++) {
resultStack.push("..");
}
for (let i = firstDiffIdx; i < toStack.length; i++) {
resultStack.push(toStack[i]);
}
return stackToPath(resultStack);
}
function pathToStack(path) {
return path.split(SEP);
}
function stackToPath(stack) {
return stack.join(SEP);
}
// main.ts
var ConfirmModal = class extends import_obsidian.Modal {
constructor(app, content, onConfirm) {
super(app);
this.content = content;
this.onConfirm = onConfirm;
}
onOpen() {
const { contentEl } = this;
contentEl.createEl("h1", { text: "Update Releate Links Plugin" });
contentEl.createEl("p", { text: this.content });
new import_obsidian.Setting(contentEl).addButton((btn) => btn.setButtonText("Yes").setCta().onClick(() => {
this.close();
this.onConfirm();
})).addButton((btn) => btn.setButtonText("No").onClick(() => {
this.close();
}));
}
onClose() {
this.contentEl.empty();
}
};
var UpdateRelativeLinksPlugin = class extends import_obsidian.Plugin {
async onload() {
const { app } = this;
const { metadataCache, vault } = app;
const message = "This command will modify all links in the entire vault (not just the current file) to relative paths, and this action cannot be undone. It is recommended that you back up the vault in advance. Please confirm whether you want to execute the command.";
this.addCommand({
id: "update-all-relative-links",
name: "Update all relative links",
callback() {
new ConfirmModal(app, message, () => {
const promises = vault.getMarkdownFiles().map((file) => replace(file, false));
Promise.all(promises).then((linkCounts) => {
const updatedLinkCounts = linkCounts.filter((count) => count > 0);
const linkCount = updatedLinkCounts.reduce((sum, count) => sum + count, 0);
const fileCount = updatedLinkCounts.length;
new import_obsidian.Notice(`Update ${linkCount} links in ${fileCount} file${fileCount > 1 ? "s" : ""}.`);
}).catch((err) => {
new import_obsidian.Notice("Update links error, see console.");
console.error(err);
});
}).open();
}
});
this.registerEvent(vault.on("rename", (file, oldPath) => {
var _a;
if (!oldPath || !file.path.toLocaleLowerCase().endsWith(".md") || ((_a = file.parent) == null ? void 0 : _a.path) === dirname(oldPath)) {
return;
}
if (file instanceof import_obsidian.TFile) {
setTimeout(() => replace(file, true), 100);
}
}));
async function replace(file, notice) {
var _a, _b;
const metadata = metadataCache.getFileCache(file);
const links = [...(_a = metadata == null ? void 0 : metadata.links) != null ? _a : [], ...(_b = metadata == null ? void 0 : metadata.embeds) != null ? _b : []];
const replacePairs = links.map(({ link, original }) => {
var _a2;
const linkPath = link.replace(/#.*$/, "");
if (!linkPath) {
return null;
}
const linkFile = metadataCache.getFirstLinkpathDest(linkPath, file.path);
if (!linkFile) {
return null;
}
const newLinkPath = ((_a2 = file.parent) == null ? void 0 : _a2.path) === "/" ? linkFile.path : relative(file.path, linkFile.path);
if (linkPath === newLinkPath) {
return null;
}
const newOriginal = replaceOriginal(original, linkPath, newLinkPath);
return [original, newOriginal];
}).filter((pair) => pair);
if (!(replacePairs == null ? void 0 : replacePairs.length)) {
return 0;
}
try {
const content = await vault.read(file);
const replacedContent = replacePairs.reduce((tmpContent, pair) => {
return (pair == null ? void 0 : pair.length) === 2 ? tmpContent.replace(pair[0], pair[1]) : tmpContent;
}, content);
await vault.modify(file, replacedContent);
const msg = `Update ${replacePairs.length} links in ${file.path}.`;
console.log(msg);
if (notice) {
new import_obsidian.Notice(msg);
}
return replacePairs.length;
} catch (e) {
console.error(e);
if (notice) {
new import_obsidian.Notice("Update links error, see console.");
}
throw e;
}
}
function replaceOriginal(original, link, newLink) {
let newOriginal = replaceWithFormat(original, link, newLink, (s) => s.replace(/ /g, "%20"));
if (original === newOriginal) {
newOriginal = replaceWithFormat(original, link, newLink, encodeURI);
}
if (original === newOriginal) {
newOriginal = original.replace(/^(!?\[.*?\]).*$/, `$1(${encodeURI(newLink)})`);
}
return newOriginal;
}
function replaceWithFormat(str, from, to, format) {
return str.replace(format(from), format(to));
}
}
};
/* nosourcemap */

View File

@ -1,10 +0,0 @@
{
"id": "update-relative-links",
"name": "Update Relative Links",
"version": "2.1.3",
"minAppVersion": "0.15.0",
"description": "Update relative links.",
"author": "val",
"authorUrl": "https://github.com/val3344/obsidian-update-relative-links",
"isDesktopOnly": false
}

View File

@ -1,7 +0,0 @@
{
"name": "ITS Theme",
"version": "1.3.31",
"minAppVersion": "0.16.0",
"author": "SlRvb",
"authorUrl": "https://github.com/SlRvb"
}

File diff suppressed because one or more lines are too long

View File

@ -1,227 +0,0 @@
{
"main": {
"id": "ed000e1fdec3c650",
"type": "split",
"children": [
{
"id": "d140e32729e7b807",
"type": "tabs",
"children": [
{
"id": "a059c5d2dde5cccf",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "SanPinPLM/相关操作/1.EDM/60.CAD接口使用.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "60.CAD接口使用"
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "42a5659eda9f7074",
"type": "split",
"children": [
{
"id": "d59f9737238cec0c",
"type": "tabs",
"children": [
{
"id": "262fdb4633fcf55d",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical",
"autoReveal": false
},
"icon": "lucide-folder-closed",
"title": "文件列表"
}
},
{
"id": "f065ac0941d6809e",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "目录模板",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
},
"icon": "lucide-search",
"title": "搜索"
}
},
{
"id": "3c60fa22a0a5ddcc",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {},
"icon": "lucide-bookmark",
"title": "书签"
}
}
]
}
],
"direction": "horizontal",
"width": 200
},
"right": {
"id": "65248f9a3962ae93",
"type": "split",
"children": [
{
"id": "3c0e70d05e58edb1",
"type": "tabs",
"children": [
{
"id": "07b0a90e46430bb4",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "SanPinPLM/相关操作/1.EDM/60.CAD接口使用.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
"title": "60.CAD接口使用 的大纲"
}
},
{
"id": "e2f7484da718654a",
"type": "leaf",
"state": {
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true
},
"icon": "lucide-file",
"title": "插件不再活动"
}
},
{
"id": "8c0ffde16d40f63b",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "SanPinPLM/相关操作/1.EDM/60.CAD接口使用.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "60.CAD接口使用 的反向链接列表"
}
},
{
"id": "e89425d59bc3b161",
"type": "leaf",
"state": {
"type": "outgoing-link",
"state": {
"file": "SanPinPLM/相关操作/1.EDM/60.CAD接口使用.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-going-out",
"title": "60.CAD接口使用 的出链列表"
}
},
{
"id": "27878581586f2143",
"type": "leaf",
"state": {
"type": "git-view",
"state": {},
"icon": "lucide-file",
"title": "插件不再活动"
}
}
]
}
],
"direction": "horizontal",
"width": 200
},
"left-ribbon": {
"hiddenItems": {
"switcher:打开快速切换": true,
"graph:查看关系图谱": false,
"daily-notes:打开/创建今天的日记": true,
"command-palette:打开命令面板": false,
"obsidian-git:Open Git source control": false,
"hidden-folder-obsidian:显示文件夹": false
}
},
"active": "262fdb4633fcf55d",
"lastOpenFiles": [
"SanPinPLM/相关操作/0.SETOUT/11.IP地址固定.md",
"conflict-files-obsidian-git.md",
"SanPinPLM/相关操作/1.EDM/assets/Pasted image 20250301124159.png",
"SanPinPLM/相关操作/0.SETOUT/12.服务端安装、端口设置.md",
"SanPinPLM/相关操作/0.SETOUT/10.数据库安装.md",
"SanPinPLM/数据库/数据库.md",
"SanPinPLM/简略教程/外邮通知教程.md",
"SanPinPLM/相关操作/3.PLM/15.项目模板配置.md",
"SanPinPLM/相关操作/3.PLM/assets/Pasted image 20250228153221.png",
"SanPinPLM/相关操作/3.PLM/未命名.md",
"SanPinPLM/相关操作/3.PLM/22.任务类权限详解.md",
"SanPinPLM/相关操作/3.PLM/20.项目角色.md",
"SanPinPLM/相关操作/2.PDM/56.文档关联物料.md",
"SanPinPLM/相关操作/2.PDM/57.同步图纸内属性到文档属性.md",
"SanPinPLM/相关操作/2.PDM/58.图号生成.md",
"SanPinPLM/相关操作/1.EDM/28.AutoCAD图纸模板制作.md",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250228123016.png",
"SanPinPLM/相关操作/2.PDM/54.借用与编辑借用物料.md",
"SanPinPLM/相关操作/2.PDM/50.创建与编辑物料.md",
"SanPinPLM/相关操作/2.PDM/61.BOM导出.md",
"SanPinPLM/相关操作/2.PDM/60.BOM搭建.md",
"SanPinPLM/相关操作/2.PDM/59.把零部件放入标准物料库.md",
"SanPinPLM/相关操作/2.PDM/30.图号、物料编码唯一性设置.md",
"SanPinPLM/相关操作/4.other/200.Delphi脚本.md",
"SanPinPLM/相关操作/0.SETOUT/15.服务端升级.md",
"SanPinPLM/相关操作/0.SETOUT/20.浏览器安装、调试.md",
"SanPinPLM/相关操作/2.PDM/13.CAXA接口安装、属性映射.md",
"SanPinPLM/相关操作/2.PDM/10.AutoCAD接口安装.md",
"SanPinPLM/相关操作/2.PDM/Files/Documents/~$BOM表导出模板.xlsx",
"SanPinPLM/数据库",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225103406.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225102811.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225102303.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225102049.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225101906.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225101257.png",
"SanPinPLM/相关操作/2.PDM/assets/Pasted image 20250225101041.png",
"未命名.canvas",
"KMmpm/系统介绍/数据建模/对象类定义/assets",
"KMmpm/系统介绍/数据建模/对象类定义",
"KMmpm/系统介绍/数据建模",
"KMmpm/相关操作/容器目录管理/assets",
"KMmpm/相关操作/容器目录管理",
"AutoCAD/Files/CAD模板.7z",
"AutoCAD/Files",
"AutoCAD/新建文件夹"
]
}