From 054744e35b002e05425d9f4873795350fef748b5 Mon Sep 17 00:00:00 2001 From: Caleb Campbell Date: Fri, 26 Dec 2025 09:43:29 +1100 Subject: [PATCH] 3 - Added Prettier for formatting and formatted. --- .github/workflows/release.yml | 6 +- .prettierrc.yml | 4 + README.md | 18 +- esbuild.config.mjs | 54 ++-- main.ts | 11 +- package-lock.json | 161 ++++-------- package.json | 4 +- src/books/books.de.ts | 70 ------ src/books/books.en.ts | 244 ------------------ src/i18n/de/books.ts | 142 ++++++----- src/i18n/de/index.ts | 7 + src/i18n/de/settings.ts | 127 +++++----- src/i18n/en/books.ts | 276 +++++++++++++++----- src/i18n/en/index.ts | 10 +- src/i18n/en/settings.ts | 129 +++++----- src/i18n/index.ts | 8 +- src/i18n/models.ts | 18 +- src/local-bible-ref-setting-tab.ts | 392 ++++++++++++++++------------- src/passage-reference.ts | 57 +++-- src/passage-suggest.ts | 131 +++++----- src/path-suggest.ts | 44 ++-- src/settings.ts | 62 ++--- src/version-suggest.ts | 52 ++-- styles.css | 4 +- tsconfig.json | 37 ++- version-bump.mjs | 10 +- 26 files changed, 955 insertions(+), 1123 deletions(-) create mode 100644 .prettierrc.yml delete mode 100644 src/books/books.de.ts delete mode 100644 src/books/books.en.ts create mode 100644 src/i18n/de/index.ts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 350e329..c945a00 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release Obsidian plugin on: push: tags: - - "*" + - '*' jobs: build: @@ -16,7 +16,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: "18.x" + node-version: '18.x' - name: Build plugin run: | @@ -32,4 +32,4 @@ jobs: gh release create "$tag" \ --title="$tag" \ --draft \ - main.js manifest.json styles.css \ No newline at end of file + main.js manifest.json styles.css diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..b53f47a --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,4 @@ +singleQuote: true +tabWidth: 2 +trailingComma: 'es5' +useTabs: true diff --git a/README.md b/README.md index a4e3939..56d0ad3 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,21 @@ Quickly and easily reference Bible passages stored locally in your vault. ### Inspiration -This plugin takes heavy inspiration from the [Bible Reference](https://github.com/tim-hub/obsidian-bible-reference) and [Bible Linker](https://github.com/kuchejak/obsidian-bible-linker-plugin) plugins - please check them out! I've been using the *Bible Reference* plugin for a while (which has been great) and I love the simplicity of referencing passages using the `--` prefix. I also loved the idea of storing a Bible locally because then I can reference Bible passages even when I'm offline, as well as use my vault Bible for reading. Unfortunately, the markdown format of the *Bible Linker* local Bible is not great for reading, and I prefer the simplicity of using the `--` prefix to fetch Bible passages. There's also some referencing limitations in the *Bible Reference* plugin and occasionally some odd additions to passages returned from the [Boll's Life](https://bolls.life/) API. So, this is an amalgamation of those two plugins. +This plugin takes heavy inspiration from the [Bible Reference](https://github.com/tim-hub/obsidian-bible-reference) and [Bible Linker](https://github.com/kuchejak/obsidian-bible-linker-plugin) plugins - please check them out! I've been using the _Bible Reference_ plugin for a while (which has been great) and I love the simplicity of referencing passages using the `--` prefix. I also loved the idea of storing a Bible locally because then I can reference Bible passages even when I'm offline, as well as use my vault Bible for reading. Unfortunately, the markdown format of the _Bible Linker_ local Bible is not great for reading, and I prefer the simplicity of using the `--` prefix to fetch Bible passages. There's also some referencing limitations in the _Bible Reference_ plugin and occasionally some odd additions to passages returned from the [Boll's Life](https://bolls.life/) API. So, this is an amalgamation of those two plugins. ### Getting Started To start with, you will need to format a Bible for your own vault. -If you would like to use your vault Bible for reading, I would encourage you to format it in the original *Local Bible Ref* format. Some instructions on this can be found [below](#bible-markdown-format). I've also already formatted the Public Domain World English Bible so you can [download](https://github.com/camelChief/markdown-webp) that and just get started. If you don't want to go to all that hassle, you can use your existing *Bible Linker* Bible with this plugin! In order to do that, simply select "Bible Linker" as your Bible format in the *Local Bible Ref* settings. +If you would like to use your vault Bible for reading, I would encourage you to format it in the original _Local Bible Ref_ format. Some instructions on this can be found [below](#bible-markdown-format). I've also already formatted the Public Domain World English Bible so you can [download](https://github.com/camelChief/markdown-webp) that and just get started. If you don't want to go to all that hassle, you can use your existing _Bible Linker_ Bible with this plugin! In order to do that, simply select "Bible Linker" as your Bible format in the _Local Bible Ref_ settings. -Once you've done that, open up the *Local Bible Ref* settings and fill in at least the *Bibles path* field. Then, to use the plugin, simply open a new note and use the `--` reference prefix to grab a passage of scripture. There are also additional options (similar to terminal command options) you can provide to the reference to indicate which version to use and what markdown format to display the passage in. More information can be found [below](#usage). +Once you've done that, open up the _Local Bible Ref_ settings and fill in at least the _Bibles path_ field. Then, to use the plugin, simply open a new note and use the `--` reference prefix to grab a passage of scripture. There are also additional options (similar to terminal command options) you can provide to the reference to indicate which version to use and what markdown format to display the passage in. More information can be found [below](#usage). ## Usage ### References -In order to fetch a Bible passage, simply type in a Bible reference prefixed with `--`: `--John 1:1`. *Local Bible Ref* currently supports Bible references in the form: +In order to fetch a Bible passage, simply type in a Bible reference prefixed with `--`: `--John 1:1`. _Local Bible Ref_ currently supports Bible references in the form: - Single verse: `--gen1:1` - Multi verse: `--gen1:1-3` @@ -33,19 +33,19 @@ In order to fetch a Bible passage, simply type in a Bible reference prefixed wit The referencing syntax also allows for a lot of flexibility: - Short and full name references: `--gen1` + `--genesis1` -- Lowercase, uppercase and mixed-case references: ``--gEnEsis1`` +- Lowercase, uppercase and mixed-case references: `--gEnEsis1` - Spacing (not more than a single space): `-- Genesis 1:1 - 2:2` ### Options -*Local Bible Ref* also allows you to provide a few options to a reference to specify which version you would like to use as well as what markdown format to use. Add an option to a reference by adding a `+` followed by the option (in any order): `--gen1:1-5+esv` +_Local Bible Ref_ also allows you to provide a few options to a reference to specify which version you would like to use as well as what markdown format to use. Add an option to a reference by adding a `+` followed by the option (in any order): `--gen1:1-5+esv` You can also pass multiple options by simply chaining them: `-- John 1:1 +quote +esv` Syntax: `--[+