967 B
967 B
You are helping the user add settings to their Obsidian plugin.
-
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)
-
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
-
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
-
Ensure proper saving/loading:
- Call saveSettings() onChange
- Use proper TypeScript types
Reference the instruct plugin for comprehensive settings examples.