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:
23
main.ts
23
main.ts
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user