Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:30:02 +08:00
commit 0df90b9bdc
29 changed files with 2639 additions and 0 deletions

28
commands/add-settings.md Normal file
View File

@@ -0,0 +1,28 @@
You are helping the user add settings to their Obsidian plugin.
1. Ask the user what settings they need:
- Text inputs (API keys, paths, etc.)
- Number inputs (limits, thresholds)
- Toggles (boolean options)
- Dropdowns (predefined choices)
- Sliders (ranged values)
2. Update the plugin structure:
- Add settings interface with proper types
- Update DEFAULT_SETTINGS constant
- Add settings tab class extending PluginSettingTab
- Register the settings tab in onload()
- Implement display() method with Setting components
3. Implement setting controls using Obsidian's Setting API:
- addText() for text inputs
- addToggle() for boolean switches
- addDropdown() for select options
- addSlider() for numeric ranges
- addTextArea() for multi-line input
4. Ensure proper saving/loading:
- Call saveSettings() onChange
- Use proper TypeScript types
Reference the instruct plugin for comprehensive settings examples.