3 - Added Prettier for formatting and formatted.

This commit is contained in:
Caleb Campbell
2025-12-26 09:43:29 +11:00
parent 0275b5a439
commit 054744e35b
26 changed files with 955 additions and 1123 deletions

View File

@@ -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: |

4
.prettierrc.yml Normal file
View File

@@ -0,0 +1,4 @@
singleQuote: true
tabWidth: 2
trailingComma: 'es5'
useTabs: true

View File

@@ -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: `--<reference>[+<option>]...`
| Option | Usage | Example |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `manuscript`, `m` | Specifies that the passage should be displayed in "manuscript" format (without chapter numbers, verse numbers or other formatting like newlines). | ![localBibleRef3](https://github.com/user-attachments/assets/736e38e3-f05e-41c0-9d0a-d27145e50e30) |
| `paragraph`, `p` | Specifies that the passage should be displayed in a standard paragraph. | ![localBibleRef4](https://github.com/user-attachments/assets/d62dc0f0-4d4b-4468-b53a-b87a2f3b5384) |
| `quote`, `q` | Specifies that the passage should be displayed in [quote](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#Quotes) format. | ![localBibleRef5](https://github.com/user-attachments/assets/59cd0a61-de28-4c51-ac38-9faf71c2e391) |
@@ -54,7 +54,7 @@ Syntax: `--<reference>[+<option>]...`
## Bible Markdown Format
The Bible markdown format required for this plugin is slightly more complex than the format used for the *Bible Linker* plugin. I chose this particular format because it makes the Bible much nicer to read if you simply wanted to use your vault Bible for reading (as I do). It looks something like this:
The Bible markdown format required for this plugin is slightly more complex than the format used for the _Bible Linker_ plugin. I chose this particular format because it makes the Bible much nicer to read if you simply wanted to use your vault Bible for reading (as I do). It looks something like this:
![localBibleRef2](https://github.com/user-attachments/assets/e5fc4ca1-bc9d-4fbb-b20c-e94c693d0660)

View File

@@ -1,43 +1,43 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import esbuild from 'esbuild';
import process from 'process';
import builtins from 'builtin-modules';
const banner =
`/*
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
`;
const prod = (process.argv[2] === "production");
const prod = process.argv[2] === 'production';
const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts"],
entryPoints: ['main.ts'],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
'obsidian',
'electron',
'@codemirror/autocomplete',
'@codemirror/collab',
'@codemirror/commands',
'@codemirror/language',
'@codemirror/lint',
'@codemirror/search',
'@codemirror/state',
'@codemirror/view',
'@lezer/common',
'@lezer/highlight',
'@lezer/lr',
...builtins,
],
format: 'cjs',
target: 'es2018',
logLevel: 'info',
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: "main.js",
outfile: 'main.js',
});
if (prod) {

View File

@@ -1,8 +1,13 @@
import { Plugin } from 'obsidian';
import LocalBibleRefSettingTab, { BibleFormat } from 'src/local-bible-ref-setting-tab';
import LocalBibleRefSettingTab, {
BibleFormat,
} from 'src/local-bible-ref-setting-tab';
import { PassageFormat } from 'src/passage-reference';
import PassageSuggest from 'src/passage-suggest';
import LocalBibleRefSettings, { CalloutType, QuoteReferencePosition } from 'src/settings';
import LocalBibleRefSettings, {
CalloutType,
QuoteReferencePosition,
} from 'src/settings';
export default class LocalBibleRefPlugin extends Plugin {
settings: LocalBibleRefSettings;

161
package-lock.json generated
View File

@@ -14,7 +14,8 @@
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"obsidian": "^1.8.7",
"obsidian": "latest",
"prettier": "^3.7.4",
"tslib": "2.4.0",
"typescript": "4.7.4"
}
@@ -402,7 +403,6 @@
"integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"eslint-visitor-keys": "^3.4.3"
},
@@ -422,7 +422,6 @@
"integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
@@ -433,7 +432,6 @@
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
@@ -458,7 +456,6 @@
"integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
@@ -470,7 +467,6 @@
"deprecated": "Use @eslint/config-array instead",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@humanwhocodes/object-schema": "^2.0.3",
"debug": "^4.3.1",
@@ -486,7 +482,6 @@
"integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=12.22"
},
@@ -501,16 +496,14 @@
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
"deprecated": "Use @eslint/object-schema instead",
"dev": true,
"license": "BSD-3-Clause",
"peer": true
"license": "BSD-3-Clause"
},
"node_modules/@marijn/find-cluster-break": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz",
"integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
@@ -621,6 +614,7 @@
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.29.0.tgz",
"integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==",
"dev": true,
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "5.29.0",
"@typescript-eslint/types": "5.29.0",
@@ -772,8 +766,7 @@
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
"integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/acorn": {
"version": "8.15.0",
@@ -795,7 +788,6 @@
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true,
"license": "MIT",
"peer": true,
"peerDependencies": {
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
@@ -806,7 +798,6 @@
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -824,7 +815,6 @@
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -835,7 +825,6 @@
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"color-convert": "^2.0.1"
},
@@ -851,8 +840,7 @@
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true,
"license": "Python-2.0",
"peer": true
"license": "Python-2.0"
},
"node_modules/array-union": {
"version": "2.1.0",
@@ -868,8 +856,7 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.12",
@@ -877,7 +864,6 @@
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -913,7 +899,6 @@
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=6"
}
@@ -924,7 +909,6 @@
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
@@ -942,7 +926,6 @@
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"color-name": "~1.1.4"
},
@@ -955,24 +938,21 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/crelt": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/cross-spawn": {
"version": "7.0.6",
@@ -980,7 +960,6 @@
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -1012,8 +991,7 @@
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/dir-glob": {
"version": "3.0.1",
@@ -1033,7 +1011,6 @@
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"esutils": "^2.0.2"
},
@@ -1084,7 +1061,6 @@
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=10"
},
@@ -1208,7 +1184,6 @@
"integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"dependencies": {
"esrecurse": "^4.3.0",
"estraverse": "^5.2.0"
@@ -1226,7 +1201,6 @@
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"engines": {
"node": ">=4.0"
}
@@ -1237,7 +1211,6 @@
"integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"is-glob": "^4.0.3"
},
@@ -1251,7 +1224,6 @@
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"dependencies": {
"acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
@@ -1270,7 +1242,6 @@
"integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==",
"dev": true,
"license": "BSD-3-Clause",
"peer": true,
"dependencies": {
"estraverse": "^5.1.0"
},
@@ -1284,7 +1255,6 @@
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"engines": {
"node": ">=4.0"
}
@@ -1325,7 +1295,6 @@
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -1335,8 +1304,7 @@
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/fast-glob": {
"version": "3.3.2",
@@ -1359,16 +1327,14 @@
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/fastq": {
"version": "1.17.1",
@@ -1385,7 +1351,6 @@
"integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"flat-cache": "^3.0.4"
},
@@ -1411,7 +1376,6 @@
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"locate-path": "^6.0.0",
"path-exists": "^4.0.0"
@@ -1429,7 +1393,6 @@
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"flatted": "^3.2.9",
"keyv": "^4.5.3",
@@ -1444,16 +1407,14 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/functional-red-black-tree": {
"version": "1.0.1",
@@ -1468,7 +1429,6 @@
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -1502,7 +1462,6 @@
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"type-fest": "^0.20.2"
},
@@ -1538,8 +1497,7 @@
"resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/has-flag": {
"version": "4.0.0",
@@ -1547,7 +1505,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -1567,7 +1524,6 @@
"integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
@@ -1585,7 +1541,6 @@
"integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.8.19"
}
@@ -1597,7 +1552,6 @@
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
@@ -1608,8 +1562,7 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/is-extglob": {
"version": "2.1.1",
@@ -1647,7 +1600,6 @@
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -1657,8 +1609,7 @@
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/js-yaml": {
"version": "4.1.0",
@@ -1666,7 +1617,6 @@
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"argparse": "^2.0.1"
},
@@ -1679,24 +1629,21 @@
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/keyv": {
"version": "4.5.4",
@@ -1704,7 +1651,6 @@
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"json-buffer": "3.0.1"
}
@@ -1715,7 +1661,6 @@
"integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"prelude-ls": "^1.2.1",
"type-check": "~0.4.0"
@@ -1730,7 +1675,6 @@
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"p-locate": "^5.0.0"
},
@@ -1746,8 +1690,7 @@
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/merge2": {
"version": "1.4.1",
@@ -1777,7 +1720,6 @@
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"brace-expansion": "^1.1.7"
},
@@ -1805,8 +1747,7 @@
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/obsidian": {
"version": "1.8.7",
@@ -1829,7 +1770,6 @@
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"wrappy": "1"
}
@@ -1840,7 +1780,6 @@
"integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"deep-is": "^0.1.3",
"fast-levenshtein": "^2.0.6",
@@ -1859,7 +1798,6 @@
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"yocto-queue": "^0.1.0"
},
@@ -1876,7 +1814,6 @@
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"p-limit": "^3.0.2"
},
@@ -1893,7 +1830,6 @@
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"callsites": "^3.0.0"
},
@@ -1907,7 +1843,6 @@
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -1918,7 +1853,6 @@
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -1929,7 +1863,6 @@
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -1961,18 +1894,32 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/prettier": {
"version": "3.7.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz",
"integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=6"
}
@@ -2015,7 +1962,6 @@
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=4"
}
@@ -2037,7 +1983,6 @@
"deprecated": "Rimraf versions prior to v4 are no longer supported",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"glob": "^7.1.3"
},
@@ -2089,7 +2034,6 @@
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"shebang-regex": "^3.0.0"
},
@@ -2103,7 +2047,6 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
}
@@ -2123,7 +2066,6 @@
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
@@ -2137,7 +2079,6 @@
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
},
@@ -2150,8 +2091,7 @@
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz",
"integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/supports-color": {
"version": "7.2.0",
@@ -2159,7 +2099,6 @@
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"has-flag": "^4.0.0"
},
@@ -2172,8 +2111,7 @@
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/to-regex-range": {
"version": "5.0.1",
@@ -2220,7 +2158,6 @@
"integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"prelude-ls": "^1.2.1"
},
@@ -2234,7 +2171,6 @@
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
"dev": true,
"license": "(MIT OR CC0-1.0)",
"peer": true,
"engines": {
"node": ">=10"
},
@@ -2247,6 +2183,7 @@
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"dev": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -2261,7 +2198,6 @@
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
"license": "BSD-2-Clause",
"peer": true,
"dependencies": {
"punycode": "^2.1.0"
}
@@ -2271,8 +2207,7 @@
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/which": {
"version": "2.0.2",
@@ -2280,7 +2215,6 @@
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"license": "ISC",
"peer": true,
"dependencies": {
"isexe": "^2.0.0"
},
@@ -2297,7 +2231,6 @@
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -2307,8 +2240,7 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true,
"license": "ISC",
"peer": true
"license": "ISC"
},
"node_modules/yocto-queue": {
"version": "0.1.0",
@@ -2316,7 +2248,6 @@
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=10"
},

