obsidian-bible-reference icon indicating copy to clipboard operation
obsidian-bible-reference copied to clipboard

Books that start with numerals

Open SamejSpenser opened this issue 1 year ago • 10 comments

Hello @tim-hub.

First of all, congratulations for the excellent plugin. It is essential for my Bible studies! 😉

I'm Brazilian, and I use the João Ferreira de Almeida version in the Obsidian Bible Reference settings. But when I need to insert some verse from books that start with a numbering, the plugin simply does not deliver any pop-up with the desired verse.

For example, 1 Timothy 6:10: I already tried with --1timoteo6:10, --Itimoteo6:10, --itimoteo6:10, --1 Timóteo 6:10, --I Timóteo 6:10, --i timóteo 6:10, --1Timóteo6:10, --ITimóteo6:10, --itimóteo6:10, --1 Timóteo 6.10, --1timoteo6.10, --1ti6:10, --1ti6.10, --1tim6:10, --1tim6.10, --Itim6.10, etc.

I also tried using the name of the book in English, and the result was the same: no reference. Both the Old and New Testament books, as long as they begin with a numeral, have no reference.

Is this a bug, or am I the one who doesn't know how to use the plugin correctly? 🤔

Would it also be possible to add a command accessible through Ctrl + P, where we can insert the desired book and verse so that the plugin pastes it in the position where the cursor is?

Regards, Samej Spenser.

SamejSpenser avatar Jul 24 '22 22:07 SamejSpenser

Surely this is a bug.

Thanks for the feedback, and Ctrl+P

That is a good idea.

tim-hub avatar Jul 25 '22 00:07 tim-hub

Would u mind trying it in new version, 1.1.4

I found it works on my side now.

tim-hub avatar Jul 26 '22 04:07 tim-hub

Would u mind trying it in new version, 1.1.4

I found it works on my side now.

I installed v1.1.4. The bug still remains the same, without any change in what I reported earlier!

SamejSpenser avatar Jul 26 '22 20:07 SamejSpenser

any updates in that bug? i loved the plugin, but cant use for that books...

jhonatasFernandes avatar Aug 27 '22 07:08 jhonatasFernandes

As i've said, i loved that plugin... So, I started debuggin the code, and i figure out what was buggin it.

  1. var shortReg was getting only Chapters with 3 or more letters, so i changed it
  2. const bookName was getting only Chapters with 3 or more letters, so i changed it
  3. the https://bible-api.com API need a space to be between the book number and name, so i created an "if" to check if the book starts with a number, then put a space there
  4. then i change the "const chapterNumber" to const chapterNumber = parseInt(numbers[0].toString().replace(/^\D+/g, "")), to clean the number in the chapter part.

I didnt tested it in all options avaliable, but i think the code bellow could help (i commented what have been changed)

obsidian-bible-reference.zip

jhonatasFernandes avatar Sep 01 '22 02:09 jhonatasFernandes

As i've said, i loved that plugin... So, I started debuggin the code, and i figure out what was buggin it.

1. var shortReg was getting only Chapters with 3 or more letters, so i changed it

2. const bookName was getting only Chapters with 3 or more letters, so i changed it

3. the https://bible-api.com API need a space to be between the book number and name, so i created an "if" to check if the book starts with a number, then put a space there

4. then i change the "const chapterNumber" to const chapterNumber = parseInt(numbers[0].toString().replace(/^\D+/g, "")), to clean the number in the chapter part.

I didnt tested it in all options avaliable, but i think the code bellow could help (i commented what have been changed)

obsidian-bible-reference.zip

Thanks @jhonatasFernandes for the debugging.

Do you mind creating a PR directly to the repo? It will be easy to review and make the update.

Actually you made a very good point, the plugin lacks of E2E test to against the problem

tim-hub avatar Sep 02 '22 01:09 tim-hub

sorry, i don't know how to do that... i actually dont use github haha here is the main.js that i changed:

ps: i also changed the verse design to be as the print bellow main.zip image

jhonatasFernandes avatar Sep 02 '22 19:09 jhonatasFernandes

I edited the CSS of the callouts to display a bible icon when I insert the “![Bible]” snippet, and the result is this one from the print.

image

SamejSpenser avatar Sep 02 '22 21:09 SamejSpenser

I edited the CSS of the callouts to display a bible icon when I insert the “![Bible]” snippet, and the result is this one from the print.

image

This is actually quite nice.

It will be great that making a PR for it. 😂

Otherwise I will try find a time to make the changes.

tim-hub avatar Sep 03 '22 01:09 tim-hub

