同步现在的代码

This commit is contained in:
linghutianhao
2026-08-14 15:28:57 +08:00
parent 5eab53a777
commit 8b6b8e7ab7
66 changed files with 7248 additions and 1248 deletions
@@ -0,0 +1,14 @@
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\typora]
@="URL:Typora Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\typora\shell]
@="open"
[HKEY_CLASSES_ROOT\typora\shell\open]
@="Open Typora"
[HKEY_CLASSES_ROOT\typora\shell\open\command]
@="\"C:\\nvm4w\\nodejs\\node.exe\" \"D:\\projects\\my-website\\tools\\typora-handler.js\" \"%1\""
+14
View File
@@ -0,0 +1,14 @@
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\typora]
@="URL:Typora Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\typora\shell]
@="open"
[HKEY_CLASSES_ROOT\typora\shell\open]
@="Open Typora"
[HKEY_CLASSES_ROOT\typora\shell\open\command]
@="wscript.exe \"D:\\projects\\my-website\\tools\\typora-handler.vbs\" \"%1\""
+14
View File
@@ -0,0 +1,14 @@
const { exec } = require('child_process');
const fs = require('fs');
const url = process.argv[2];
const filePath = decodeURIComponent(url)
.replace(/^typora:\/\/file\//, '')
.replace(/\//g, '\\');
//fs.writeFileSync(__dirname + '/typora-debug.log',`url: ${url}\nfilePath: ${filePath}\n`, 'utf8');
exec('"D:\\Program Files\\Typora\\Typora.exe" "' + filePath + '"', (err, stdout, stderr) => {
if (err) {
//fs.appendFileSync(__dirname + '/typora-debug.log', 'err: ' + err.message + '\n');
}
});
+19
View File
@@ -0,0 +1,19 @@
' typora-handler.vbs
' 获取传入的参数,也就是 typora:// 后面的完整链接
Dim url
url = WScript.Arguments(0)
' 创建一个 Shell 对象
Set WshShell = CreateObject("WScript.Shell")
' 构造要执行的命令
' 注意:这里的路径需要根据你电脑上 node.exe 和 .js 文件的实际位置来写
Dim command
command = """C:\nvm4w\nodejs\node.exe"" ""D:\projects\my-website\tools\typora-handler.js"" """ & url & """"
' 执行命令
' 参数 0 表示隐藏窗口,False 表示不等待程序结束就返回
WshShell.Run command, 0, False
Set WshShell = Nothing