Obsidian Orthography 插件使用教程

Obsidian Orthography 插件使用教程

obsidian-orthographyThe Obsidian plugin for checking grammar and correcting spelling errors in text.项目地址:https://gitcode.com/gh_mirrors/ob/obsidian-orthography

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

Obsidian Orthography 插件的目录结构如下:

obsidian-orthography/
├── __tests__/
│   └── orthography/
├── src/
│   ├── eslintignore
│   ├── eslintrc
│   ├── gitignore
│   ├── prettierrc
│   ├── LICENCE
│   ├── README.md
│   ├── babel.config.js
│   ├── data.json
│   ├── jest.config.ts
│   ├── manifest.json
│   ├── package.json
│   ├── preview.gif
│   ├── rollup.config.js
│   ├── styles.css
│   ├── tsconfig.json
│   └── versions.json

目录结构介绍

  • __tests__/: 包含插件的测试文件。
  • src/: 包含插件的主要源代码文件。
    • eslintignore: ESLint 忽略配置文件。
    • eslintrc: ESLint 配置文件。
    • gitignore: Git 忽略配置文件。
    • prettierrc: Prettier 代码格式化配置文件。
    • LICENCE: 插件的许可证文件。
    • README.md: 插件的说明文档。
    • babel.config.js: Babel 配置文件。
    • data.json: 数据文件。
    • jest.config.ts: Jest 测试配置文件。
    • manifest.json: Obsidian 插件的清单文件。
    • package.json: Node.js 项目的包管理文件。
    • preview.gif: 插件预览图。
    • rollup.config.js: Rollup 打包配置文件。
    • styles.css: 插件的样式文件。
    • tsconfig.json: TypeScript 配置文件。
    • versions.json: 版本信息文件。

2. 项目的启动文件介绍

Obsidian Orthography 插件的启动文件主要是 src/main.ts。这个文件是插件的入口点,负责初始化和启动插件的主要功能。

// src/main.ts
import { Plugin } from 'obsidian';
import { OrthographyPlugin } from './orthography';

export default class Orthography extends Plugin {
  async onload() {
    this.addRibbonIcon('glasses', 'Orthography', () => {
      new OrthographyPlugin(this.app).activate();
    });
  }
}

启动文件介绍

  • src/main.ts: 插件的主入口文件,继承自 Plugin 类,并在 onload 方法中初始化插件。

3. 项目的配置文件介绍

Obsidian Orthography 插件的配置文件主要包括以下几个:

  • eslintrc: ESLint 配置文件,用于代码风格检查。
  • prettierrc: Prettier 配置文件,用于代码格式化。
  • babel.config.js: Babel 配置文件,用于转换现代 JavaScript 代码。
  • jest.config.ts: Jest 测试配置文件,用于单元测试。
  • rollup.config.js: Rollup 打包配置文件,用于构建插件。
  • tsconfig.json: TypeScript 配置文件,用于 TypeScript 编译。

配置文件介绍

  • eslintrc: 配置 ESLint 规则,确保代码风格一致。
  • prettierrc: 配置 Prettier 规则,自动格式化代码。
  • babel.config.js: 配置 Babel 转换规则,支持现代 JavaScript 特性。
  • jest.config.ts: 配置 Jest 测试框架,进行单元测试。
  • rollup.config.js: 配置 Rollup 打包工具,构建插件。
  • tsconfig.json: 配置 TypeScript 编译选项,编译 TypeScript 代码。

以上是 Obsidian Orthography 插件的基本使用教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望对您有所帮助!

obsidian-orthographyThe Obsidian plugin for checking grammar and correcting spelling errors in text.项目地址:https://gitcode.com/gh_mirrors/ob/obsidian-orthography

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

侯彬颖Butterfly

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

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

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

打赏作者

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

抵扣说明:

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

余额充值