tim-hub_obsidian-bible-refe.../docs/ObsidianPluginDevelopment.md

54 lines
2.5 KiB
Markdown
Raw Normal View History

2021-12-09 06:34:21 +00:00
### First time developing plugins?
Quick starting guide for new plugin devs:
- Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it).
- Clone your repo to a local development folder. For convenience, you can place this folder in your `.obsidian/plugins/your-plugin-name` folder.
- Install NodeJS, then run `npm i` in the command line under your repo folder.
- Run `npm run dev` to compile your plugin from `main.ts` to `main.js`.
2023-08-24 09:36:03 +00:00
- If you get an error related to `biblejs-name-converter`, go to that folder. If it is empty, clone `https://github.com/tim-hub/biblejs-name-converter` into that folder.
- Run `npm i` in that folder.
2021-12-09 06:34:21 +00:00
- Make changes to `main.ts` (or create new `.ts` files). Those changes should be automatically compiled into `main.js`.
- Reload Obsidian to load the new version of your plugin.
- Enable plugin in settings window.
- For updates to the Obsidian API run `npm update` in the command line under your repo folder.
### Adding your plugin to the community plugin list
- Publish an initial version.
- Make sure you have a `README.md` file in the root of your repo.
- Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin.
### How to use
- Clone this repo.
- `npm i` or `yarn` to install dependencies
- `npm run dev` to start compilation in watch mode.
2023-08-24 09:36:03 +00:00
2021-12-09 06:34:21 +00:00
### Manually installing the plugin
- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`.
### Improve code quality with eslint (optional)
- [ESLint](https://eslint.org/) is a tool that analyzes your code to quickly find problems. You can run ESLint against your plugin to find common bugs and ways to improve your code.
- To use eslint with this project, make sure to install eslint from terminal:
- `npm install -g eslint`
- To use eslint to analyze this project use this command:
- `eslint main.ts`
- eslint will then create a report with suggestions for code improvement by file and line number.
- If your source code is in a folder, such as `src`, you can use eslint with this command to analyze all files in that folder:
- `eslint .\src\`
### API and Other Documentation
- [Obsidian API] https://github.com/obsidianmd/obsidian-api
- [Github Sample Plugin](https://github.com/obsidianmd/obsidian-sample-plugin)
- [Release repo](https://github.com/obsidianmd/obsidian-releases)
- Obsidian Plugin Development Discord
2022-09-30 23:20:11 +00:00
- [How to release](./How%20to%20release.md)
2023-02-02 21:02:10 +00:00
- [bible api and source](./bible-api-and-source.md)