From 83257538cdaa873a9a4cc493305edf0aee259ddf Mon Sep 17 00:00:00 2001
From: uzvg <1497911983@qq.com>
Date: Thu, 7 Mar 2024 14:30:52 +0800
Subject: [PATCH] Saved by TiddlyWiki
---
docs/index.html | 690 ++++++++++--------------------------------------
1 file changed, 145 insertions(+), 545 deletions(-)
diff --git a/docs/index.html b/docs/index.html
index 1bbbebe..7c970e8 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -10,7 +10,7 @@
-
+
@@ -47,12 +47,11 @@
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
-
☕️ WEEKLY — 咖啡周报/技术/读书/分享/交流
+uzvg's creative workspace — a non-linear personal web notebook
-
@@ -142,89 +141,35 @@
This TiddlyWiki contains the following tiddlers:
-📖王立铭进化论讲义
+$:/blogsite/Macros/image-basic
-📖究竟什么是博弈论?
+$:/blogsite/siteTweaks/ButtonAutoHide.css
-$:/config/AnimationDuration
-
-$:/config/DefaultSidebarTab
-
-$:/config/giscus/discussion-category-id
+$:/blogsite/siteTweaks/GradientHeading.css
-$:/config/giscus/loading
+$:/blogsite/siteTweaks/image-alignment.css
-$:/config/giscus/position
+$:/blogsite/siteTweaks/image-basic.css
-$:/config/giscus/repository
+$:/blogsite/siteTweaks/RoundCorner.css
-$:/config/giscus/repository-id
-
-$:/config/giscus/theme
-
-$:/config/giscus/theme/custom-theme-url
+$:/config/AnimationDuration
$:/config/Navigation/UpdateAddressBar
-$:/config/Navigation/UpdateHistory
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/close-all
-
$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/layout
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/more-page-actions
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-image
-
$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-journal
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/palette
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/permaview
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/save-wiki
-
-$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/tag-manager
-
-$:/config/Performance/Instrumentation
-
-$:/config/Plugins/Disabled/$:/plugins/abraham/giscus-for-tiddlywiki-plugin
+$:/config/Plugins/Disabled/$:/plugins/tiddlywiki/codemirror-mode-markdown
$:/config/RelinkOnRename
-$:/config/TextEditor/EditorHeight/Mode
-
-$:/config/TiddlerInfo/Mode
-
$:/config/Tiddlers/TitleLinks
-$:/config/Toolbar/Text
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/close-others
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/delete
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/open-window
-
-$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permalink
-
$:/core
-$:/core/ui/SideBar/More
-
-$:/core/ui/SideBar/Tools
+$:/core/ui/ViewTemplate/subtitle/modified
$:/DefaultTiddlers
@@ -242,46 +187,24 @@
$:/isEncrypted
-$:/layout
-
$:/palette
$:/palettes/coffee-weekly
-$:/palettes/DesertSand
-
-$:/plugins/abraham/giscus-for-tiddlywiki-plugin
-
-$:/plugins/abraham/giscus-for-tiddlywiki-plugin/giscus-comment-template
-
-$:/plugins/telmiger/details
-
-$:/plugins/tiddlywiki/codemirror
-
-$:/plugins/tiddlywiki/codemirror-autocomplete
-
-$:/plugins/tiddlywiki/codemirror-closebrackets
-
-$:/plugins/tiddlywiki/codemirror-closetag
-
-$:/plugins/tiddlywiki/highlight
-
-$:/SiteSubtitle
+$:/palettes/CoffeeWeekly
$:/SiteTitle
+$:/state/http-requests
+
$:/state/tab-1749438307
$:/state/tab-2065006209
-$:/state/tab/sidebar--595412856
-
$:/status/RequireReloadDueToPluginChange
$:/StoryList
-$:/tags/PageControls
-
$:/tags/SideBar
$:/theme
@@ -290,16 +213,6 @@
$:/themes/tiddlywiki/vanilla
-$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize
-
-$:/themes/tiddlywiki/vanilla/metrics/bodylineheight
-
-$:/themes/tiddlywiki/vanilla/metrics/fontsize
-
-$:/themes/tiddlywiki/vanilla/metrics/lineheight
-
-$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint
-
$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth
$:/themes/tiddlywiki/vanilla/metrics/storyleft
@@ -310,273 +223,59 @@
$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth
-$:/themes/tiddlywiki/vanilla/options/sidebarlayout
-
-$:/themes/tiddlywiki/vanilla/options/stickytitles
-
$:/themes/tiddlywiki/vanilla/settings/backgroundimage
-$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment
-
-$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize
-
-$:/themes/tiddlywiki/vanilla/settings/codefontfamily
-
-$:/themes/tiddlywiki/vanilla/settings/editorfontfamily
-
-$:/themes/tiddlywiki/vanilla/settings/fontfamily
-
-$:/uzvg/audios/rain.mp3
-
-$:/uzvg/highlight/css/github-dark.css
-
-$:/uzvg/images/christmas-bauble-1079926_1280.jpg
-
-$:/uzvg/images/HomePage.jpg
-
-$:/uzvg/snippets/neteasemusic
-
-$:/uzvg/snippets/ratingstar
-
-$:/uzvg/Stylesheet/coffee-weekly
-
-$:/uzvg/Stylesheet/font
-
-$:/uzvg/Stylesheet/highlight/brown-paper.css
-
-$:/uzvg/viewTemplates/coffee-weekly
-
-$:/uzvg/viewTemplates/imgInfo
-
-$:/uzvg/viewTemplates/ratingPanel
-
-$:/uzvg/viewTemplates/siteFooter
-
-$:/uzvg/viewTemplates/software
-
-$:/uzvg/viewTemplates/tagPanel
-
$:/view
-1971385.jpg
-
-641ecffca682492fcccee946.jpg
-
642040e5a682492fcc01ad46.jpg
-About
-
-About ☕️ weekly
-
-About Me
-
-About 咖啡周报
-
-aliyunpan-go
-
allowComment
-Anime
-
-anoter new wiki
-
-coffee-weekly.jpg
-
coffeeWeekly
-Contents
-
-CowBoy Bebop
-
-cut
-
-cyco
-
-Evangelion
-
-fd
-
-figlet
-
find
-Find me
+hiding测试
-firefox
+Home Page
-Git
+Install-Device-Moved-Up-in-Boot-Priority-BIOS
-git branch
-
-git cherry-pick
-
-git config
-
-git rebase
-
-git remote
-
-git stash
-
-git tag
-
-git 撤消操作
-
-git 版本回退
-
-gitignore
-
-git基础
-
-grep
-
-Hide firefox tab bar and address bar
-
-Interesting
-
-Linux workflow
-
-Linux 中的source,sh,"."的区别
-
-LinuxSoftware
+jouralctl简易使用手册
Linux基础
Linux文件描述符
-Logseq
+Linux的开机启动过程
Macros
-MyMacros
-
-ncdu
-
-New Tiddler
-
-New Tiddler 1
-
-nodejs tiddlywiki使用说明
-
-nvim
-
-nvim剪贴板
-
-old-papaper.jpg
-
-PAO
-
-rime
-
-rime输入法配置
-
-sed
-
-shell中的字段分隔符
-
-shell中的数值计算
-
-shell脚本
-
-site-background.jpg
-
-sort
-
-ssh密钥
-
-TableOfContents
-
-tag在tiddlywiki中的作用
-
-tar
-
-taskwarrior
-
-Templates and the Current Tiddler
+Python——文本
tiddlywiki
-tiddlywiki test for coffee-weekly
-
-TiddlywikiLittleTricks
-
tiddlywiki功能需求分析
tiddlywiki变量
-tiddlywiki模板
-
-tiddlywiki添加giscus评论系统
-
tiddlywiki目录设置
-tiddlywiki筛选器
-
tiddlywiki筛选器常用操作符
-tiddlywiki转置
+之所以卷,是因为我们一直在模仿别人
-tiolet
+什么是initramfs?
-tmux
+做事要有清晰度
-TroubleShootings
-
-useradd
-
-userdel
-
-uzvg
-
-wallhaven-13rql3.png
-
-wallhaven-eyeewr.jpg
-
-Wallpaper collector
-
-wc
-
-Welcome!
-
-widget
-
-wikitext
-
-中文显示测试
-
-创建目录
-
-在宏中使用变量
-
-学习方法
-
-学习观
-
-宏、嵌入语法总结
-
-常用宏
-
-引入外部开源字体
+如何勇敢迈出第一步?
忘记目标,关注体系
-文件属性
-
-文本替换
-
-筛选器与转置
-
-筛选器中使用宏与变量
+父母的辛苦与你无关
-系统级tiddler
-
-网站底部添加备案信息
-
-读书笔记
-
-调色板测试
-
-配置文件管理👉chezmoi
+说说结婚
@@ -591,224 +290,74 @@
@@ -1571,10 +1120,22 @@
return typeInfo ? typeInfo.encoding : "utf8";
};
+var globalCheck =[
+ " Object.defineProperty(Object.prototype, '__temp__', {",
+ " get: function () { return this; },",
+ " configurable: true",
+ " });",
+ " if(Object.keys(__temp__).length){",
+ " console.log(\"Warning: Global assignment detected\",Object.keys(__temp__));",
+ " delete Object.prototype.__temp__;",
+ " }",
+ " delete Object.prototype.__temp__;",
+].join('\n');
+
/*
Run code globally with specified context variables in scope
*/
-$tw.utils.evalGlobal = function(code,context,filename) {
+$tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
var contextCopy = $tw.utils.extend(Object.create(null),context);
// Get the context variables as a pair of arrays of names and values
var contextNames = [], contextValues = [];
@@ -1583,25 +1144,38 @@
contextValues.push(value);
});
// Add the code prologue and epilogue
- code = "(function(" + contextNames.join(",") + ") {(function(){\n" + code + "\n;})();\nreturn exports;\n})\n";
+ code = [
+ "(function(" + contextNames.join(",") + ") {",
+ " (function(){" + code + "\n;})();\n",
+ (!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
+ "\nreturn exports;\n",
+ "})"
+ ].join("");
+
// Compile the code into a function
var fn;
if($tw.browser) {
fn = window["eval"](code + "\n\n//# sourceURL=" + filename);
} else {
- fn = vm.runInThisContext(code,filename);
+ if(sandbox){
+ fn = vm.runInContext(code,sandbox,filename)
+ } else {
+ fn = vm.runInThisContext(code,filename);
+ }
}
// Call the function and return the exports
return fn.apply(null,contextValues);
};
-
+$tw.utils.sandbox = !$tw.browser ? vm.createContext({}) : undefined;
/*
Run code in a sandbox with only the specified context variables in scope
*/
-$tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(code,context,filename) {
- var sandbox = $tw.utils.extend(Object.create(null),context);
- vm.runInNewContext(code,sandbox,filename);
- return sandbox.exports;
+$tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(code,context,filename,allowGlobals) {
+ return $tw.utils.evalGlobal(
+ code,context,filename,
+ allowGlobals ? vm.createContext({}) : $tw.utils.sandbox,
+ allowGlobals
+ );
};
/*
@@ -1902,7 +1476,7 @@
}
} else {
// line number should be included in e.stack for runtime errors
- $tw.utils.error("Error executing boot module " + name + ": " + JSON.stringify(e) + "\n\n" + e.stack);
+ $tw.utils.error("Error executing boot module " + name + ": " + String(e) + "\n\n" + e.stack);
}
}
}
@@ -2126,7 +1700,7 @@
shadowTiddlerTitles = null,
getShadowTiddlerTitles = function() {
if(!shadowTiddlerTitles) {
- shadowTiddlerTitles = Object.keys(shadowTiddlers);
+ shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
}
return shadowTiddlerTitles;
},
@@ -2922,7 +2496,7 @@
// Read the specification
var filesInfo = $tw.utils.parseJSONSafe(fs.readFileSync(filepath + path.sep + "tiddlywiki.files","utf8"));
// Helper to process a file
- var processFile = function(filename,isTiddlerFile,fields,isEditableFile) {
+ var processFile = function(filename,isTiddlerFile,fields,isEditableFile,rootPath) {
var extInfo = $tw.config.fileExtensionInfo[path.extname(filename)],
type = (extInfo || {}).type || fields.type || "text/plain",
typeInfo = $tw.config.contentTypeInfo[type] || {},
@@ -2943,6 +2517,12 @@
} else {
var value = tiddler[name];
switch(fieldInfo.source) {
+ case "subdirectories":
+ value = path.relative(rootPath, filename).split('/').slice(0, -1);
+ break;
+ case "filepath":
+ value = path.relative(rootPath, filename);
+ break;
case "filename":
value = path.basename(filename);
break;
@@ -3025,7 +2605,7 @@
var thisPath = path.relative(filepath, files[t]),
filename = path.basename(thisPath);
if(filename !== "tiddlywiki.files" && !metaRegExp.test(filename) && fileRegExp.test(filename)) {
- processFile(thisPath,dirSpec.isTiddlerFile,dirSpec.fields,dirSpec.isEditableFile);
+ processFile(thisPath,dirSpec.isTiddlerFile,dirSpec.fields,dirSpec.isEditableFile,dirSpec.path);
}
}
} else {
@@ -3050,7 +2630,11 @@
console.log("Warning: missing plugin.info file in " + filepath);
return null;
}
- var pluginInfo = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8"));
+ var pluginInfo = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8"),function() {return null;});
+ if(!pluginInfo) {
+ console.log("warning: invalid JSON in plugin.info file at " + infoPath);
+ pluginInfo = {};
+ }
// Read the plugin files
var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp);
// Save the plugin tiddlers into the plugin info
@@ -3167,7 +2751,11 @@
pluginFields;
// Bail if we don't have a wiki info file
if(fs.existsSync(wikiInfoPath)) {
- wikiInfo = $tw.utils.parseJSONSafe(fs.readFileSync(wikiInfoPath,"utf8"));
+ wikiInfo = $tw.utils.parseJSONSafe(fs.readFileSync(wikiInfoPath,"utf8"),function() {return null;});
+ if(!wikiInfo) {
+ console.log("warning: invalid JSON in tiddlywiki.info file at " + wikiInfoPath);
+ wikiInfo = {};
+ }
} else {
return null;
}
@@ -3410,7 +2998,7 @@
$tw.utils.registerFileType("video/webm","base64",".webm");
$tw.utils.registerFileType("video/mp4","base64",".mp4");
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
- $tw.utils.registerFileType("audio/mpeg","base64");
+ $tw.utils.registerFileType("audio/mpeg","base64",[".mp3",".m2a",".mp2",".mpa",".mpg",".mpga"]);
$tw.utils.registerFileType("text/markdown","utf8",[".md",".markdown"],{deserializerType:"text/x-markdown"});
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
@@ -3637,6 +3225,18 @@
}
};
+/*
+Delete hooks from the hashmap
+*/
+$tw.hooks.removeHook = function(hookName,definition) {
+ if($tw.utils.hop($tw.hooks.names,hookName)) {
+ var p = $tw.hooks.names[hookName].indexOf(definition);
+ if(p !== -1) {
+ $tw.hooks.names[hookName].splice(p, 1);
+ }
+ }
+};
+
/*
Invoke the hook by key
*/