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

相关推荐
U***49839 小时前
前端TypeScript教程汇总,从基础到高级
前端·javascript·typescript
百***355111 小时前
TypeScript 与后端开发Node.js
javascript·typescript·node.js
宇余11 小时前
ES2025新特性实战:5分钟get前端高频实用语法
前端·typescript
网络点点滴1 天前
简单介绍TS中的接口、泛型、自定义类型
typescript
濮水大叔1 天前
VonaJS: 基于winston的Logger日志系统
typescript·nodejs·nestjs
zhenryx2 天前
React Native 自定义 ScrollView 滚动条:开箱即用的 IndicatorScrollView(附源码示例)
javascript·react native·react.js·typescript
Kisang.2 天前
【HarmonyOS】ArkTS的多线程并发(下)——线程间通信对象的传递
华为·typescript·harmonyos·鸿蒙
eason_fan3 天前
Monorepo性能噩梦:一行配置解决VSCode卡顿与TS类型崩溃
前端·typescript·visual studio code
xiaohe06013 天前
🧸 前端不是只会写管理后台,我用 400 行代码画了一个 LABUBU !
vue.js·typescript·canvas