diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a12c39d..29b53e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,5 @@ ## About - - - [Making contributions](CONTRIBUTING.md) All kinds of Contributing is appreciated, - maintaining the project code base, (more at the section below) - recommending the plugin to your friends and connections, @@ -26,25 +24,26 @@ The repo depends on the latest plugin API (obsidian.d.ts) in Typescript Definiti ### Before you start Feel free to check out -- [Project Todo Column](https://github.com/users/tim-hub/projects/2) -- [Discussion](https://github.com/tim-hub/obsidian-bible-reference/discussions) + +- [Project Todo Column](https://github.com/users/tim-hub/projects/2) +- [Discussion](https://github.com/tim-hub/obsidian-bible-reference/discussions) - [Issues](https://github.com/tim-hub/obsidian-bible-reference/issues) -You can probably get some ideas from there to work on, +You can probably get some ideas from there to work on, and you can also create a new discussion or issue to discuss your ideas. - - ## References + ### Related Projects + - [find bible verse](https://github.com/tim-hub/FindBibleVerse) in development, this is a local node package for querying bible version - [bible name converter](https://github.com/tim-hub/biblejs-name-converter/) Bible JS Name Converter, Normalize bible references, convert them to machine readable formats, query and manipulate them - inspiring - inspired by [obsidian emoji shortcodes](https://github.com/phibr0/obsidian-emoji-shortcodes) - [obsidian sample plugin](https://github.com/obsidianmd/obsidian-sample-plugin) is template repo as obsidian sample plugin - ### Bible API and Bible Source + > This plugin Bible Verse Query Functionality is currently powered by Public Bible API, > Here is about the APIs used here, and what Bible version are supported > diff --git a/README.md b/README.md index 69b62d6..d1243ef 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![CodeQL for Obsidain Bible Reference](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/codeql-analysis.yml) [![Build for Bible Reference Project](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/build.yml/badge.svg)](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/build.yml) [![obsidian bible reference user discussion forum](https://img.shields.io/badge/Discussion-blue)](https://github.com/tim-hub/obsidian-bible-reference/discussions) -[![obsidain bible reference project kanban board and roadmap ](https://img.shields.io/badge/Project(Kanban)-orange)](https://github.com/users/tim-hub/projects/2/views/1) +[![obsidain bible reference project kanban board and roadmap ]()](https://github.com/users/tim-hub/projects/2/views/1) [![support button of obsidian bible reference](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/tim-hub) > These will be very appreciate for the project development. 👍 diff --git a/src/main.ts b/src/main.ts index 44661b4..860fc60 100644 --- a/src/main.ts +++ b/src/main.ts @@ -72,8 +72,8 @@ export default class BibleReferencePlugin extends Plugin { } private async getAndCachedVerseOfDay(): Promise { - const {ttl, timestamp, verseOfDaySuggesting} = - this?.cachedVerseOfDaySuggesting || {} + const { ttl, timestamp, verseOfDaySuggesting } = + this?.cachedVerseOfDaySuggesting || {} if (!verseOfDaySuggesting || timestamp + ttl > Date.now()) { const vodResp = await getVod() const reference = splitBibleReference(vodResp.verse.details.reference) @@ -99,7 +99,7 @@ export default class BibleReferencePlugin extends Plugin { callback: () => { EventStats.logUIOpen( 'lookupModalOpen', - {key: `command-lookup`, value: 1}, + { key: `command-lookup`, value: 1 }, this.settings.optOutToEvents ) this.verseLookUpModal.open() @@ -116,7 +116,7 @@ export default class BibleReferencePlugin extends Plugin { const verse = await this.getAndCachedVerseOfDay() EventStats.logUIOpen( 'vodEditorOpen', - {key: `command-vod`, value: 1}, + { key: `command-vod`, value: 1 }, this.settings.optOutToEvents ) new Notice( @@ -127,7 +127,6 @@ export default class BibleReferencePlugin extends Plugin { ) }, }) - } private addVerseOfDayInsertCommand(): void { @@ -138,7 +137,7 @@ export default class BibleReferencePlugin extends Plugin { const vodSuggesting = await this.getAndCachedVerseOfDay() EventStats.logUIOpen( 'vodEditorOpen', - {key: `command-vod-insert`, value: 1}, + { key: `command-vod-insert`, value: 1 }, this.settings.optOutToEvents ) editor.replaceSelection(vodSuggesting.allFormattedContent) @@ -155,7 +154,7 @@ export default class BibleReferencePlugin extends Plugin { (_evt) => { EventStats.logUIOpen( 'lookupModalOpen', - {key: `ribbon-click`, value: 1}, + { key: `ribbon-click`, value: 1 }, this.settings.optOutToEvents ) this.verseLookUpModal.open() @@ -167,7 +166,7 @@ export default class BibleReferencePlugin extends Plugin { if (this.ribbonButton) { EventStats.logUIOpen( 'lookupModalOpen', - {key: `ribbon-remove`, value: 1}, + { key: `ribbon-remove`, value: 1 }, this.settings.optOutToEvents ) this.ribbonButton.parentNode?.removeChild(this.ribbonButton) diff --git a/src/provider/BaseBibleAPIProvider.ts b/src/provider/BaseBibleAPIProvider.ts index 9165fac..1d7b2ef 100644 --- a/src/provider/BaseBibleAPIProvider.ts +++ b/src/provider/BaseBibleAPIProvider.ts @@ -1,6 +1,6 @@ import { IVerse } from '../interfaces/IVerse' import { Notice } from 'obsidian' -import { EventStats } from './EventStats'; +import { EventStats } from './EventStats' export abstract class BaseBibleAPIProvider { protected _key: string // the version selected @@ -83,7 +83,7 @@ export abstract class BaseBibleAPIProvider { } catch (e) { console.error('error while querying', e) new Notice(`Error while querying ${url}`) - EventStats.logError('errors', {key: url, value: 1}) + EventStats.logError('errors', { key: url, value: 1 }) return await Promise.reject(e) } } diff --git a/src/provider/EventStats.ts b/src/provider/EventStats.ts index d2982a6..1fc141a 100644 --- a/src/provider/EventStats.ts +++ b/src/provider/EventStats.ts @@ -28,7 +28,7 @@ const EVENTS = { // changeBookTagging: '', // changeChapterTagging: '', - errors: '0d3fad56-4293-4691-b810-9a32cd1f6117' + errors: '0d3fad56-4293-4691-b810-9a32cd1f6117', } type VerseLookUp = 'verseLookUp' | 'vodLookUp' @@ -102,14 +102,10 @@ class Logger { } } - async logError( - eventName: 'errors', - actionAttributes: ActionAttributes, - ) { + async logError(eventName: 'errors', actionAttributes: ActionAttributes) { this.fireEvent(this.getEventId(eventName), actionAttributes) } - private async fireEvent( eventId: EventsValues, actionAttributes: ActionAttributes diff --git a/src/provider/FeatureFlag.ts b/src/provider/FeatureFlag.ts index 0ac30bd..bb8530d 100644 --- a/src/provider/FeatureFlag.ts +++ b/src/provider/FeatureFlag.ts @@ -1,5 +1,5 @@ import Flagsmith, { Flags } from 'flagsmith-nodejs' -import { EventStats } from './EventStats'; // Add this line if you're using flagsmith via npm +import { EventStats } from './EventStats' // Add this line if you're using flagsmith via npm const flagsmith = new Flagsmith({ environmentKey: 'NJTKgnNToZxbe6TCksAcmD', @@ -16,7 +16,7 @@ export class FlagService { return FlagService.instance } - public async init(id?:string) { + public async init(id?: string) { if (id) { this.flags = await flagsmith.getIdentityFlags(id) } else { @@ -34,7 +34,7 @@ export class FlagService { return JSON.parse(value as string) } catch (e) { console.error('get feature flag value error') - EventStats.logError('errors', { key:'featureflag', value: 1 }) + EventStats.logError('errors', { key: 'featureflag', value: 1 }) } } } diff --git a/src/suggesetor/VerseEditorSuggester.ts b/src/suggesetor/VerseEditorSuggester.ts index be42967..8f99594 100644 --- a/src/suggesetor/VerseEditorSuggester.ts +++ b/src/suggesetor/VerseEditorSuggester.ts @@ -74,7 +74,10 @@ export class VerseEditorSuggester extends EditorSuggest { ) EventStats.logLookup( 'verseLookUp', - { key: `${this.settings.bibleVersion}-${context.query.toLowerCase()}`, value: 1 }, + { + key: `${this.settings.bibleVersion}-${context.query.toLowerCase()}`, + value: 1, + }, this.settings.optOutToEvents ) return suggestions diff --git a/src/suggesetor/VerseLookupSuggestModal.ts b/src/suggesetor/VerseLookupSuggestModal.ts index 5e7ee05..36df65f 100644 --- a/src/suggesetor/VerseLookupSuggestModal.ts +++ b/src/suggesetor/VerseLookupSuggestModal.ts @@ -30,7 +30,10 @@ export class VerseLookupSuggestModal extends SuggestModal { console.debug('trigger on', query) EventStats.logLookup( 'verseLookUp', - { key: `${this.settings.bibleVersion}-${match.toLowerCase()}`, value: 1 }, + { + key: `${this.settings.bibleVersion}-${match.toLowerCase()}`, + value: 1, + }, this.settings.optOutToEvents ) return getSuggestionsFromQuery(`--${query}`, this.settings) diff --git a/src/ui/BibleReferenceSettingTab.ts b/src/ui/BibleReferenceSettingTab.ts index 4f3c32c..765aa51 100644 --- a/src/ui/BibleReferenceSettingTab.ts +++ b/src/ui/BibleReferenceSettingTab.ts @@ -26,7 +26,7 @@ import { import { FlagService } from '../provider/FeatureFlag' import { BibleAPISourceCollection } from '../data/BibleApiSourceCollection' import { EventStats } from '../provider/EventStats' -import { APP_NAMING } from '../data/constants'; +import { APP_NAMING } from '../data/constants' export class BibleReferenceSettingTab extends PluginSettingTab { plugin: BibleReferencePlugin