Compare commits

..

No commits in common. "bfa01456443a04973ccd13d6396e4801883ca362" and "2aee08d3d5e950cc6c121904f5f1a918ee6282f9" have entirely different histories.

4 changed files with 10 additions and 8 deletions

View File

@ -2,8 +2,8 @@
This is a sample plugin for Obsidian (https://obsidian.md). This is a sample plugin for Obsidian (https://obsidian.md).
This project uses TypeScript to provide type checking and documentation. This project uses Typescript to provide type checking and documentation.
The repo depends on the latest plugin API (obsidian.d.ts) in TypeScript Definition format, which contains TSDoc comments describing what it does. The repo depends on the latest plugin API (obsidian.d.ts) in Typescript Definition format, which contains TSDoc comments describing what it does.
**Note:** The Obsidian API is still in early alpha and is subject to change at any time! **Note:** The Obsidian API is still in early alpha and is subject to change at any time!
@ -41,7 +41,7 @@ Quick starting guide for new plugin devs:
## Adding your plugin to the community plugin list ## Adding your plugin to the community plugin list
- Check the [plugin guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines). - Check https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md
- Publish an initial version. - Publish an initial version.
- Make sure you have a `README.md` file in the root of your repo. - 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. - Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin.
@ -49,8 +49,7 @@ Quick starting guide for new plugin devs:
## How to use ## How to use
- Clone this repo. - Clone this repo.
- Make sure your NodeJS is at least v16 (`node --version`). - `npm i` or `yarn` to install dependencies
- `npm i` or `yarn` to install dependencies.
- `npm run dev` to start compilation in watch mode. - `npm run dev` to start compilation in watch mode.
## Manually installing the plugin ## Manually installing the plugin

View File

@ -120,6 +120,8 @@ class SampleSettingTab extends PluginSettingTab {
containerEl.empty(); containerEl.empty();
containerEl.createEl('h2', {text: 'Settings for my awesome plugin.'});
new Setting(containerEl) new Setting(containerEl)
.setName('Setting #1') .setName('Setting #1')
.setDesc('It\'s a secret') .setDesc('It\'s a secret')
@ -127,6 +129,7 @@ class SampleSettingTab extends PluginSettingTab {
.setPlaceholder('Enter your secret') .setPlaceholder('Enter your secret')
.setValue(this.plugin.settings.mySetting) .setValue(this.plugin.settings.mySetting)
.onChange(async (value) => { .onChange(async (value) => {
console.log('Secret: ' + value);
this.plugin.settings.mySetting = value; this.plugin.settings.mySetting = value;
await this.plugin.saveSettings(); await this.plugin.saveSettings();
})); }));

View File

@ -1,9 +1,9 @@
{ {
"id": "sample-plugin", "id": "obsidian-sample-plugin",
"name": "Sample Plugin", "name": "Sample Plugin",
"version": "1.0.0", "version": "1.0.0",
"minAppVersion": "0.15.0", "minAppVersion": "0.15.0",
"description": "Demonstrates some of the capabilities of the Obsidian API.", "description": "This is a sample plugin for Obsidian. This plugin demonstrates some of the capabilities of the Obsidian API.",
"author": "Obsidian", "author": "Obsidian",
"authorUrl": "https://obsidian.md", "authorUrl": "https://obsidian.md",
"fundingUrl": "https://obsidian.md/pricing", "fundingUrl": "https://obsidian.md/pricing",