View File

@@ -6,7 +6,8 @@
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json"
"version": "node version-bump.mjs && git add manifest.json versions.json",
"format": "prettier --write ."
},
"keywords": [],
"author": "Caleb Campbell",
@@ -18,6 +19,7 @@
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"obsidian": "latest",
"prettier": "^3.7.4",
"tslib": "2.4.0",
"typescript": "4.7.4"
}

View File

@@ -1,70 +0,0 @@
import { Book } from "./books.en";
export const BOOKS_DE: Book[] = [
{ name: "1. Mose", aliases: ["Genesis", "Gen", "1Mo"] },
{ name: "2. Mose", aliases: ["Exodus", "Ex", "2Mo"] },
{ name: "3. Mose", aliases: ["Levitikus", "Lev", "3Mo"] },
{ name: "4. Mose", aliases: ["Numeri", "Num", "4Mo"] },
{ name: "5. Mose", aliases: ["Deuteronomium", "Dtn", "5Mo"] },
{ name: "Josua", aliases: ["Jos", "Jos"] },
{ name: "Richter", aliases: ["Ri", "Richt"] },
{ name: "Rut", aliases: ["Rut", "Ru"] },
{ name: "1. Samuel", aliases: ["1Sam", "1Sa"] },
{ name: "2. Samuel", aliases: ["2Sam", "2Sa"] },
{ name: "1. Könige", aliases: ["1Kön", "1Kö"] },
{ name: "2. Könige", aliases: ["2Kön", "2Kö"] },
{ name: "1. Chronik", aliases: ["1Chr", "1Ch"] },
{ name: "2. Chronik", aliases: ["2Chr", "2Ch"] },
{ name: "Esra", aliases: ["Esr", "Esr"] },
{ name: "Nehemia", aliases: ["Neh", "Neh"] },
{ name: "Ester", aliases: ["Esther", "Est", "Est"] },
{ name: "Ijob", aliases: ["Hiob", "Ijob", "Hi"] },
{ name: "Psalmen", aliases: ["Psalter", "Ps"] },
{ name: "Sprüche", aliases: ["Sprüche Salomos", "Spr"] },
{ name: "Kohelet", aliases: ["Prediger", "Koh", "Pred"] },
{ name: "Hoheslied", aliases: ["Lied der Lieder", "Hld", "Hl"] },
{ name: "Jesaja", aliases: ["Jes"] },
{ name: "Jeremia", aliases: ["Jer"] },
{ name: "Klagelieder", aliases: ["Threni", "Klgl", "Kla"] },
{ name: "Ezechiel", aliases: ["Hesekiel", "Ez", "Hes"] },
{ name: "Daniel", aliases: ["Dan"] },
{ name: "Hosea", aliases: ["Hos", "Hos"] },
{ name: "Joel", aliases: ["Joe"] },
{ name: "Amos", aliases: ["Am", "Amos"] },
{ name: "Obadja", aliases: ["Ob", "Oba"] },
{ name: "Jona", aliases: ["Jon"] },
{ name: "Micha", aliases: ["Mi", "Mic"] },
{ name: "Nahum", aliases: ["Nah"] },
{ name: "Habakuk", aliases: ["Hab", "Hab"] },
{ name: "Zefanja", aliases: ["Zephanja", "Zef", "Zeph"] },
{ name: "Haggai", aliases: ["Hag"] },
{ name: "Sacharja", aliases: ["Sach"] },
{ name: "Maleachi", aliases: ["Mal"] },
{ name: "Matthäus", aliases: ["Mt"] },
{ name: "Markus", aliases: ["Mk"] },
{ name: "Lukas", aliases: ["Lk"] },
{ name: "Johannes", aliases: ["Joh"] },
{ name: "Apostelgeschichte", aliases: ["Taten der Apostel", "Apg"] },
{ name: "Römer", aliases: ["Röm", "Rö"] },
{ name: "1. Korinther", aliases: ["1Kor", "1Ko"] },
{ name: "2. Korinther", aliases: ["2Kor", "2Ko"] },
{ name: "Galater", aliases: ["Gal", "Gal"] },
{ name: "Epheser", aliases: ["Eph", "Eph"] },
{ name: "Philipper", aliases: ["Phil"] },
{ name: "Kolosser", aliases: ["Kol"] },
{ name: "1. Thessalonicher", aliases: ["1Thes", "1Th"] },
{ name: "2. Thessalonicher", aliases: ["2Thes", "2Th"] },
{ name: "1. Timotheus", aliases: ["1Tim", "1Ti"] },
{ name: "2. Timotheus", aliases: ["2Tim", "2Ti"] },
{ name: "Titus", aliases: ["Tit"] },
{ name: "Philemon", aliases: ["Phlm", "Phm"] },
{ name: "Hebräer", aliases: ["Hebr", "Heb"] },
{ name: "Jakobus", aliases: ["Jak", "Jak"] },
{ name: "1. Petrus", aliases: ["1Pet", "1Pe"] },
{ name: "2. Petrus", aliases: ["2Pet", "2Pe"] },
{ name: "1. Johannes", aliases: ["1Joh", "1Jo"] },
{ name: "2. Johannes", aliases: ["2Joh", "2Jo"] },
{ name: "3. Johannes", aliases: ["3Joh", "3Jo"] },
{ name: "Judas", aliases: ["Jud"] },
{ name: "Offenbarung", aliases: ["Apokalypse", "Off", "Apk"] },
];

View File

@@ -1,244 +0,0 @@
export interface Book {
name: string;
aliases: string[];
}
export const BOOKS_EN: Book[] = [
{ name: "Genesis", aliases: ["gen"] },
{ name: "Exodus", aliases: ["exo", "ex", "exod"] },
{ name: "Leviticus", aliases: ["lev"] },
{ name: "Numbers", aliases: ["num"] },
{ name: "Deuteronomy", aliases: ["deu", "deut"] },
{ name: "Joshua", aliases: ["jos", "josh"] },
{ name: "Judges", aliases: ["jdg", "judg"] },
{ name: "Ruth", aliases: ["rut"] },
{
name: "1 Samuel",
aliases: [
"1sa",
"1samuel",
"1 sam",
"1st sam",
"1st samuel",
"first samuel"
]
},
{
name: "2 Samuel",
aliases: [
"2sa",
"2samuel",
"2 sam",
"2nd sam",
"2nd samuel",
"second samuel"
]
},
{
name: "1 Kings",
aliases: [
"1ki",
"1kings",
"1 kgs",
"1st kgs",
"1st kings",
"first kings"
]
},
{
name: "2 Kings",
aliases: [
"2ki",
"2kings",
"2 kgs",
"2nd kgs",
"2nd kings",
"second kings"
]
},
{
name: "1 Chronicles",
aliases: [
"1ch",
"1chronicles",
"1 chr",
"1st chr",
"1st chronicles",
"first chronicles"
]
},
{
name: "2 Chronicles",
aliases: [
"2ch",
"2chronicles",
"2 chr",
"2nd chr",
"2nd chronicles",
"second chronicles"
]
},
{ name: "Ezra", aliases: ["ezr"] },
{ name: "Nehemiah", aliases: ["neh"] },
{ name: "Esther", aliases: ["est", "esth"] },
{ name: "Job", aliases: ["job"] },
{ name: "Psalms", aliases: ["psa", "ps", "psalm"] },
{ name: "Proverbs", aliases: ["pro", "prov"] },
{ name: "Ecclesiastes", aliases: ["ecc", "eccl"] },
{
name: "Song of Songs",
aliases: [
"sng",
"Song of Solomon",
"song"
]
},
{ name: "Isaiah", aliases: ["isa"] },
{ name: "Jeremiah", aliases: ["jer"] },
{ name: "Lamentations", aliases: ["lam"] },
{ name: "Ezekiel", aliases: ["ezk", "ezek"] },
{ name: "Daniel", aliases: ["dan"] },
{ name: "Hosea", aliases: ["hos"] },
{ name: "Joel", aliases: ["jol"] },
{ name: "Amos", aliases: ["amo"] },
{ name: "Obadiah", aliases: ["oba", "obad"] },
{ name: "Jonah", aliases: ["jon"] },
{ name: "Micah", aliases: ["mic"] },
{ name: "Nahum", aliases: ["nam"] },
{ name: "Habakkuk", aliases: ["hab"] },
{ name: "Zephaniah", aliases: ["zep", "zeph"] },
{ name: "Haggai", aliases: ["hag"] },
{ name: "Zechariah", aliases: ["zec", "zech"] },
{ name: "Malachi", aliases: ["mal"] },
{ name: "Matthew", aliases: ["mat", "matt"] },
{ name: "Mark", aliases: ["mrk"] },
{ name: "Luke", aliases: ["luk"] },
{ name: "John", aliases: ["jhn"] },
{ name: "Acts", aliases: ["act"] },
{ name: "Romans", aliases: ["rom"] },
{
name: "1 Corinthians",
aliases: [
"1co",
"1corinthians",
"1 cor",
"1st cor",
"1st corinthians",
"first corinthians"
]
},
{
name: "2 Corinthians",
aliases: [
"2co",
"2corinthians",
"2 cor",
"2nd cor",
"2nd corinthians",
"second corinthians"
]
},
{ name: "Galatians", aliases: ["gal"] },
{ name: "Ephesians", aliases: ["eph"] },
{ name: "Philippians", aliases: ["php", "phil"] },
{ name: "Colossians", aliases: ["col"] },
{
name: "1 Thessalonians",
aliases: [
"1th",
"1thessalonians",
"1 thess",
"1st thess",
"1st thessalonians",
"first thessalonians"
]
},
{
name: "2 Thessalonians",
aliases: [
"2th",
"2thessalonians",
"2 thess",
"2nd thess",
"2nd thessalonians",
"second thessalonians"
]
},
{
name: "1 Timothy",
aliases: [
"1ti",
"1timothy",
"1 tim",
"1st tim",
"1st timothy",
"first timothy"
]
},
{
name: "2 Timothy",
aliases: [
"2ti",
"2timothy",
"2 tim",
"2nd tim",
"2nd timothy",
"second timothy"
]
},
{ name: "Titus", aliases: ["tit"] },
{ name: "Philemon", aliases: ["phm", "phlm"] },
{ name: "Hebrews", aliases: ["heb"] },
{ name: "James", aliases: ["jas"] },
{
name: "1 Peter",
aliases: [
"1pe",
"1peter",
"1 pet",
"1st pet",
"1st peter",
"first peter"
]
},
{
name: "2 Peter",
aliases: [
"2pe",
"2peter",
"2 pet",
"2nd pet",
"2nd peter",
"second peter"
]
},
{
name: "1 John",
aliases: [
"1jn",
"1john",
"1st john",
"first john"
]
},
{
name: "2 John",
aliases: [
"2jn",
"2john",
"2nd john",
"second john"
]
},
{
name: "3 John",
aliases: [
"3jn",
"3john",
"3rd john",
"third john"
]
},
{ name: "Jude", aliases: ["jud"] },
{ name: "Revelation", aliases: ["rev"] },
];

View File

@@ -1,70 +1,74 @@
import { Book } from "../models";
import { Book } from '../models';
export const BOOKS_DE: Book[] = [
{ id: "gen", name: "1. Mose", aliases: ["Genesis", "Gen", "1Mo"] },
{ id: "exo", name: "2. Mose", aliases: ["Exodus", "Ex", "2Mo"] },
{ id: "lev", name: "3. Mose", aliases: ["Levitikus", "Lev", "3Mo"] },
{ id: "num", name: "4. Mose", aliases: ["Numeri", "Num", "4Mo"] },
{ id: "deu", name: "5. Mose", aliases: ["Deuteronomium", "Dtn", "5Mo"] },
{ id: "jos", name: "Josua", aliases: ["Jos", "Jos"] },
{ id: "jdg", name: "Richter", aliases: ["Ri", "Richt"] },
{ id: "rut", name: "Rut", aliases: ["Rut", "Ru"] },
{ id: "1sa", name: "1. Samuel", aliases: ["1Sam", "1Sa"] },
{ id: "2sa", name: "2. Samuel", aliases: ["2Sam", "2Sa"] },
{ id: "1ki", name: "1. Könige", aliases: ["1Kön", "1Kö"] },
{ id: "2ki", name: "2. Könige", aliases: ["2Kön", "2Kö"] },
{ id: "1ch", name: "1. Chronik", aliases: ["1Chr", "1Ch"] },
{ id: "2ch", name: "2. Chronik", aliases: ["2Chr", "2Ch"] },
{ id: "ezr", name: "Esra", aliases: ["Esr", "Esr"] },
{ id: "neh", name: "Nehemia", aliases: ["Neh", "Neh"] },
{ id: "est", name: "Ester", aliases: ["Esther", "Est", "Est"] },
{ id: "job", name: "Ijob", aliases: ["Hiob", "Ijob", "Hi"] },
{ id: "psa", name: "Psalmen", aliases: ["Psalter", "Ps"] },
{ id: "pro", name: "Sprüche", aliases: ["Sprüche Salomos", "Spr"] },
{ id: "ecc", name: "Kohelet", aliases: ["Prediger", "Koh", "Pred"] },
{ id: "sng", name: "Hoheslied", aliases: ["Lied der Lieder", "Hld", "Hl"] },
{ id: "isa", name: "Jesaja", aliases: ["Jes"] },
{ id: "jer", name: "Jeremia", aliases: ["Jer"] },
{ id: "lam", name: "Klagelieder", aliases: ["Threni", "Klgl", "Kla"] },
{ id: "ezk", name: "Ezechiel", aliases: ["Hesekiel", "Ez", "Hes"] },
{ id: "dan", name: "Daniel", aliases: ["Dan"] },
{ id: "hos", name: "Hosea", aliases: ["Hos", "Hos"] },
{ id: "jol", name: "Joel", aliases: ["Joe"] },
{ id: "amo", name: "Amos", aliases: ["Am", "Amos"] },
{ id: "oba", name: "Obadja", aliases: ["Ob", "Oba"] },
{ id: "jon", name: "Jona", aliases: ["Jon"] },
{ id: "mic", name: "Micha", aliases: ["Mi", "Mic"] },
{ id: "nam", name: "Nahum", aliases: ["Nah"] },
{ id: "hab", name: "Habakuk", aliases: ["Hab", "Hab"] },
{ id: "zep", name: "Zefanja", aliases: ["Zephanja", "Zef", "Zeph"] },
{ id: "hag", name: "Haggai", aliases: ["Hag"] },
{ id: "zec", name: "Sacharja", aliases: ["Sach"] },
{ id: "mal", name: "Maleachi", aliases: ["Mal"] },
{ id: "mat", name: "Matthäus", aliases: ["Mt"] },
{ id: "mrk", name: "Markus", aliases: ["Mk"] },
{ id: "luk", name: "Lukas", aliases: ["Lk"] },
{ id: "jhn", name: "Johannes", aliases: ["Joh"] },
{ id: "act", name: "Apostelgeschichte", aliases: ["Taten der Apostel", "Apg"] },
{ id: "rom", name: "Römer", aliases: ["Röm", "Rö"] },
{ id: "1co", name: "1. Korinther", aliases: ["1Kor", "1Ko"] },
{ id: "2co", name: "2. Korinther", aliases: ["2Kor", "2Ko"] },
{ id: "gal", name: "Galater", aliases: ["Gal", "Gal"] },
{ id: "eph", name: "Epheser", aliases: ["Eph", "Eph"] },
{ id: "php", name: "Philipper", aliases: ["Phil"] },
{ id: "col", name: "Kolosser", aliases: ["Kol"] },
{ id: "1th", name: "1. Thessalonicher", aliases: ["1Thes", "1Th"] },
{ id: "2th", name: "2. Thessalonicher", aliases: ["2Thes", "2Th"] },
{ id: "1ti", name: "1. Timotheus", aliases: ["1Tim", "1Ti"] },
{ id: "2ti", name: "2. Timotheus", aliases: ["2Tim", "2Ti"] },
{ id: "tit", name: "Titus", aliases: ["Tit"] },
{ id: "phm", name: "Philemon", aliases: ["Phlm", "Phm"] },
{ id: "heb", name: "Hebräer", aliases: ["Hebr", "Heb"] },
{ id: "jas", name: "Jakobus", aliases: ["Jak", "Jak"] },
{ id: "1pe", name: "1. Petrus", aliases: ["1Pet", "1Pe"] },
{ id: "2pe", name: "2. Petrus", aliases: ["2Pet", "2Pe"] },
{ id: "1jn", name: "1. Johannes", aliases: ["1Joh", "1Jo"] },
{ id: "2jn", name: "2. Johannes", aliases: ["2Joh", "2Jo"] },
{ id: "3jn", name: "3. Johannes", aliases: ["3Joh", "3Jo"] },
{ id: "jud", name: "Judas", aliases: ["Jud"] },
{ id: "rev", name: "Offenbarung", aliases: ["Apokalypse", "Off", "Apk"] },
export const BOOKS: Book[] = [
{ id: 'gen', name: '1. Mose', aliases: ['Genesis', 'Gen', '1Mo'] },
{ id: 'exo', name: '2. Mose', aliases: ['Exodus', 'Ex', '2Mo'] },
{ id: 'lev', name: '3. Mose', aliases: ['Levitikus', 'Lev', '3Mo'] },
{ id: 'num', name: '4. Mose', aliases: ['Numeri', 'Num', '4Mo'] },
{ id: 'deu', name: '5. Mose', aliases: ['Deuteronomium', 'Dtn', '5Mo'] },
{ id: 'jos', name: 'Josua', aliases: ['Jos', 'Jos'] },
{ id: 'jdg', name: 'Richter', aliases: ['Ri', 'Richt'] },
{ id: 'rut', name: 'Rut', aliases: ['Rut', 'Ru'] },
{ id: '1sa', name: '1. Samuel', aliases: ['1Sam', '1Sa'] },
{ id: '2sa', name: '2. Samuel', aliases: ['2Sam', '2Sa'] },
{ id: '1ki', name: '1. Könige', aliases: ['1Kön', '1Kö'] },
{ id: '2ki', name: '2. Könige', aliases: ['2Kön', '2Kö'] },
{ id: '1ch', name: '1. Chronik', aliases: ['1Chr', '1Ch'] },
{ id: '2ch', name: '2. Chronik', aliases: ['2Chr', '2Ch'] },
{ id: 'ezr', name: 'Esra', aliases: ['Esr', 'Esr'] },
{ id: 'neh', name: 'Nehemia', aliases: ['Neh', 'Neh'] },
{ id: 'est', name: 'Ester', aliases: ['Esther', 'Est', 'Est'] },
{ id: 'job', name: 'Ijob', aliases: ['Hiob', 'Ijob', 'Hi'] },
{ id: 'psa', name: 'Psalmen', aliases: ['Psalter', 'Ps'] },
{ id: 'pro', name: 'Sprüche', aliases: ['Sprüche Salomos', 'Spr'] },
{ id: 'ecc', name: 'Kohelet', aliases: ['Prediger', 'Koh', 'Pred'] },
{ id: 'sng', name: 'Hoheslied', aliases: ['Lied der Lieder', 'Hld', 'Hl'] },
{ id: 'isa', name: 'Jesaja', aliases: ['Jes'] },
{ id: 'jer', name: 'Jeremia', aliases: ['Jer'] },
{ id: 'lam', name: 'Klagelieder', aliases: ['Threni', 'Klgl', 'Kla'] },
{ id: 'ezk', name: 'Ezechiel', aliases: ['Hesekiel', 'Ez', 'Hes'] },
{ id: 'dan', name: 'Daniel', aliases: ['Dan'] },
{ id: 'hos', name: 'Hosea', aliases: ['Hos', 'Hos'] },
{ id: 'jol', name: 'Joel', aliases: ['Joe'] },
{ id: 'amo', name: 'Amos', aliases: ['Am', 'Amos'] },
{ id: 'oba', name: 'Obadja', aliases: ['Ob', 'Oba'] },
{ id: 'jon', name: 'Jona', aliases: ['Jon'] },
{ id: 'mic', name: 'Micha', aliases: ['Mi', 'Mic'] },
{ id: 'nam', name: 'Nahum', aliases: ['Nah'] },
{ id: 'hab', name: 'Habakuk', aliases: ['Hab', 'Hab'] },
{ id: 'zep', name: 'Zefanja', aliases: ['Zephanja', 'Zef', 'Zeph'] },
{ id: 'hag', name: 'Haggai', aliases: ['Hag'] },
{ id: 'zec', name: 'Sacharja', aliases: ['Sach'] },
{ id: 'mal', name: 'Maleachi', aliases: ['Mal'] },
{ id: 'mat', name: 'Matthäus', aliases: ['Mt'] },
{ id: 'mrk', name: 'Markus', aliases: ['Mk'] },
{ id: 'luk', name: 'Lukas', aliases: ['Lk'] },
{ id: 'jhn', name: 'Johannes', aliases: ['Joh'] },
{
id: 'act',
name: 'Apostelgeschichte',
aliases: ['Taten der Apostel', 'Apg'],
},
{ id: 'rom', name: 'Römer', aliases: ['Röm', 'Rö'] },
{ id: '1co', name: '1. Korinther', aliases: ['1Kor', '1Ko'] },
{ id: '2co', name: '2. Korinther', aliases: ['2Kor', '2Ko'] },
{ id: 'gal', name: 'Galater', aliases: ['Gal', 'Gal'] },
{ id: 'eph', name: 'Epheser', aliases: ['Eph', 'Eph'] },
{ id: 'php', name: 'Philipper', aliases: ['Phil'] },
{ id: 'col', name: 'Kolosser', aliases: ['Kol'] },
{ id: '1th', name: '1. Thessalonicher', aliases: ['1Thes', '1Th'] },
{ id: '2th', name: '2. Thessalonicher', aliases: ['2Thes', '2Th'] },
{ id: '1ti', name: '1. Timotheus', aliases: ['1Tim', '1Ti'] },
{ id: '2ti', name: '2. Timotheus', aliases: ['2Tim', '2Ti'] },
{ id: 'tit', name: 'Titus', aliases: ['Tit'] },
{ id: 'phm', name: 'Philemon', aliases: ['Phlm', 'Phm'] },
{ id: 'heb', name: 'Hebräer', aliases: ['Hebr', 'Heb'] },
{ id: 'jas', name: 'Jakobus', aliases: ['Jak', 'Jak'] },
{ id: '1pe', name: '1. Petrus', aliases: ['1Pet', '1Pe'] },
{ id: '2pe', name: '2. Petrus', aliases: ['2Pet', '2Pe'] },
{ id: '1jn', name: '1. Johannes', aliases: ['1Joh', '1Jo'] },
{ id: '2jn', name: '2. Johannes', aliases: ['2Joh', '2Jo'] },
{ id: '3jn', name: '3. Johannes', aliases: ['3Joh', '3Jo'] },
{ id: 'jud', name: 'Judas', aliases: ['Jud'] },
{ id: 'rev', name: 'Offenbarung', aliases: ['Apokalypse', 'Off', 'Apk'] },
];

7
src/i18n/de/index.ts Normal file
View File

@@ -0,0 +1,7 @@
import { BOOKS } from './books';
import { SETTINGS } from './settings';
export const DE = {
BOOKS,
SETTINGS,
};

View File

@@ -1,4 +1,4 @@
import { Settings } from "../models";
import { Settings } from '../models';
export const SETTINGS: Settings = {
required: {
@@ -6,9 +6,10 @@ export const SETTINGS: Settings = {
controls: {
biblesPath: {
name: 'Bibles path',
description: 'The path to the folder containing your bibles.'
description: 'The path to the folder containing your bibles.',
placeholder: 'e.g. Data/Bibles',
},
},
}
},
optional: {
@@ -16,17 +17,20 @@ export const SETTINGS: Settings = {
controls: {
defaultVersion: {
name: 'Default version',
description: 'The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.'
description:
'The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.',
placeholder: 'e.g. NIV',
},
defaultPassageFormat: {
name: 'Default passage format',
description: 'The markdown format to use for passages by default.'
description: 'The markdown format to use for passages by default.',
},
bibleFormat: {
name: 'Bible format',
description: 'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.'
}
}
description:
'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.',
},
},
},
quoteFormat: {
@@ -35,17 +39,19 @@ export const SETTINGS: Settings = {
controls: {
includeReference: {
name: 'Include reference',
description: 'Whether to include a reference to the passage.'
description: 'Whether to include a reference to the passage.',
},
referencePosition: {
name: 'Reference position',
description: 'The position of the reference in relation to the quoted text.'
description:
'The position of the reference in relation to the quoted text.',
},
linkToPassage: {
name: 'Link to passage',
description: 'Whether to link the reference to the passage in your vault Bible.'
}
}
description:
'Whether to link the reference to the passage in your vault Bible.',
},
},
},
calloutFormat: {
@@ -54,12 +60,13 @@ export const SETTINGS: Settings = {
controls: {
calloutType: {
name: 'Callout type',
description: 'The type of callout to use for the passage.'
description: 'The type of callout to use for the passage.',
},
linkToPassage: {
name: 'Link to passage',
description: 'Whether to link the reference to the passage in your vault Bible.'
}
}
}
}
description:
'Whether to link the reference to the passage in your vault Bible.',
},
},
},
};

View File

@@ -1,70 +1,212 @@
import { Book } from "../models";
import { Book } from '../models';
export const BOOKS: Book[] = [
{ id: "gen", name: "Genesis", aliases: ["gen"] },
{ id: "exo", name: "Exodus", aliases: ["exo", "ex", "exod"] },
{ id: "lev", name: "Leviticus", aliases: ["lev"] },
{ id: "num", name: "Numbers", aliases: ["num"] },
{ id: "deu", name: "Deuteronomy", aliases: ["deu", "deut"] },
{ id: "jos", name: "Joshua", aliases: ["jos", "josh"] },
{ id: "jdg", name: "Judges", aliases: ["jdg", "judg"] },
{ id: "rut", name: "Ruth", aliases: ["rut"] },
{ id: "1sa", name: "1 Samuel", aliases: ["1sa", "1samuel", "1 sam", "1st sam", "1st samuel", "first samuel"] },
{ id: "2sa", name: "2 Samuel", aliases: ["2sa", "2samuel", "2 sam", "2nd sam", "2nd samuel", "second samuel"] },
{ id: "1ki", name: "1 Kings", aliases: ["1ki", "1kings", "1 kgs", "1st kgs", "1st kings", "first kings"] },
{ id: "2ki", name: "2 Kings", aliases: ["2ki", "2kings", "2 kgs", "2nd kgs", "2nd kings", "second kings"] },
{ id: "1ch", name: "1 Chronicles", aliases: ["1ch", "1chronicles", "1 chr", "1st chr", "1st chronicles", "first chronicles"] },
{ id: "2ch", name: "2 Chronicles", aliases: ["2ch", "2chronicles", "2 chr", "2nd chr", "2nd chronicles", "second chronicles"] },
{ id: "ezr", name: "Ezra", aliases: ["ezr"] },
{ id: "neh", name: "Nehemiah", aliases: ["neh"] },
{ id: "est", name: "Esther", aliases: ["est", "esth"] },
{ id: "job", name: "Job", aliases: ["job"] },
{ id: "psa", name: "Psalms", aliases: ["psa", "ps", "psalm"] },
{ id: "pro", name: "Proverbs", aliases: ["pro", "prov"] },
{ id: "ecc", name: "Ecclesiastes", aliases: ["ecc", "eccl"] },
{ id: "sng", name: "Song of Songs", aliases: ["sng", "Song of Solomon", "song"] },
{ id: "isa", name: "Isaiah", aliases: ["isa"] },
{ id: "jer", name: "Jeremiah", aliases: ["jer"] },
{ id: "lam", name: "Lamentations", aliases: ["lam"] },
{ id: "ezk", name: "Ezekiel", aliases: ["ezk", "ezek"] },
{ id: "dan", name: "Daniel", aliases: ["dan"] },
{ id: "hos", name: "Hosea", aliases: ["hos"] },
{ id: "jol", name: "Joel", aliases: ["jol"] },
{ id: "amo", name: "Amos", aliases: ["amo"] },
{ id: "oba", name: "Obadiah", aliases: ["oba", "obad"] },
{ id: "jon", name: "Jonah", aliases: ["jon"] },
{ id: "mic", name: "Micah", aliases: ["mic"] },
{ id: "nam", name: "Nahum", aliases: ["nam"] },
{ id: "hab", name: "Habakkuk", aliases: ["hab"] },
{ id: "zep", name: "Zephaniah", aliases: ["zep", "zeph"] },
{ id: "hag", name: "Haggai", aliases: ["hag"] },
{ id: "zec", name: "Zechariah", aliases: ["zec", "zech"] },
{ id: "mal", name: "Malachi", aliases: ["mal"] },
{ id: "mat", name: "Matthew", aliases: ["mat", "matt"] },
{ id: "mrk", name: "Mark", aliases: ["mrk"] },
{ id: "luk", name: "Luke", aliases: ["luk"] },
{ id: "jhn", name: "John", aliases: ["jhn"] },
{ id: "act", name: "Acts", aliases: ["act"] },
{ id: "rom", name: "Romans", aliases: ["rom"] },
{ id: "1co", name: "1 Corinthians", aliases: ["1co", "1corinthians", "1 cor", "1st cor", "1st corinthians", "first corinthians"] },
{ id: "2co", name: "2 Corinthians", aliases: ["2co", "2corinthians", "2 cor", "2nd cor", "2nd corinthians", "second corinthians"] },
{ id: "gal", name: "Galatians", aliases: ["gal"] },
{ id: "eph", name: "Ephesians", aliases: ["eph"] },
{ id: "php", name: "Philippians", aliases: ["php", "phil"] },
{ id: "col", name: "Colossians", aliases: ["col"] },
{ id: "1th", name: "1 Thessalonians", aliases: ["1th", "1thessalonians", "1 thess", "1st thess", "1st thessalonians", "first thessalonians"] },
{ id: "2th", name: "2 Thessalonians", aliases: ["2th", "2thessalonians", "2 thess", "2nd thess", "2nd thessalonians", "second thessalonians"] },
{ id: "1ti", name: "1 Timothy", aliases: ["1ti", "1timothy", "1 tim", "1st tim", "1st timothy", "first timothy"] },
{ id: "2ti", name: "2 Timothy", aliases: ["2ti", "2timothy", "2 tim", "2nd tim", "2nd timothy", "second timothy"] },
{ id: "tit", name: "Titus", aliases: ["tit"] },
{ id: "phm", name: "Philemon", aliases: ["phm", "phlm"] },
{ id: "heb", name: "Hebrews", aliases: ["heb"] },
{ id: "jas", name: "James", aliases: ["jas"] },
{ id: "1pe", name: "1 Peter", aliases: ["1pe", "1peter", "1 pet", "1st pet", "1st peter", "first peter"] },
{ id: "2pe", name: "2 Peter", aliases: ["2pe", "2peter", "2 pet", "2nd pet", "2nd peter", "second peter"] },
{ id: "1jn", name: "1 John", aliases: ["1jn", "1john", "1st john", "first john"] },
{ id: "2jn", name: "2 John", aliases: ["2jn", "2john", "2nd john", "second john"] },
{ id: "3jn", name: "3 John", aliases: ["3jn", "3john", "3rd john", "third john"] },
{ id: "jud", name: "Jude", aliases: ["jud"] },
{ id: "rev", name: "Revelation", aliases: ["rev"] },
{ id: 'gen', name: 'Genesis', aliases: ['gen'] },
{ id: 'exo', name: 'Exodus', aliases: ['exo', 'ex', 'exod'] },
{ id: 'lev', name: 'Leviticus', aliases: ['lev'] },
{ id: 'num', name: 'Numbers', aliases: ['num'] },
{ id: 'deu', name: 'Deuteronomy', aliases: ['deu', 'deut'] },
{ id: 'jos', name: 'Joshua', aliases: ['jos', 'josh'] },
{ id: 'jdg', name: 'Judges', aliases: ['jdg', 'judg'] },
{ id: 'rut', name: 'Ruth', aliases: ['rut'] },
{
id: '1sa',
name: '1 Samuel',
aliases: [
'1sa',
'1samuel',
'1 sam',
'1st sam',
'1st samuel',
'first samuel',
],
},
{
id: '2sa',
name: '2 Samuel',
aliases: [
'2sa',
'2samuel',
'2 sam',
'2nd sam',
'2nd samuel',
'second samuel',
],
},
{
id: '1ki',
name: '1 Kings',
aliases: ['1ki', '1kings', '1 kgs', '1st kgs', '1st kings', 'first kings'],
},
{
id: '2ki',
name: '2 Kings',
aliases: ['2ki', '2kings', '2 kgs', '2nd kgs', '2nd kings', 'second kings'],
},
{
id: '1ch',
name: '1 Chronicles',
aliases: [
'1ch',
'1chronicles',
'1 chr',
'1st chr',
'1st chronicles',
'first chronicles',
],
},
{
id: '2ch',
name: '2 Chronicles',
aliases: [
'2ch',
'2chronicles',
'2 chr',
'2nd chr',
'2nd chronicles',
'second chronicles',
],
},
{ id: 'ezr', name: 'Ezra', aliases: ['ezr'] },
{ id: 'neh', name: 'Nehemiah', aliases: ['neh'] },
{ id: 'est', name: 'Esther', aliases: ['est', 'esth'] },
{ id: 'job', name: 'Job', aliases: ['job'] },
{ id: 'psa', name: 'Psalms', aliases: ['psa', 'ps', 'psalm'] },
{ id: 'pro', name: 'Proverbs', aliases: ['pro', 'prov'] },
{ id: 'ecc', name: 'Ecclesiastes', aliases: ['ecc', 'eccl'] },
{
id: 'sng',
name: 'Song of Songs',
aliases: ['sng', 'Song of Solomon', 'song'],
},
{ id: 'isa', name: 'Isaiah', aliases: ['isa'] },
{ id: 'jer', name: 'Jeremiah', aliases: ['jer'] },
{ id: 'lam', name: 'Lamentations', aliases: ['lam'] },
{ id: 'ezk', name: 'Ezekiel', aliases: ['ezk', 'ezek'] },
{ id: 'dan', name: 'Daniel', aliases: ['dan'] },
{ id: 'hos', name: 'Hosea', aliases: ['hos'] },
{ id: 'jol', name: 'Joel', aliases: ['jol'] },
{ id: 'amo', name: 'Amos', aliases: ['amo'] },
{ id: 'oba', name: 'Obadiah', aliases: ['oba', 'obad'] },
{ id: 'jon', name: 'Jonah', aliases: ['jon'] },
{ id: 'mic', name: 'Micah', aliases: ['mic'] },
{ id: 'nam', name: 'Nahum', aliases: ['nam'] },
{ id: 'hab', name: 'Habakkuk', aliases: ['hab'] },
{ id: 'zep', name: 'Zephaniah', aliases: ['zep', 'zeph'] },
{ id: 'hag', name: 'Haggai', aliases: ['hag'] },
{ id: 'zec', name: 'Zechariah', aliases: ['zec', 'zech'] },
{ id: 'mal', name: 'Malachi', aliases: ['mal'] },
{ id: 'mat', name: 'Matthew', aliases: ['mat', 'matt'] },
{ id: 'mrk', name: 'Mark', aliases: ['mrk'] },
{ id: 'luk', name: 'Luke', aliases: ['luk'] },
{ id: 'jhn', name: 'John', aliases: ['jhn'] },
{ id: 'act', name: 'Acts', aliases: ['act'] },
{ id: 'rom', name: 'Romans', aliases: ['rom'] },
{
id: '1co',
name: '1 Corinthians',
aliases: [
'1co',
'1corinthians',
'1 cor',
'1st cor',
'1st corinthians',
'first corinthians',
],
},
{
id: '2co',
name: '2 Corinthians',
aliases: [
'2co',
'2corinthians',
'2 cor',
'2nd cor',
'2nd corinthians',
'second corinthians',
],
},
{ id: 'gal', name: 'Galatians', aliases: ['gal'] },
{ id: 'eph', name: 'Ephesians', aliases: ['eph'] },
{ id: 'php', name: 'Philippians', aliases: ['php', 'phil'] },
{ id: 'col', name: 'Colossians', aliases: ['col'] },
{
id: '1th',
name: '1 Thessalonians',
aliases: [
'1th',
'1thessalonians',
'1 thess',
'1st thess',
'1st thessalonians',
'first thessalonians',
],
},
{
id: '2th',
name: '2 Thessalonians',
aliases: [
'2th',
'2thessalonians',
'2 thess',
'2nd thess',
'2nd thessalonians',
'second thessalonians',
],
},
{
id: '1ti',
name: '1 Timothy',
aliases: [
'1ti',
'1timothy',
'1 tim',
'1st tim',
'1st timothy',
'first timothy',
],
},
{
id: '2ti',
name: '2 Timothy',
aliases: [
'2ti',
'2timothy',
'2 tim',
'2nd tim',
'2nd timothy',
'second timothy',
],
},
{ id: 'tit', name: 'Titus', aliases: ['tit'] },
{ id: 'phm', name: 'Philemon', aliases: ['phm', 'phlm'] },
{ id: 'heb', name: 'Hebrews', aliases: ['heb'] },
{ id: 'jas', name: 'James', aliases: ['jas'] },
{
id: '1pe',
name: '1 Peter',
aliases: ['1pe', '1peter', '1 pet', '1st pet', '1st peter', 'first peter'],
},
{
id: '2pe',
name: '2 Peter',
aliases: ['2pe', '2peter', '2 pet', '2nd pet', '2nd peter', 'second peter'],
},
{
id: '1jn',
name: '1 John',
aliases: ['1jn', '1john', '1st john', 'first john'],
},
{
id: '2jn',
name: '2 John',
aliases: ['2jn', '2john', '2nd john', 'second john'],
},
{
id: '3jn',
name: '3 John',
aliases: ['3jn', '3john', '3rd john', 'third john'],
},
{ id: 'jud', name: 'Jude', aliases: ['jud'] },
{ id: 'rev', name: 'Revelation', aliases: ['rev'] },
];

View File

@@ -1,7 +1,7 @@
import { BOOKS } from "./books";
import { SETTINGS } from "./settings";
import { BOOKS } from './books';
import { SETTINGS } from './settings';
export const EN = {
BOOKS,
SETTINGS,
}
};

View File

@@ -1,4 +1,4 @@
import { Settings } from "../models";
import { Settings } from '../models';
export const SETTINGS: Settings = {
required: {
@@ -7,9 +7,9 @@ export const SETTINGS: Settings = {
biblesPath: {
name: 'Bibles path',
description: 'The path to the folder containing your bibles.',
placeholder: 'e.g. Data/Bibles'
placeholder: 'e.g. Data/Bibles',
},
},
}
},
optional: {
@@ -17,18 +17,20 @@ export const SETTINGS: Settings = {
controls: {
defaultVersion: {
name: 'Default version',
description: 'The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.',
placeholder: 'e.g. NIV'
description:
'The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.',
placeholder: 'e.g. NIV',
},
defaultPassageFormat: {
name: 'Default passage format',
description: 'The markdown format to use for passages by default.'
description: 'The markdown format to use for passages by default.',
},
bibleFormat: {
name: 'Bible format',
description: 'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.'
}
}
description:
'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.',
},
},
},
quoteFormat: {
@@ -37,17 +39,19 @@ export const SETTINGS: Settings = {
controls: {
includeReference: {
name: 'Include reference',
description: 'Whether to include a reference to the passage.'
description: 'Whether to include a reference to the passage.',
},
referencePosition: {
name: 'Reference position',
description: 'The position of the reference in relation to the quoted text.'
description:
'The position of the reference in relation to the quoted text.',
},
linkToPassage: {
name: 'Link to passage',
description: 'Whether to link the reference to the passage in your vault Bible.'
}
}
description:
'Whether to link the reference to the passage in your vault Bible.',
},
},
},
calloutFormat: {
@@ -56,12 +60,13 @@ export const SETTINGS: Settings = {
controls: {
calloutType: {
name: 'Callout type',
description: 'The type of callout to use for the passage.'
description: 'The type of callout to use for the passage.',
},
linkToPassage: {
name: 'Link to passage',
description: 'Whether to link the reference to the passage in your vault Bible.'
}
}
}
}
description:
'Whether to link the reference to the passage in your vault Bible.',
},
},
},
};

View File

@@ -1,5 +1,7 @@
import { EN } from "./en";
import { DE } from './de';
import { EN } from './en';
export const I18N = {
EN,
}
DE,
};

View File

@@ -5,7 +5,7 @@ export interface Book {
}
export interface Settings {
[key: string]: SettingsGroup
[key: string]: SettingsGroup;
}
interface SettingsGroup {

View File

@@ -1,5 +1,12 @@
import LocalBibleRefPlugin from 'main';
import { App, normalizePath, Notice, PluginSettingTab, Setting, TextComponent } from 'obsidian';
import {
App,
normalizePath,
Notice,
PluginSettingTab,
Setting,
TextComponent,
} from 'obsidian';
import { PassageFormat } from './passage-reference';
import PathSuggest from './path-suggest';
import { CalloutType, QuoteReferencePosition } from './settings';
@@ -17,24 +24,29 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
const { containerEl } = this;
containerEl.empty();
new Setting(containerEl)
.setName('Required Settings')
.setHeading();
new Setting(containerEl).setName('Required Settings').setHeading();
let biblesPathTimeout: number;
new Setting(containerEl)
.setName('Bibles path')
.setDesc('The path to the folder containing your bibles.')
.addText(text => {
text.setPlaceholder('e.g. Data/Bibles')
.addText((text) => {
text
.setPlaceholder('e.g. Data/Bibles')
.setValue(this.plugin.settings.biblesPath)
.onChange(async (value) => {
// toggle visibility of default version setting
if (value) {
defaultVersionSetting.settingEl.removeClass('local-bible-ref-hidden');
defaultVersionSetting.settingEl.removeClass(
'local-bible-ref-hidden'
);
} else {
defaultVersionSetting.settingEl.addClass('local-bible-ref-hidden');
(defaultVersionSetting.components[0] as TextComponent).inputEl.value = '';
defaultVersionSetting.settingEl.addClass(
'local-bible-ref-hidden'
);
(
defaultVersionSetting.components[0] as TextComponent
).inputEl.value = '';
this.plugin.settings.defaultVersionShorthand = '';
}
@@ -53,16 +65,17 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
new PathSuggest(this.app, text.inputEl);
});
new Setting(containerEl)
.setName('Optional Settings')
.setHeading();
new Setting(containerEl).setName('Optional Settings').setHeading();
let defaultVersionTimeout: number;
const defaultVersionSetting = new Setting(containerEl)
.setName('Default version')
.setDesc('The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.')
.addText(text => {
text.setPlaceholder('e.g. NIV')
.setDesc(
'The version to use by default - shorthand. This should correspond to a folder in the bibles folder selected above.'
)
.addText((text) => {
text
.setPlaceholder('e.g. NIV')
.setValue(this.plugin.settings.defaultVersionShorthand)
.onChange(async (value) => {
this.plugin.settings.defaultVersionShorthand = value;
@@ -71,7 +84,9 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
clearTimeout(defaultVersionTimeout);
defaultVersionTimeout = window.setTimeout(async () => {
const path = `${this.plugin.settings.biblesPath}/${value}`;
const exists = this.app.vault.getFolderByPath(normalizePath(path));
const exists = this.app.vault.getFolderByPath(
normalizePath(path)
);
if (!exists) new Notice(`Folder doesn't exist at path: ${path}.`);
}, 1000);
});
@@ -88,7 +103,8 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
new Setting(containerEl)
.setName('Default passage format')
.setDesc('The markdown format to use for passages by default.')
.addDropdown(dropdown => dropdown
.addDropdown((dropdown) =>
dropdown
.addOptions({
manuscript: 'Manuscript',
paragraph: 'Paragraph',
@@ -99,12 +115,16 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
.onChange(async (value) => {
this.plugin.settings.defaultPassageFormat = value as PassageFormat;
await this.plugin.saveSettings();
}));
})
);
new Setting(containerEl)
.setName('Bible Format')
.setDesc('The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.')
.addDropdown(dropdown => dropdown
.setDesc(
'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.'
)
.addDropdown((dropdown) =>
dropdown
.addOptions({
localBibleRef: 'Local Bible Ref',
bibleLinker: 'Bible Linker',
@@ -113,7 +133,8 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
.onChange(async (value) => {
this.plugin.settings.bibleFormat = value as BibleFormat;
await this.plugin.saveSettings();
}));
})
);
new Setting(containerEl)
.setName('Quote Format Settings')
@@ -123,45 +144,58 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
new Setting(containerEl)
.setName('Include reference')
.setDesc('Whether to include a reference to the passage.')
.addToggle(toggle => toggle
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.quote.includeReference)
.onChange(async (value) => {
// toggle visibility of other paragraph reference settings
if (value) {
quoteRefPositionSetting.settingEl.removeClass('local-bible-ref-hidden');
quoteRefLinkSetting.settingEl.removeClass('local-bible-ref-hidden');
quoteRefPositionSetting.settingEl.removeClass(
'local-bible-ref-hidden'
);
quoteRefLinkSetting.settingEl.removeClass(
'local-bible-ref-hidden'
);
} else {
quoteRefPositionSetting.settingEl.addClass('local-bible-ref-hidden');
quoteRefPositionSetting.settingEl.addClass(
'local-bible-ref-hidden'
);
quoteRefLinkSetting.settingEl.addClass('local-bible-ref-hidden');
}
this.plugin.settings.quote.includeReference = value;
await this.plugin.saveSettings();
}));
})
);
const quoteRefPositionSetting = new Setting(containerEl)
.setName('Reference position')
.setDesc('Where to position the reference.')
.addDropdown(dropdown => dropdown
.addDropdown((dropdown) =>
dropdown
.addOptions({
beginning: 'Beginning',
end: 'End',
})
.setValue(this.plugin.settings.quote.referencePosition)
.onChange(async (value) => {
this.plugin.settings.quote.referencePosition = value as QuoteReferencePosition;
this.plugin.settings.quote.referencePosition =
value as QuoteReferencePosition;
await this.plugin.saveSettings();
}));
})
);
const quoteRefLinkSetting = new Setting(containerEl)
.setName('Link to passage')
.setDesc('Whether the reference should link to the passage in the Bible.')
.addToggle(toggle => toggle
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.quote.linkToPassage)
.onChange(async (value) => {
this.plugin.settings.quote.linkToPassage = value;
await this.plugin.saveSettings();
}));
})
);
if (this.plugin.settings.quote.includeReference) {
quoteRefPositionSetting.settingEl.removeClass('local-bible-ref-hidden');
@@ -179,7 +213,8 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
new Setting(containerEl)
.setName('Callout type')
.setDesc('The type of callout to use for passages.')
.addDropdown(dropdown => dropdown
.addDropdown((dropdown) =>
dropdown
.addOptions({
note: 'Note',
abstract: 'Abstract',
@@ -199,17 +234,20 @@ export default class LocalBibleRefSettingTab extends PluginSettingTab {
.onChange(async (value) => {
this.plugin.settings.callout.type = value as CalloutType;
await this.plugin.saveSettings();
}));
})
);
new Setting(containerEl)
.setName('Link to passage')
.setDesc('Whether the reference should link to the passage in the Bible.')
.addToggle(toggle => toggle
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.callout.linkToPassage)
.onChange(async (value) => {
this.plugin.settings.callout.linkToPassage = value;
await this.plugin.saveSettings();
}));
})
);
}
}

View File

@@ -1,6 +1,8 @@
import { Book, BOOKS_EN } from "./books/books.en";
import { Book, BOOKS_EN } from './books/books.en';
export default class PassageReference implements ChapterReference, PassageOptions {
export default class PassageReference
implements ChapterReference, PassageOptions
{
startChapter: number;
startVerse: number;
endChapter: number;
@@ -51,15 +53,16 @@ export default class PassageReference implements ChapterReference, PassageOption
/** Builds the passage matching regular expression. */
static get regExp(): RegExp {
let regExpString = "^\\-\\- ?(";
let regExpString = '^\\-\\- ?(';
regExpString += BOOKS_EN.map(
(b) => `${b.name}|${b.aliases.join("|")}`
).join("|");
regExpString += ") ?(\\d{1,3}(?::\\d{1,3})?" +
"(?: ?\\- ?\\d{1,3}(?::\\d{1,3})?)?)" +
"((?: ?\\+[a-z]+(?::[a-z]+)?){0,2})$";
(b) => `${b.name}|${b.aliases.join('|')}`
).join('|');
regExpString +=
') ?(\\d{1,3}(?::\\d{1,3})?' +
'(?: ?\\- ?\\d{1,3}(?::\\d{1,3})?)?)' +
'((?: ?\\+[a-z]+(?::[a-z]+)?){0,2})$';
return new RegExp(regExpString, "i");
return new RegExp(regExpString, 'i');
}
/** Stringifies the passage reference back into text. */
@@ -67,9 +70,7 @@ export default class PassageReference implements ChapterReference, PassageOption
// multi-chapter ref
if (this.startVerse === 1 && this.endVerse === -1) {
if (this.startChapter === this.endChapter)
return (
this.book.name + ` ${this.startChapter} - ${this.version}`
);
return this.book.name + ` ${this.startChapter} - ${this.version}`;
return (
`${this.book.name} ${this.startChapter}-` +
`${this.endChapter} - ${this.version}`
@@ -116,7 +117,9 @@ export default class PassageReference implements ChapterReference, PassageOption
* Parses a multi-chapter-and-verse reference from the given text.
* Reference format: `startChapter:startVerse[ ]-[ ]endChapter:endVerse`.
*/
private static parseMultiChapterVerseRef(text: string): ChapterReference | null {
private static parseMultiChapterVerseRef(
text: string
): ChapterReference | null {
const regex = /^(\d{1,3}):(\d{1,3}) ?- ?(\d{1,3}):(\d{1,3})$/i;
const match = text.match(regex);
if (!match) return null;
@@ -164,7 +167,7 @@ export default class PassageReference implements ChapterReference, PassageOption
): PassageOptions {
const optionArgs = text
.toLowerCase()
.split("+")
.split('+')
.filter(Boolean)
.map((x) => x.trim());
@@ -177,20 +180,20 @@ export default class PassageReference implements ChapterReference, PassageOption
// example) - anything else is treated as a Bible version code
for (const option of optionArgs) {
switch (option) {
case "m":
case "manuscript":
case 'm':
case 'manuscript':
options.format = PassageFormat.Manuscript;
break;
case "p":
case "paragraph":
case 'p':
case 'paragraph':
options.format = PassageFormat.Paragraph;
break;
case "q":
case "quote":
case 'q':
case 'quote':
options.format = PassageFormat.Quote;
break;
case "c":
case "callout":
case 'c':
case 'callout':
options.format = PassageFormat.Callout;
break;
default:
@@ -204,10 +207,10 @@ export default class PassageReference implements ChapterReference, PassageOption
}
export enum PassageFormat {
Manuscript = "manuscript",
Paragraph = "paragraph",
Quote = "quote",
Callout = "callout",
Manuscript = 'manuscript',
Paragraph = 'paragraph',
Quote = 'quote',
Callout = 'callout',
}
interface ChapterReference {

View File

@@ -9,10 +9,10 @@ import {
Notice,
TFile,
TFolder,
} from "obsidian";
import { BibleFormat } from "./local-bible-ref-setting-tab";
import PassageReference, { PassageFormat } from "./passage-reference";
import LocalBibleRefSettings, { QuoteReferencePosition } from "./settings";
} from 'obsidian';
import { BibleFormat } from './local-bible-ref-setting-tab';
import PassageReference, { PassageFormat } from './passage-reference';
import LocalBibleRefSettings, { QuoteReferencePosition } from './settings';
export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
private settings: LocalBibleRefSettings;
@@ -30,14 +30,15 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
): EditorSuggestTriggerInfo | null {
// line must start with '--'
const line = editor.getLine(cursor.line);
if (!line.startsWith("--")) return null;
if (!line.startsWith('--')) return null;
// if no settings, alert user
if (!this.settings.biblesPath) {
if (!this.noSettingsNotice?.messageEl.isShown()) {
const noticeText = "Local Bible Ref settings are not " +
"configured. Please set the bibles path before " +
"attempting to reference passages.";
const noticeText =
'Local Bible Ref settings are not ' +
'configured. Please set the bibles path before ' +
'attempting to reference passages.';
this.noSettingsNotice = new Notice(noticeText);
}
@@ -68,12 +69,14 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
let version = this.settings.defaultVersionShorthand;
if (!version) {
const folder = this.app.vault.getFolderByPath(this.settings.biblesPath);
version = folder?.children?.filter(c => c instanceof TFolder)?.first()?.name ?? '';
version =
folder?.children?.filter((c) => c instanceof TFolder)?.first()?.name ??
'';
}
const passageRef = PassageReference.parse(
context.query,
version,
this.settings.defaultPassageFormat,
this.settings.defaultPassageFormat
);
if (!passageRef) return [];
@@ -82,19 +85,13 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
if (!texts) return [];
// split first chapter by start verse
const textFromVerse = this.getTextFromStartVerse(
texts[0],
passageRef
);
const textFromVerse = this.getTextFromStartVerse(texts[0], passageRef);
if (!textFromVerse) return [];
texts[0] = textFromVerse;
// split last chapter by end verse
const lastIndex = texts.length - 1;
const textToVerse = this.getTextToEndVerse(
texts[lastIndex],
passageRef
);
const textToVerse = this.getTextToEndVerse(texts[lastIndex], passageRef);
if (!textToVerse) return [];
texts[lastIndex] = textToVerse;
@@ -131,9 +128,9 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
private async getChapterTexts(
ref: PassageReference
): Promise<string[] | null> {
let basePath = "";
let basePath = '';
for (const alias of [ref.book.name, ...ref.book.aliases]) {
basePath = [this.settings.biblesPath, ref.version, alias].join("/");
basePath = [this.settings.biblesPath, ref.version, alias].join('/');
basePath = normalizePath(basePath);
// if the book exists at this alias, use the alias instead
@@ -223,13 +220,13 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
text = this.removeVerseSpacing(text);
}
const chapterMd = multipleChapters ? `**${chapterNumber}**` : "";
if (text.startsWith("> ")) {
const chapterMd = multipleChapters ? `**${chapterNumber}**` : '';
if (text.startsWith('> ')) {
const quoteMd = text.match(/^(?:> )+/)![0];
return text.replace(quoteMd, `${quoteMd}${chapterMd} `);
}
if (text.startsWith("- ")) {
if (text.startsWith('- ')) {
const listMd = text.match(/^(?:- )+/)![0];
return text.replace(listMd, `${listMd}${chapterMd} `);
}
@@ -241,28 +238,28 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
private formatBibleLinkerVerses(text: string): string {
return text.replace(
/#{1,6} [a-zA-Z]*(\d{1,3})[a-zA-Z]*\n(\w+)/g,
"<sup>$1</sup> $2",
'<sup>$1</sup> $2'
);
}
/** Removes chapter numbers from the given text. */
private removeChapterNumbers(text: string): string {
return text.replace(/\*\*\d{1,3}\*\* /g, "");
return text.replace(/\*\*\d{1,3}\*\* /g, '');
}
/** Removes headings from the given text. */
private removeHeadings(text: string): string {
return text.replace(/^#.*[\n\r\f]*/gm, "");
return text.replace(/^#.*[\n\r\f]*/gm, '');
}
/** Removes footnote refs from the given text. */
private removeFootnoteRefs(text: string): string {
return text.replace(/ \[\^\w{1,9}\]/g, "");
return text.replace(/ \[\^\w{1,9}\]/g, '');
}
/** Removes the beginning-of-file content from the given text. */
private removeBOF(text: string): string {
if (!text.startsWith("---")) return text;
if (!text.startsWith('---')) return text;
// split at YAML front matter
const split = text.split(/^---$/m);
return split[2].trim();
@@ -279,20 +276,20 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
/** Removes extra spacing between verses in Bible Linker formatting. */
private removeVerseSpacing(text: string): string {
return text.replace(/\n{2,}/g, " ");
return text.replace(/\n{2,}/g, ' ');
}
/** Generates an excerpt for the suggestion. */
private generateExcerpt(text: string): string {
text = text.split(/<\/sup>/, 2)[1];
text = text.replace(/(?:<sup>\d+<\/sup>|> |- )/g, "");
text = text.replace(/(?:<sup>\d+<\/sup>|> |- )/g, '');
text = text.replace(
/<span style='font-variant: small-caps;'>Lord<\/span>/g,
"Lord"
'Lord'
);
text = text.replace(/\n/g, " ");
text = text.replace(/ {2,}/g, " ");
return text.slice(0, 45) + "...";
text = text.replace(/\n/g, ' ');
text = text.replace(/ {2,}/g, ' ');
return text.slice(0, 45) + '...';
}
/** Formats the final text for suggestion. */
@@ -301,54 +298,56 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
passageRef: PassageReference,
context: EditorSuggestContext
): string {
let formatted = "";
let formatted = '';
switch (passageRef.format) {
case PassageFormat.Manuscript:
formatted = texts.join(" ").trim();
formatted = formatted.replace(/\n+/g, " ");
formatted = formatted.replace(/\*\*\d{1,3}\*\*/g, "");
formatted = formatted.replace(/<sup>\d{1,3}<\/sup> /g, "");
formatted = formatted.replace(/(?:^[>-] | [>-] )/g, " ");
formatted = formatted.trim() + "\n\n";
formatted = texts.join(' ').trim();
formatted = formatted.replace(/\n+/g, ' ');
formatted = formatted.replace(/\*\*\d{1,3}\*\*/g, '');
formatted = formatted.replace(/<sup>\d{1,3}<\/sup> /g, '');
formatted = formatted.replace(/(?:^[>-] | [>-] )/g, ' ');
formatted = formatted.trim() + '\n\n';
break;
case PassageFormat.Paragraph:
formatted = texts.join("\n\n").trim();
formatted += "\n\n";
formatted = texts.join('\n\n').trim();
formatted += '\n\n';
break;
case PassageFormat.Quote: {
const {
includeReference,
referencePosition,
linkToPassage
} = this.settings.quote;
const { includeReference, referencePosition, linkToPassage } =
this.settings.quote;
let stringRef = '';
if (includeReference) {
if (linkToPassage) stringRef = this.generatePassageLink(passageRef, context);
if (linkToPassage)
stringRef = this.generatePassageLink(passageRef, context);
else stringRef = passageRef.stringify();
if (referencePosition === QuoteReferencePosition.Beginning) stringRef += "\n";
if (referencePosition === QuoteReferencePosition.Beginning)
stringRef += '\n';
else stringRef = `\n> ${stringRef}`;
}
formatted = "> ";
if (referencePosition === QuoteReferencePosition.Beginning) formatted += stringRef;
formatted += texts.join("\n\n").trim();
formatted = formatted.replace(/\n/gm, "\n> ");
if (referencePosition === QuoteReferencePosition.End) formatted += stringRef;
formatted += "\n\n";
formatted = '> ';
if (referencePosition === QuoteReferencePosition.Beginning)
formatted += stringRef;
formatted += texts.join('\n\n').trim();
formatted = formatted.replace(/\n/gm, '\n> ');
if (referencePosition === QuoteReferencePosition.End)
formatted += stringRef;
formatted += '\n\n';
break;
}
case PassageFormat.Callout: {
const { type, linkToPassage } = this.settings.callout;
let stringRef = '';
if (linkToPassage) stringRef = this.generatePassageLink(passageRef, context);
if (linkToPassage)
stringRef = this.generatePassageLink(passageRef, context);
else stringRef = passageRef.stringify();
formatted = `> [!${type}] ${stringRef}\n`;
formatted += texts.join("\n\n").trim();
formatted = formatted.replace(/\n/gm, "\n> ");
formatted += "\n\n";
formatted += texts.join('\n\n').trim();
formatted = formatted.replace(/\n/gm, '\n> ');
formatted += '\n\n';
break;
}
}
@@ -372,7 +371,7 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
this.settings.bibleFormat === BibleFormat.BibleLinker
? `#${startVerse}`
: undefined,
ref.stringify(),
ref.stringify()
);
}
}

View File

@@ -1,4 +1,4 @@
import { AbstractInputSuggest, App, TFolder } from "obsidian";
import { AbstractInputSuggest, App, TFolder } from 'obsidian';
export default class PathSuggest extends AbstractInputSuggest<string> {
private textInputEl: HTMLInputElement | HTMLDivElement;
@@ -13,8 +13,8 @@ export default class PathSuggest extends AbstractInputSuggest<string> {
const folder = this.app.vault.getFolderByPath(query);
if (!folder) return [];
return folder.children
.filter(c => c instanceof TFolder)
.map(f => f.path);
.filter((c) => c instanceof TFolder)
.map((f) => f.path);
}
renderSuggestion(item: string, el: HTMLElement): void {

View File

@@ -1,5 +1,5 @@
import { BibleFormat } from "./local-bible-ref-setting-tab";
import { PassageFormat } from "./passage-reference";
import { BibleFormat } from './local-bible-ref-setting-tab';
import { PassageFormat } from './passage-reference';
export default interface LocalBibleRefSettings {
biblesPath: string;
@@ -10,30 +10,30 @@ export default interface LocalBibleRefSettings {
includeReference: boolean;
referencePosition: QuoteReferencePosition;
linkToPassage: boolean;
},
};
callout: {
type: CalloutType;
linkToPassage: boolean;
}
};
}
export enum QuoteReferencePosition {
Beginning = "beginning",
End = "end",
Beginning = 'beginning',
End = 'end',
}
export enum CalloutType {
Note = "note",
Abstract = "abstract",
Info = "info",
Todo = "todo",
Tip = "tip",
Success = "success",
Question = "question",
Warning = "warning",
Failure = "failure",
Danger = "danger",
Bug = "bug",
Example = "example",
Quote = "quote",
Note = 'note',
Abstract = 'abstract',
Info = 'info',
Todo = 'todo',
Tip = 'tip',
Success = 'success',
Question = 'question',
Warning = 'warning',
Failure = 'failure',
Danger = 'danger',
Bug = 'bug',
Example = 'example',
Quote = 'quote',
}

View File

@@ -1,11 +1,15 @@
import { AbstractInputSuggest, App, TFolder } from "obsidian";
import LocalBibleRefSettings from "./settings";
import { AbstractInputSuggest, App, TFolder } from 'obsidian';
import LocalBibleRefSettings from './settings';
export default class VersionSuggest extends AbstractInputSuggest<string> {
private settings: LocalBibleRefSettings;
private textInputEl: HTMLInputElement | HTMLDivElement;
constructor(app: App, textInputEl: HTMLInputElement | HTMLDivElement, settings: LocalBibleRefSettings) {
constructor(
app: App,
textInputEl: HTMLInputElement | HTMLDivElement,
settings: LocalBibleRefSettings
) {
super(app, textInputEl);
this.textInputEl = textInputEl;
this.settings = settings;
@@ -15,8 +19,8 @@ export default class VersionSuggest extends AbstractInputSuggest<string> {
const folder = this.app.vault.getFolderByPath(this.settings.biblesPath);
if (!folder) return [];
return folder.children
.filter(c => c instanceof TFolder)
.map(f => f.name);
.filter((c) => c instanceof TFolder)
.map((f) => f.name);
}
renderSuggestion(item: string, el: HTMLElement): void {

View File

@@ -11,14 +11,7 @@
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7"
]
"lib": ["DOM", "ES5", "ES6", "ES7"]
},
"include": [
"**/*.ts"
]
"include": ["**/*.ts"]
}

View File

@@ -1,14 +1,14 @@
import { readFileSync, writeFileSync } from "fs";
import { readFileSync, writeFileSync } from 'fs';
const targetVersion = process.env.npm_package_version;
// read minAppVersion from manifest.json and bump version to target version
let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t'));
// update versions.json with target version and minAppVersion from manifest.json
let versions = JSON.parse(readFileSync("versions.json", "utf8"));
let versions = JSON.parse(readFileSync('versions.json', 'utf8'));
versions[targetVersion] = minAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));