Obsidian Smart Connections 项目教程

Obsidian Smart Connections 项目教程

obsidian-smart-connectionsChat with your notes in Obsidian! Plus, see what's most relevant in real-time! Interact and stay organized. Powered by OpenAI ChatGPT, GPT-4 & Embeddings.项目地址:https://gitcode.com/gh_mirrors/ob/obsidian-smart-connections

1. 项目的目录结构及介绍

Obsidian Smart Connections 项目的目录结构如下:

obsidian-smart-connections/
├── .github/
│   └── workflows/
│       └── main.yml
├── assets/
│   └── icon.png
├── src/
│   ├── main.ts
│   ├── styles.css
│   └── view.ts
├── .gitignore
├── .obsidian.json
├── LICENSE
├── README.md
├── package.json
└── tsconfig.json

目录结构介绍

  • .github/workflows/: 包含 GitHub Actions 的工作流配置文件。
  • assets/: 存放项目的静态资源,如图标等。
  • src/: 项目的源代码目录,包含主要的 TypeScript 文件和样式文件。
  • .gitignore: 指定 Git 忽略的文件和目录。
  • .obsidian.json: Obsidian 插件的配置文件。
  • LICENSE: 项目的开源许可证。
  • README.md: 项目的说明文档。
  • package.json: 项目的依赖和脚本配置文件。
  • tsconfig.json: TypeScript 的编译配置文件。

2. 项目的启动文件介绍

项目的启动文件位于 src/main.ts。该文件是插件的入口点,负责初始化插件并注册必要的 Obsidian 事件。

import { Plugin } from 'obsidian';
import { SmartConnectionsView, VIEW_TYPE_SMART_CONNECTIONS } from './view';

export default class SmartConnectionsPlugin extends Plugin {
    async onload() {
        this.registerView(VIEW_TYPE_SMART_CONNECTIONS, (leaf) => new SmartConnectionsView(leaf));
    }
}

启动文件介绍

  • src/main.ts: 插件的主入口文件,继承自 Plugin 类,并在 onload 方法中注册视图。

3. 项目的配置文件介绍

项目的配置文件主要包括 package.json.obsidian.json

package.json

package.json 文件定义了项目的依赖、脚本和其他元数据。

{
  "name": "obsidian-smart-connections",
  "version": "1.0.0",
  "description": "A smart connections plugin for Obsidian",
  "main": "main.js",
  "scripts": {
    "dev": "rollup --config rollup.config.js -w",
    "build": "rollup --config rollup.config.js"
  },
  "keywords": [],
  "author": "Brian Petro",
  "license": "MIT",
  "devDependencies": {
    "obsidian": "^0.12.0",
    "rollup": "^2.38.0"
  }
}

.obsidian.json

.obsidian.json 文件是 Obsidian 插件的配置文件,通常包含插件的设置和选项。

{
  "enabled": true,
  "apiKey": "your-api-key"
}

配置文件介绍

  • package.json: 定义了项目的名称、版本、描述、主入口文件、脚本、关键词、作者、许可证和开发依赖。
  • .obsidian.json: 包含插件的启用状态和 API 密钥等配置选项。

以上是 Obsidian Smart Connections 项目的详细教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。

obsidian-smart-connectionsChat with your notes in Obsidian! Plus, see what's most relevant in real-time! Interact and stay organized. Powered by OpenAI ChatGPT, GPT-4 & Embeddings.项目地址:https://gitcode.com/gh_mirrors/ob/obsidian-smart-connections

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鲍丁臣Ursa

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值