This is actually quite nice.

It will be great that making a PR for it. joy

Otherwise I will try find a time to make the changes.

I'm very happy to know that you liked it. 😃

I'm not a programmer and, like @jhonatasFernandes, I don't know how to make a pull request. I'm sorry. 😅

What I did there was insert the Bible icon as a CSS snippet in the snippets folder under .obsidian. As for the book name, chapter and verse I manually moved up, simply Ctrl + X / Ctrl + V.

Here's the snippet I used for the icon:

/* Add “Bible” Icon to Callouts */

.callout[data-callout="bible"] {
    --callout-icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M448 336v-288C448 21.49 426.5 0 400 0H96C42.98 0 0 42.98 0 96v320c0 53.02 42.98 96 96 96h320c17.67 0 32-14.33 32-31.1c0-11.72-6.607-21.52-16-27.1v-81.36C441.8 362.8 448 350.2 448 336zM144 144c0-8.875 7.125-15.1 16-15.1L208 128V80c0-8.875 7.125-15.1 16-15.1l32 .0009c8.875 0 16 7.12 16 15.1V128L320 128c8.875 0 16 7.121 16 15.1v32c0 8.875-7.125 16-16 16L272 192v112c0 8.875-7.125 16-16 16l-32-.0002c-8.875 0-16-7.127-16-16V192L160 192c-8.875 0-16-7.127-16-16V144zM384 448H96c-17.67 0-32-14.33-32-32c0-17.67 14.33-32 32-32h288V448z"/></svg>';
}

SamejSpenser avatar Sep 03 '22 01:09 SamejSpenser

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]

Just to remove the “stale”: the impossibility of adding verses from books that start with numerals still persists.

SamejSpenser avatar Nov 13 '22 20:11 SamejSpenser

Running into the very same bug here. But also, let me send a huge thanks to @tim-hub for the great work. This has been invaluable for me. I really hope you can find some time to keep working on this. My workaround so far is to manually copy the text from https://bible-api.com/

seckt0r avatar Nov 25 '22 08:11 seckt0r

(…) My workaround so far is to manually copy the text from https://bible-api.com/

I do almost the same here, but since I spend a lot of time offline, I copy the verses from the Bolls.Life app.

And yes, @tim-hub's work on this plugin is excellent! :wink:

SamejSpenser avatar Dec 10 '22 17:12 SamejSpenser

@SamejSpenser , I assume that you are using a non English/qwerty keyboard with Obsidian? As far as I can tell right now (@tim-hub, feel free to correct me), we're not able to look up references with different languages in the obsidian Bible reference command. Just looking through the code it's only looking for the English book names.

I know you mentioned that you tried English at one point but would you be able to try since there's been a bit of time since you initially mentioned attempting English? The plugin has gone through multiple revisions. Also keep in mind that there are issues with Bolls Life translations right now with mobile devices that will hopefully be resolved soon but until then if you're using a phone or tablet try using a Bible API translation.

Anywho, I look forward to an update when you're able :)

JPT62089 avatar Jan 11 '23 06:01 JPT62089

@SamejSpenser , I assume that you are using a non English/qwerty keyboard with Obsidian? As far as I can tell right now (@tim-hub, feel free to correct me), we're not able to look up references with different languages in the obsidian Bible reference command. Just looking through the code it's only looking for the English book names.

@JPT62089 yes, my keyboard is ABNT2 (my native language is Brazilian Portuguese).

Unfortunately, verse expansion for books starting with numbers doesn't work yet. The other unnumbered books work perfectly, but those started with numerals do not respond to the command, it remains exactly the same as what I reported in the first message above.

And yes, I tested the names of the books in Portuguese and in English. The result was the same as reported there earlier.

SamejSpenser avatar Jan 12 '23 02:01 SamejSpenser

Ahh okie, thank you for clarifying. This is the same issue as #66 as far as the books starting with numbers go. I'm hoping to be able to get a fix out for this at some point. Basically has to do with any of the Bible API translations. I need to check but I think that all the Bible API translations are supported by Bolls Life so I may see what @tim-hub thinks about moving the translations to Bolls Life once we are able to fix mobile issues with Bolls Life.

JPT62089 avatar Jan 12 '23 03:01 JPT62089

Alright, do the updates in your time, no rush.

And thank you very much for the excellent plugin, it really is a masterpiece!

SamejSpenser avatar Jan 12 '23 03:01 SamejSpenser

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 13 '23 20:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 12 '23 23:05 stale[bot]

Close this for now, since same issue as #66

tim-hub avatar May 13 '23 03:05 tim-hub