6 + 7 - Added a bunch more settings for customizing the formatted passages and updated the README to reflect the changes made in issue 7.

This commit is contained in:
Caleb Campbell
2025-12-20 15:55:56 +11:00
parent aeaaaf55b8
commit b71a31792b
8 changed files with 202 additions and 31 deletions

23
main.ts
View File

@@ -1,8 +1,8 @@
import { Plugin } from 'obsidian';
import LocalBibleRefSettingTab, { BibleFormat } from 'src/local-bible-ref-setting-tab';
import { PassageFormat } from 'src/passage-reference';
import { PassageSuggest } from 'src/passage-suggest';
import { LocalBibleRefSettings } from 'src/settings';
import PassageSuggest from 'src/passage-suggest';
import LocalBibleRefSettings, { CalloutType, QuoteReferencePosition } from 'src/settings';
export default class LocalBibleRefPlugin extends Plugin {
settings: LocalBibleRefSettings;
@@ -17,12 +17,31 @@ export default class LocalBibleRefPlugin extends Plugin {
async loadSettings() {
this.settings = await this.loadData();
const quoteSettings = {
includeReference: true,
referencePosition: QuoteReferencePosition.End,
linkToPassage: true,
};
const calloutSettings = {
type: CalloutType.Quote,
linkToPassage: true,
};
this.settings ??= {
biblesPath: '',
defaultVersionShorthand: '',
defaultPassageFormat: PassageFormat.Callout,
bibleFormat: BibleFormat.LocalBibleRef,
quote: quoteSettings,
callout: calloutSettings,
};
if (!this.settings.quote) this.settings.quote = quoteSettings;
if (!this.settings.callout) this.settings.callout = calloutSettings;
await this.saveSettings();
}
async saveSettings() {