mirror of
https://github.com/kdnk/obsidian-automatic-linker.git
synced 2026-07-22 12:00:30 +00:00
chore: add excludeDirsFromAutoLinking setting
This commit is contained in:
parent
ff22faa7e9
commit
ddd15b5322
2 changed files with 26 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ export type AutomaticLinkerSettings = {
|
|||
ignoreCase: boolean; // Ignore case when matching links
|
||||
replaceUrlWithTitle: boolean; // Replace raw URLs with [Title](URL)
|
||||
replaceUrlWithTitleIgnoreDomains: string[]; // List of domains to ignore when replacing URLs with titles
|
||||
excludeDirsFromAutoLinking: string[]; // Optional: List of directories to exclude from auto-linking
|
||||
};
|
||||
|
||||
export const DEFAULT_SETTINGS: AutomaticLinkerSettings = {
|
||||
|
|
@ -34,4 +35,5 @@ export const DEFAULT_SETTINGS: AutomaticLinkerSettings = {
|
|||
ignoreCase: false, // Default: case-sensitive matching
|
||||
replaceUrlWithTitle: false, // Default: disable replacing URLs with titles
|
||||
replaceUrlWithTitleIgnoreDomains: [],
|
||||
excludeDirsFromAutoLinking: [], // Default: no excluded directories
|
||||
};
|
||||
|
|
|
|||
|
|
@ -243,6 +243,30 @@ export class AutomaticLinkerPluginSettingsTab extends PluginSettingTab {
|
|||
});
|
||||
});
|
||||
|
||||
// Add excluding dirs that you wish to exclude from the automatic linking
|
||||
new Setting(containerEl)
|
||||
.setName("Exclude directories from automatic linking")
|
||||
.setDesc(
|
||||
"Directories to be excluded from automatic linking, one per line (e.g., 'Templates')",
|
||||
)
|
||||
.addTextArea((text) => {
|
||||
text.setPlaceholder("")
|
||||
.setValue(
|
||||
this.plugin.settings.excludeDirsFromAutoLinking.join(
|
||||
"\n",
|
||||
),
|
||||
)
|
||||
.onChange(async (value) => {
|
||||
// Split by newlines and filter out empty lines
|
||||
const dirs = value
|
||||
.split("\n")
|
||||
.map((dir) => dir.trim())
|
||||
.filter(Boolean);
|
||||
this.plugin.settings.excludeDirsFromAutoLinking = dirs;
|
||||
await this.plugin.saveData(this.plugin.settings);
|
||||
});
|
||||
})
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Igonre domains")
|
||||
.setDesc(
|
||||
|
|
|
|||
Loading…
Reference in a new issue