Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Books that start with numerals #50

Closed
SamejSpenser opened this issue Jul 24, 2022 · 21 comments
Closed

Books that start with numerals #50

SamejSpenser opened this issue Jul 24, 2022 · 21 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@SamejSpenser
Copy link

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.

@tim-hub tim-hub added the bug Something isn't working label Jul 25, 2022
@tim-hub tim-hub self-assigned this Jul 25, 2022
@tim-hub tim-hub added this to the Get feedback and polish milestone Jul 25, 2022
@tim-hub
Copy link
Owner

tim-hub commented Jul 25, 2022

Surely this is a bug.

Thanks for the feedback, and Ctrl+P

That is a good idea.

@tim-hub tim-hub added the enhancement New feature or request label Jul 25, 2022
@tim-hub
Copy link
Owner

tim-hub commented Jul 26, 2022

Would u mind trying it in new version, 1.1.4

I found it works on my side now.

@tim-hub tim-hub removed the enhancement New feature or request label Jul 26, 2022
@SamejSpenser
Copy link
Author

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!

@jhonatasFernandes
Copy link

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

@jhonatasFernandes
Copy link

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

@tim-hub
Copy link
Owner

tim-hub commented Sep 2, 2022

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

@jhonatasFernandes
Copy link

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

@SamejSpenser
Copy link
Author

SamejSpenser commented Sep 2, 2022

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

@tim-hub
Copy link
Owner

tim-hub commented Sep 3, 2022

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.

@SamejSpenser
Copy link
Author

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:https://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>';
}

@stale
Copy link

stale bot commented Nov 2, 2022

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 stale bot added the wontfix This will not be worked on label Nov 2, 2022
@stale stale bot closed this as completed Nov 9, 2022
@SamejSpenser
Copy link
Author

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

@tim-hub tim-hub reopened this Nov 14, 2022
@stale stale bot removed the wontfix This will not be worked on label Nov 14, 2022
@seckt0r
Copy link

seckt0r commented Nov 25, 2022

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/

@SamejSpenser
Copy link
Author

(…) 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! 😉

@JPT62089
Copy link
Contributor

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

@SamejSpenser
Copy link
Author

SamejSpenser commented Jan 12, 2023

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

@JPT62089
Copy link
Contributor

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.

@SamejSpenser
Copy link
Author

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

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

@stale
Copy link

stale bot commented Mar 13, 2023

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 stale bot added the wontfix This will not be worked on label Mar 13, 2023
@tim-hub tim-hub removed the wontfix This will not be worked on label Mar 13, 2023
@stale
Copy link

stale bot commented May 12, 2023

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 stale bot added the wontfix This will not be worked on label May 12, 2023
@tim-hub
Copy link
Owner

tim-hub commented May 13, 2023

Close this for now, since same issue as #66

@tim-hub tim-hub closed this as completed May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
Status: Done
Development

No branches or pull requests

5 participants