0-1开发自己的obsidian plugin DAY 9

3 weeks later 终于收到了obsidian human review的回复(会同步通知在绑定GitHub的邮箱)

从我欠考虑的desktop/mobile应用 到细节上的UI界面大小写 给出了详细反馈。


一是网页response的问题。

之前我用的是axios.get(), 但建议统一为Obsidian API提供的requestUrl。

二是大小写问题。

在UI界面上,需要统一成sentence case,即I Am A Student. -> I am a student. 仅首字母大写。

三是平台支持问题。

主要先是分了桌面端/移动端,如果一个应用只支持desktop的话,应该在manifest.json里修改"isDesktopOnly": true,

其次,在desktop设备里,似乎是可以只支持某一种的(如仅支持Mac),只需要1) 在readme中说明,2) 相关验证保证the code is only being executed on a Mac. 我目前的解决方案是加入平台检查:

TypeScript 复制代码
        if (os.platform() !== 'darwin') {
            new Notice('This feature is only supported on macOS.');
            return;
        }

四是路径,

const absPath = app.vault.adapter.basePath;

不建议global的方式,建议采用plugin instance。我参考了这个回复中关于FileSystemAdapter的方案How to get vault absolute path? - #2 by Jare - Developers: Plugin & API - Obsidian Forum

相关推荐
xm_xm_xm_14 小时前
TypeScript 7 个 核心特性
前端·typescript
宇智波亚索7 小时前
TypeScript 实际应用
前端·javascript·typescript
werdedeage1 天前
用 useReducer 管理多参考图生成器的前端状态
react.js·typescript
红尘散仙2 天前
TypeScript WIT Guest:类型约束与 ComponentizeJS 工程化
rust·typescript·webassembly
红尘散仙2 天前
从 dsh 的插件系统出发:为什么我要探索 WIT 与 Wasm Component Model
rust·typescript·webassembly
红尘散仙2 天前
从 WIT 到 Wasmtime:构建 Rust Component 工程
rust·typescript·webassembly
记忆张量MemTensor2 天前
产品更新|MemOS 现已支持 DeepSeek Harness 长期记忆接入
人工智能·typescript·开源·agent
记忆张量MemTensor2 天前
MemOS Skill 上线|一句话即可接入 MemOS Cloud
大数据·数据库·人工智能·typescript·开源
YIAN2 天前
端侧大模型:DeepSeek-R1 WebGPU 推理全流程源码深度解析
前端·typescript·deepseek
苏灿烤鱼2 天前
把求职写成工作流,公开 fork 为什么会把简历写进仓库?
python·typescript·claude