generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
}, | ||
"dependencies": { | ||
"@electron/remote": "2.1.2", | ||
"ignore": "^5.3.2", | ||
"obsidian": "^1.6.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { type App, PluginSettingTab, Setting } from "obsidian"; | ||
import type GraphBannerPlugin from "./main"; | ||
|
||
export interface Settings { | ||
ignore: string[]; | ||
} | ||
|
||
export const DEFAULT_SETTINGS: Settings = { | ||
ignore: [], | ||
}; | ||
|
||
export class SettingTab extends PluginSettingTab { | ||
plugin: GraphBannerPlugin; | ||
|
||
constructor(app: App, plugin: GraphBannerPlugin) { | ||
super(app, plugin); | ||
this.plugin = plugin; | ||
} | ||
|
||
display() { | ||
const { containerEl } = this; | ||
|
||
containerEl.empty(); | ||
|
||
new Setting(containerEl) | ||
.setName("Ignored Path Pattern") | ||
.setDesc( | ||
"Manage notes which do not display the graph banner. This pattern follows .gitignore spec.", | ||
) | ||
.addTextArea((textArea) => | ||
textArea | ||
.setPlaceholder( | ||
"ignored-path.md\n/ignored-dir\n!/ignored-dir/not-ignored-path.md", | ||
) | ||
.setValue(this.plugin.settings.ignore.join("\n")) | ||
.onChange(async (value) => { | ||
this.plugin.settings.ignore = value.split("\n"); | ||
await this.plugin.saveData(this.plugin.settings); | ||
}), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters