Merge pull request #11 from camelChief/3-add-support-for-german

3 add support for german
This commit is contained in:
Caleb Campbell
2025-12-27 13:47:53 +11:00
committed by GitHub
27 changed files with 1110 additions and 785 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 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| 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

@@ -18,6 +18,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,244 +0,0 @@
export interface Book {
name: string;
aliases: string[];
}
export const BOOKS: 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"] },
];

74
src/i18n/de/books.ts Normal file
View File

@@ -0,0 +1,74 @@
import { Book } from '../models';
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'] },
{ 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'] },
{ id: 'neh', name: 'Nehemia', aliases: ['Neh'] },
{ id: 'est', name: 'Ester', aliases: ['Esther', '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'] },
{ 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'] },
{ id: 'eph', name: 'Epheser', aliases: ['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'] },
];

View File

@@ -0,0 +1,7 @@
import { CommonLabels } from '../models';
export const COMMON_LABELS: CommonLabels = {
folderDoesNotExist: 'Ordner exsistiert nicht in dem Verzeichnis:',
settingsNotConfigured:
'Die Einstellungen der Erweiterung "Lokale Parallelstellen" (Local Bible Ref) sind nicht eingerichtet. Bitte legen Sie den Pfad für die Bibeln fest, bevor Sie versuchen, auf Bibelabschnitte zu verweisen.',
};

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

@@ -0,0 +1,9 @@
import { BOOKS } from './books';
import { COMMON_LABELS } from './common-labels';
import { SETTINGS_LABELS } from './settings-labels';
export const DE = {
BOOKS,
COMMON: COMMON_LABELS,
SETTINGS: SETTINGS_LABELS,
};

View File

@@ -0,0 +1,86 @@
import { PassageFormat } from 'src/passage-reference';
import { SettingsLabels } from '../models';
import { QuoteReferencePosition } from 'src/settings';
export const SETTINGS_LABELS: SettingsLabels = {
required: {
name: 'Erforderliche Einstellungen',
controls: {
biblesPath: {
name: 'Bibeldateien',
description: 'Pfad zu den Bibeldateien',
placeholder: 'z.B. Dateien/Bibel',
},
},
},
optional: {
name: 'Optionale Einstellungen',
controls: {
defaultVersion: {
name: 'Standardversion',
description:
'Welche Bibelversion soll als Standardversion verwendet werden? Diese Abkürzung muss mit einem Ordner in dem oben angegebenen Pfad übereinstimmen.',
placeholder: 'z.B. Schl2000',
},
defaultPassageFormat: {
name: 'Standard Bibelstellenformat',
description:
'Welches Markdownformat soll für einen Bibelstelle standardmäßig ausgewählt werden?',
options: {
[PassageFormat.Manuscript]: 'Manuskript',
[PassageFormat.Paragraph]: 'Abschnitt',
[PassageFormat.Quote]: 'Zitat',
[PassageFormat.Callout]: 'Callout',
},
},
bibleFormat: {
name: 'Bibelformat',
description:
'Der Formatierungsstil, den Sie für Ihre Vault-Bibeln verwenden. Local Bible Ref benötigt diesen, um Textpassagen korrekt zu analysieren.',
},
},
},
quoteFormat: {
name: 'Einstellungen für das Angebotsformat',
description: 'Einstellungen für das Zitatpassageformat.',
controls: {
includeReference: {
name: 'Referenz angeben',
description: 'Ob ein Verweis auf die Passage aufgenommen werden soll.',
},
referencePosition: {
name: 'Referenzposition',
description:
'Die Position der Bezugnahme im Verhältnis zum zitierten Text.',
options: {
[QuoteReferencePosition.Beginning]: 'Anfang',
[QuoteReferencePosition.End]: 'Ende',
},
},
linkToPassage: {
name: 'Link zur Passage',
description:
'Ob Sie den Verweis auf die Passage in Ihrer Tresorbibel verlinken möchten.',
},
},
},
calloutFormat: {
name: 'Einstellungen für das Callout-Format',
description: 'Einstellungen für das Format des Callout-Passages.',
controls: {
calloutType: {
name: 'Callout-Typ',
description:
'Die Art des Verweises, der für die Passage verwendet werden soll.',
},
linkToPassage: {
name: 'Link zur Passage',
description:
'Ob Sie den Verweis auf die Passage in Ihrer Tresorbibel verlinken möchten.',
},
},
},
};

212
src/i18n/en/books.ts Normal file
View File

@@ -0,0 +1,212 @@
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'] },
];

View File

@@ -0,0 +1,7 @@
import { CommonLabels } from '../models';
export const COMMON_LABELS: CommonLabels = {
folderDoesNotExist: "Folder doesn't exist at path:",
settingsNotConfigured:
'Local Bible Ref settings are not configured. Please set the bibles path before attempting to reference passages.',
};

9
src/i18n/en/index.ts Normal file
View File

@@ -0,0 +1,9 @@
import { BOOKS } from './books';
import { COMMON_LABELS } from './common-labels';
import { SETTINGS_LABELS } from './settings-labels';
export const EN = {
BOOKS,
COMMON: COMMON_LABELS,
SETTINGS: SETTINGS_LABELS,
};

View File

@@ -0,0 +1,84 @@
import { PassageFormat } from 'src/passage-reference';
import { SettingsLabels } from '../models';
import { QuoteReferencePosition } from 'src/settings';
export const SETTINGS_LABELS: SettingsLabels = {
required: {
name: 'Required Settings',
controls: {
biblesPath: {
name: 'Bibles path',
description: 'The path to the folder containing your bibles.',
placeholder: 'e.g. Data/Bibles',
},
},
},
optional: {
name: 'Optional 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',
},
defaultPassageFormat: {
name: 'Default passage format',
description: 'The markdown format to use for passages by default.',
options: {
[PassageFormat.Manuscript]: 'Manuscript',
[PassageFormat.Paragraph]: 'Paragraph',
[PassageFormat.Quote]: 'Quote',
[PassageFormat.Callout]: 'Callout',
},
},
bibleFormat: {
name: 'Bible format',
description:
'The formatting style you use for your vault bibles. Local Bible Ref relies on this to parse passages correctly.',
},
},
},
quoteFormat: {
name: 'Quote Format Settings',
description: 'Settings for the quote passage format.',
controls: {
includeReference: {
name: 'Include reference',
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.',
options: {
[QuoteReferencePosition.Beginning]: 'Beginning',
[QuoteReferencePosition.End]: 'End',
},
},
linkToPassage: {
name: 'Link to passage',
description:
'Whether to link the reference to the passage in your vault Bible.',
},
},
},
calloutFormat: {
name: 'Callout Format Settings',
description: 'Settings for the callout passage format.',
controls: {
calloutType: {
name: 'Callout type',
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.',
},
},
},
};

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

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

71
src/i18n/models.ts Normal file
View File

@@ -0,0 +1,71 @@
import { PassageFormat } from 'src/passage-reference';
import { QuoteReferencePosition } from 'src/settings';
export interface Book {
id: string;
name: string;
aliases: string[];
}
export interface CommonLabels {
folderDoesNotExist: string;
settingsNotConfigured: string;
}
export interface SettingsLabels {
required: {
name: string;
controls: {
biblesPath: TextControl;
};
};
optional: {
name: string;
controls: {
defaultVersion: TextControl;
defaultPassageFormat: Control & {
options: {
[PassageFormat.Manuscript]: string;
[PassageFormat.Paragraph]: string;
[PassageFormat.Quote]: string;
[PassageFormat.Callout]: string;
};
};
bibleFormat: Control;
};
};
quoteFormat: {
name: string;
description: string;
controls: {
includeReference: Control;
referencePosition: Control & {
options: {
[QuoteReferencePosition.Beginning]: string;
[QuoteReferencePosition.End]: string;
};
};
linkToPassage: Control;
};
};
calloutFormat: {
name: string;
description: string;
controls: {
calloutType: Control;
linkToPassage: Control;
};
};
}
interface Control {
name: string;
description: string;
}
interface TextControl extends Control {
placeholder: string;
}

View File

@@ -1,219 +1,258 @@
import LocalBibleRefPlugin from 'main';
import { App, normalizePath, Notice, PluginSettingTab, Setting, TextComponent } from 'obsidian';
import {
App,
getLanguage,
normalizePath,
Notice,
PluginSettingTab,
Setting,
TextComponent,
} from 'obsidian';
import { PassageFormat } from './passage-reference';
import PathSuggest from './path-suggest';
import { CalloutType, QuoteReferencePosition } from './settings';
import VersionSuggest from './version-suggest';
import { SettingsLabels } from './i18n/models';
import { I18N } from './i18n';
export default class LocalBibleRefSettingTab extends PluginSettingTab {
private readonly hiddenClass = 'local-bible-ref-hidden';
private plugin: LocalBibleRefPlugin;
private folderDoesNotExistText = '';
private settingsLabels: SettingsLabels;
constructor(app: App, plugin: LocalBibleRefPlugin) {
super(app, plugin);
this.plugin = plugin;
switch (getLanguage()) {
case 'de':
this.folderDoesNotExistText = I18N.DE.COMMON.folderDoesNotExist;
this.settingsLabels = I18N.DE.SETTINGS;
break;
case 'en':
default:
this.folderDoesNotExistText = I18N.EN.COMMON.folderDoesNotExist;
this.settingsLabels = I18N.EN.SETTINGS;
break;
}
}
display(): void {
const { containerEl } = this;
const { required, optional, quoteFormat, calloutFormat } =
this.settingsLabels;
containerEl.empty();
new Setting(containerEl)
.setName('Required Settings')
.setHeading();
new Setting(containerEl).setName(required.name).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')
.setValue(this.plugin.settings.biblesPath)
.onChange(async (value) => {
// toggle visibility of default version setting
if (value) {
defaultVersionSetting.settingEl.removeClass('local-bible-ref-hidden');
} else {
defaultVersionSetting.settingEl.addClass('local-bible-ref-hidden');
(defaultVersionSetting.components[0] as TextComponent).inputEl.value = '';
this.plugin.settings.defaultVersionShorthand = '';
}
let biblesPathTimeout: number;
new Setting(containerEl)
.setName(required.controls.biblesPath.name)
.setDesc(required.controls.biblesPath.description)
.addText((text) => {
text
.setPlaceholder(required.controls.biblesPath.placeholder)
.setValue(this.plugin.settings.biblesPath)
.onChange(async (value) => {
// toggle visibility of default version setting
if (value) {
defaultVersionSetting.settingEl.removeClass(this.hiddenClass);
} else {
defaultVersionSetting.settingEl.addClass(this.hiddenClass);
(
defaultVersionSetting.components[0] as TextComponent
).inputEl.value = '';
this.plugin.settings.defaultVersionShorthand = '';
}
const path = value ? normalizePath(value) : '';
this.plugin.settings.biblesPath = path;
await this.plugin.saveSettings();
const path = value ? normalizePath(value) : '';
this.plugin.settings.biblesPath = path;
await this.plugin.saveSettings();
clearTimeout(biblesPathTimeout);
biblesPathTimeout = window.setTimeout(async () => {
if (!path) return;
const exists = this.app.vault.getFolderByPath(path);
if (!exists) new Notice(`Folder doesn't exist at path: ${path}.`);
}, 1000);
});
clearTimeout(biblesPathTimeout);
biblesPathTimeout = window.setTimeout(async () => {
if (!path) return;
const exists = this.app.vault.getFolderByPath(path);
if (!exists)
new Notice(`${this.folderDoesNotExistText} ${path}.`);
}, 1000);
});
new PathSuggest(this.app, text.inputEl);
});
new PathSuggest(this.app, text.inputEl);
});
new Setting(containerEl)
.setName('Optional Settings')
.setHeading();
new Setting(containerEl).setName(optional.name).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')
.setValue(this.plugin.settings.defaultVersionShorthand)
.onChange(async (value) => {
this.plugin.settings.defaultVersionShorthand = value;
await this.plugin.saveSettings();
let defaultVersionTimeout: number;
const defaultVersionSetting = new Setting(containerEl)
.setName(optional.controls.defaultVersion.name)
.setDesc(optional.controls.defaultVersion.description)
.addText((text) => {
text
.setPlaceholder(optional.controls.defaultVersion.placeholder)
.setValue(this.plugin.settings.defaultVersionShorthand)
.onChange(async (value) => {
this.plugin.settings.defaultVersionShorthand = value;
await this.plugin.saveSettings();
clearTimeout(defaultVersionTimeout);
defaultVersionTimeout = window.setTimeout(async () => {
const path = `${this.plugin.settings.biblesPath}/${value}`;
const exists = this.app.vault.getFolderByPath(normalizePath(path));
if (!exists) new Notice(`Folder doesn't exist at path: ${path}.`);
}, 1000);
});
clearTimeout(defaultVersionTimeout);
defaultVersionTimeout = window.setTimeout(async () => {
const path = `${this.plugin.settings.biblesPath}/${value}`;
const exists = this.app.vault.getFolderByPath(
normalizePath(path)
);
if (!exists)
new Notice(`${this.folderDoesNotExistText} ${path}.`);
}, 1000);
});
new VersionSuggest(this.app, text.inputEl, this.plugin.settings);
});
new VersionSuggest(this.app, text.inputEl, this.plugin.settings);
});
if (this.plugin.settings.biblesPath) {
defaultVersionSetting.settingEl.removeClass('local-bible-ref-hidden');
} else {
defaultVersionSetting.settingEl.addClass('local-bible-ref-hidden');
}
if (this.plugin.settings.biblesPath) {
defaultVersionSetting.settingEl.removeClass(this.hiddenClass);
} else {
defaultVersionSetting.settingEl.addClass(this.hiddenClass);
}
new Setting(containerEl)
.setName('Default passage format')
.setDesc('The markdown format to use for passages by default.')
.addDropdown(dropdown => dropdown
.addOptions({
manuscript: 'Manuscript',
paragraph: 'Paragraph',
quote: 'Quote',
callout: 'Callout',
})
.setValue(this.plugin.settings.defaultPassageFormat)
.onChange(async (value) => {
this.plugin.settings.defaultPassageFormat = value as PassageFormat;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName(optional.controls.defaultPassageFormat.name)
.setDesc(optional.controls.defaultPassageFormat.description)
.addDropdown((dropdown) =>
dropdown
.addOptions(optional.controls.defaultPassageFormat.options)
.setValue(this.plugin.settings.defaultPassageFormat)
.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
.addOptions({
localBibleRef: 'Local Bible Ref',
bibleLinker: 'Bible Linker',
})
.setValue(this.plugin.settings.bibleFormat)
.onChange(async (value) => {
this.plugin.settings.bibleFormat = value as BibleFormat;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName(optional.controls.bibleFormat.name)
.setDesc(optional.controls.bibleFormat.description)
.addDropdown((dropdown) =>
dropdown
.addOptions({
[BibleFormat.LocalBibleRef]: 'Local Bible Ref',
[BibleFormat.BibleLinker]: 'Bible Linker',
})
.setValue(this.plugin.settings.bibleFormat)
.onChange(async (value) => {
this.plugin.settings.bibleFormat = value as BibleFormat;
await this.plugin.saveSettings();
})
);
new Setting(containerEl)
.setName('Quote Format Settings')
.setDesc('Settings for the quote passage format.')
.setHeading();
new Setting(containerEl)
.setName(quoteFormat.name)
.setDesc(quoteFormat.description)
.setHeading();
new Setting(containerEl)
.setName('Include reference')
.setDesc('Whether to include a reference to the passage.')
.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');
} else {
quoteRefPositionSetting.settingEl.addClass('local-bible-ref-hidden');
quoteRefLinkSetting.settingEl.addClass('local-bible-ref-hidden');
}
new Setting(containerEl)
.setName(quoteFormat.controls.includeReference.name)
.setDesc(quoteFormat.controls.includeReference.description)
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.quote.includeReference)
.onChange(async (value) => {
// toggle visibility of other paragraph reference settings
if (value) {
quoteRefPositionSetting.settingEl.removeClass(this.hiddenClass);
quoteRefLinkSetting.settingEl.removeClass(this.hiddenClass);
} else {
quoteRefPositionSetting.settingEl.addClass(this.hiddenClass);
quoteRefLinkSetting.settingEl.addClass(this.hiddenClass);
}
this.plugin.settings.quote.includeReference = value;
await this.plugin.saveSettings();
}));
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
.addOptions({
beginning: 'Beginning',
end: 'End',
})
.setValue(this.plugin.settings.quote.referencePosition)
.onChange(async (value) => {
this.plugin.settings.quote.referencePosition = value as QuoteReferencePosition;
await this.plugin.saveSettings();
}));
const quoteRefPositionSetting = new Setting(containerEl)
.setName(quoteFormat.controls.referencePosition.name)
.setDesc(quoteFormat.controls.referencePosition.description)
.addDropdown((dropdown) =>
dropdown
.addOptions(quoteFormat.controls.referencePosition.options)
.setValue(this.plugin.settings.quote.referencePosition)
.onChange(async (value) => {
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
.setValue(this.plugin.settings.quote.linkToPassage)
.onChange(async (value) => {
this.plugin.settings.quote.linkToPassage = value;
await this.plugin.saveSettings();
}));
const quoteRefLinkSetting = new Setting(containerEl)
.setName(quoteFormat.controls.linkToPassage.name)
.setDesc(quoteFormat.controls.linkToPassage.description)
.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');
quoteRefLinkSetting.settingEl.removeClass('local-bible-ref-hidden');
} else {
quoteRefPositionSetting.settingEl.addClass('local-bible-ref-hidden');
quoteRefLinkSetting.settingEl.addClass('local-bible-ref-hidden');
}
if (this.plugin.settings.quote.includeReference) {
quoteRefPositionSetting.settingEl.removeClass(this.hiddenClass);
quoteRefLinkSetting.settingEl.removeClass(this.hiddenClass);
} else {
quoteRefPositionSetting.settingEl.addClass(this.hiddenClass);
quoteRefLinkSetting.settingEl.addClass(this.hiddenClass);
}
new Setting(containerEl)
.setName('Callout Format Settings')
.setDesc('Settings for the callout passage format.')
.setHeading();
new Setting(containerEl)
.setName(calloutFormat.name)
.setDesc(calloutFormat.description)
.setHeading();
new Setting(containerEl)
.setName('Callout type')
.setDesc('The type of callout to use for passages.')
.addDropdown(dropdown => dropdown
.addOptions({
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',
})
.setValue(this.plugin.settings.callout.type)
.onChange(async (value) => {
this.plugin.settings.callout.type = value as CalloutType;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName(calloutFormat.controls.calloutType.name)
.setDesc(calloutFormat.controls.calloutType.description)
.addDropdown((dropdown) =>
dropdown
.addOptions({
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',
})
.setValue(this.plugin.settings.callout.type)
.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
.setValue(this.plugin.settings.callout.linkToPassage)
.onChange(async (value) => {
this.plugin.settings.callout.linkToPassage = value;
await this.plugin.saveSettings();
}));
}
new Setting(containerEl)
.setName(calloutFormat.controls.linkToPassage.name)
.setDesc(calloutFormat.controls.linkToPassage.description)
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.callout.linkToPassage)
.onChange(async (value) => {
this.plugin.settings.callout.linkToPassage = value;
await this.plugin.saveSettings();
})
);
}
}
export enum BibleFormat {
LocalBibleRef = 'localBibleRef',
BibleLinker = 'bibleLinker',
LocalBibleRef = 'localBibleRef',
BibleLinker = 'bibleLinker',
}

View File

@@ -1,6 +1,10 @@
import { Book, BOOKS } from "./books";
import { getLanguage } from 'obsidian';
import { I18N } from './i18n';
import { Book } from './i18n/models';
export default class PassageReference implements ChapterReference, PassageOptions {
export default class PassageReference
implements ChapterReference, PassageOptions
{
startChapter: number;
startVerse: number;
endChapter: number;
@@ -51,15 +55,15 @@ export default class PassageReference implements ChapterReference, PassageOption
/** Builds the passage matching regular expression. */
static get regExp(): RegExp {
let regExpString = "^\\-\\- ?(";
regExpString += BOOKS.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})$";
const books = getBooksByLanguage();
let regExpString = '^\\-\\- ?(';
regExpString += books
.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})$';
return new RegExp(regExpString, "i");
return new RegExp(regExpString, 'i');
}
/** Stringifies the passage reference back into text. */
@@ -67,9 +71,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 +118,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;
@@ -148,8 +152,9 @@ export default class PassageReference implements ChapterReference, PassageOption
/** Retrieves a book based on its alias. */
private static getBook(alias: string): Book | undefined {
const books = getBooksByLanguage();
alias = alias.toLowerCase();
return BOOKS.find((book) => {
return books.find((book) => {
const aliases = book.aliases.map((a) => a.toLowerCase());
if (book.name.toLowerCase() === alias) return book;
if (aliases.includes(alias)) return book;
@@ -164,7 +169,7 @@ export default class PassageReference implements ChapterReference, PassageOption
): PassageOptions {
const optionArgs = text
.toLowerCase()
.split("+")
.split('+')
.filter(Boolean)
.map((x) => x.trim());
@@ -177,20 +182,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:
@@ -203,11 +208,21 @@ export default class PassageReference implements ChapterReference, PassageOption
}
}
function getBooksByLanguage(): Book[] {
switch (getLanguage()) {
case 'de':
return I18N.DE.BOOKS;
case 'en':
default:
return I18N.EN.BOOKS;
}
}
export enum PassageFormat {
Manuscript = "manuscript",
Paragraph = "paragraph",
Quote = "quote",
Callout = "callout",
Manuscript = 'manuscript',
Paragraph = 'paragraph',
Quote = 'quote',
Callout = 'callout',
}
interface ChapterReference {

View File

@@ -5,22 +5,36 @@ import {
EditorSuggest,
EditorSuggestContext,
EditorSuggestTriggerInfo,
getLanguage,
normalizePath,
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';
import { I18N } from './i18n';
export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
private settings: LocalBibleRefSettings;
private readonly settings: LocalBibleRefSettings;
private readonly settingsNotConfiguredText: string;
private noSettingsNotice: Notice;
constructor(app: App, settings: LocalBibleRefSettings) {
super(app);
this.settings = settings;
switch (getLanguage()) {
case 'de':
this.settingsNotConfiguredText = I18N.DE.COMMON.settingsNotConfigured;
break;
case 'en':
default:
this.settingsNotConfiguredText = I18N.EN.COMMON.settingsNotConfigured;
break;
}
}
onTrigger(
@@ -30,22 +44,20 @@ 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 = this.settingsNotConfiguredText;
this.noSettingsNotice = new Notice(noticeText);
}
return null;
}
// min ref length is 6 ('--gen1')
if (cursor.ch < 6) return null;
// min ref length is 5 ('--ex1')
if (cursor.ch < 5) return null;
// must be a passage ref
const isPassage = PassageReference.regExp.test(line);
@@ -68,12 +80,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 +96,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 +139,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 +231,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 +249,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,76 +287,79 @@ 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(/^(?:> |- )/gm, '');
text = text.replace(
/<span style='font-variant: small-caps;'>Lord<\/span>/g,
"Lord"
/<span(?:\s+\w+=['"][^'"]+['"])*>([^<]+)<\/span>/g,
'$1'
);
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. */
private formatTexts(
texts: string[],
passageRef: PassageReference,
context: EditorSuggestContext
texts: string[],
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;
}
}
@@ -356,7 +367,7 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
return formatted;
}
/** Generates a link to the passage within the vault. */
/** Generates a link to the passage within the vault. */
private generatePassageLink(
ref: PassageReference,
context: EditorSuggestContext
@@ -372,7 +383,7 @@ export default class PassageSuggest extends EditorSuggest<PassageSuggestion> {
this.settings.bibleFormat === BibleFormat.BibleLinker
? `#${startVerse}`
: undefined,
ref.stringify(),
ref.stringify()
);
}
}

View File

@@ -1,28 +1,28 @@
import { AbstractInputSuggest, App, TFolder } from "obsidian";
import { AbstractInputSuggest, App, TFolder } from 'obsidian';
export default class PathSuggest extends AbstractInputSuggest<string> {
private textInputEl: HTMLInputElement | HTMLDivElement;
private textInputEl: HTMLInputElement | HTMLDivElement;
constructor(app: App, textInputEl: HTMLInputElement | HTMLDivElement) {
super(app, textInputEl);
this.textInputEl = textInputEl;
}
constructor(app: App, textInputEl: HTMLInputElement | HTMLDivElement) {
super(app, textInputEl);
this.textInputEl = textInputEl;
}
async getSuggestions(query: string): Promise<string[]> {
query ||= '/';
const folder = this.app.vault.getFolderByPath(query);
if (!folder) return [];
return folder.children
.filter(c => c instanceof TFolder)
.map(f => f.path);
}
async getSuggestions(query: string): Promise<string[]> {
query ||= '/';
const folder = this.app.vault.getFolderByPath(query);
if (!folder) return [];
return folder.children
.filter((c) => c instanceof TFolder)
.map((f) => f.path);
}
renderSuggestion(item: string, el: HTMLElement): void {
el.setText(item);
}
renderSuggestion(item: string, el: HTMLElement): void {
el.setText(item);
}
selectSuggestion(item: string, _: MouseEvent | KeyboardEvent): void {
this.setValue(item);
this.textInputEl.dispatchEvent(new Event('input'));
}
selectSuggestion(item: string, _: MouseEvent | KeyboardEvent): void {
this.setValue(item);
this.textInputEl.dispatchEvent(new Event('input'));
}
}

View File

@@ -1,39 +1,39 @@
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;
defaultVersionShorthand: string;
defaultPassageFormat: PassageFormat;
bibleFormat: BibleFormat;
quote: {
includeReference: boolean;
referencePosition: QuoteReferencePosition;
linkToPassage: boolean;
},
callout: {
type: CalloutType;
linkToPassage: boolean;
}
biblesPath: string;
defaultVersionShorthand: string;
defaultPassageFormat: PassageFormat;
bibleFormat: BibleFormat;
quote: {
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,30 +1,34 @@
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;
private settings: LocalBibleRefSettings;
private textInputEl: HTMLInputElement | HTMLDivElement;
constructor(app: App, textInputEl: HTMLInputElement | HTMLDivElement, settings: LocalBibleRefSettings) {
super(app, textInputEl);
this.textInputEl = textInputEl;
this.settings = settings;
}
constructor(
app: App,
textInputEl: HTMLInputElement | HTMLDivElement,
settings: LocalBibleRefSettings
) {
super(app, textInputEl);
this.textInputEl = textInputEl;
this.settings = settings;
}
async getSuggestions(): Promise<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);
}
async getSuggestions(): Promise<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);
}
renderSuggestion(item: string, el: HTMLElement): void {
el.setText(item);
}
renderSuggestion(item: string, el: HTMLElement): void {
el.setText(item);
}
selectSuggestion(item: string, _: MouseEvent | KeyboardEvent): void {
this.setValue(item);
this.textInputEl.dispatchEvent(new Event('input'));
}
selectSuggestion(item: string, _: MouseEvent | KeyboardEvent): void {
this.setValue(item);
this.textInputEl.dispatchEvent(new Event('input'));
}
}

View File

@@ -1,3 +1,3 @@
div.setting-item.local-bible-ref-hidden {
display: none;
display: none;
}

View File

@@ -1,24 +1,17 @@
{
"compilerOptions": {
"baseUrl": ".",
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7"
]
},
"include": [
"**/*.ts"
]
"compilerOptions": {
"baseUrl": ".",
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": ["DOM", "ES5", "ES6", "ES7"]
},
"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'));