kuchejak / obsidian-bible-linker-plugin

Obsidian.md plugin that allows you to link multiple bible verses easily
MIT License
81 stars 5 forks source link

[Feature/Enhancement Request] Full Book names in displayed links #21

Closed abbasou closed 5 months ago

abbasou commented 2 years ago

Thank you so much for this awesome plugin. It makes my sermon writing that much easier instead of having to copy from a different Bible app and paste, then fix the formatting.

One hopefully small thing I would like is to present the references (Book, chapter, verse(s)) with full book names. The actual link of course has to match whatever the file names are, which are usually a shortened form, especially if folks are like me and just using the BibleGateway-to-Obsidian script to download their Bibles. So basically, the link currently looks like [[Gen 1#1|Gen 1.1]], it would be nice if it was automatically presented as [[Gen1#1|Genesis 1.1]]. Currently it's not that difficult to do a Find & Replace, but I figure a simple script would hopefully be a quick fix. Dunno how you would account for different short forms though. Looks like with the above script at least the folder names are the full name, so maybe look at the parent folder for the link alias?

I would love to contribute such a seemingly small thing myself, but alas, my coding skills are non-existent. Maybe I'll take this little thing as a learning opportunity. Who knows?

kuchejak commented 2 years ago

Hi, 

thank you for reaching out. I will try to look into this one day, but I can not promise it will be any time soon.

The problem also is that there are no requirements for the folder names, and for example the Obsidian Bible Study Kit (which is probably the most popular way to get bible files) does not name folders in a "nice" way (they include numbers so that the folders are displayed in order), so the proposed solution would not work for the majority of people.

potatochick2020 commented 1 year ago

I think a similar "Mapping" Hack that I suggested in another issue (https://github.com/kuchejak/obsidian-bible-linker-plugin/issues/28) could solve this problem too.

We could create a map in settings for user to map filename to the desired output Filename Generated display book name
Gen Genesys
1Cor 1Corinthians

In src/logic/copy-command.ts , we coupld find whether there is an exist mapping for the fileName

if (beginVerse === maxVerse) {
        res += `[[${pathToUse ? pathToUse + "/" : ""}${fileName}#${
            headings[beginVerse].heading
        }|${bookAndChapterOutput}${
            settings.oneVerseNotation
        }${beginVerseNoOffset}]]${postfix}`; // [[Gen 1#1|Gen 1,1.1]]
    } else if (settings.linkEndVerse) {
        res += `[[${pathToUse ? pathToUse + "/" : ""}${fileName}#${
            headings[beginVerse].heading
        }|${bookAndChapterOutput}${
            settings.multipleVersesNotation
        }${beginVerseNoOffset}-]]`; // [[Gen 1#1|Gen 1,1-]]
        res += `[[${pathToUse ? pathToUse + "/" : ""}${fileName}#${
            headings[maxVerse].heading
        }|${maxVerseNoOffset}]]${postfix}`; // [[Gen 1#3|3]]
    } else {
        res += `[[${pathToUse ? pathToUse + "/" : ""}${fileName}#${
            headings[beginVerse].heading
        }|${bookAndChapterOutput}${
            settings.multipleVersesNotation
        }${beginVerseNoOffset}-${maxVerseNoOffset}]]${postfix}`; // [[Gen 1#1|Gen 1,1-3]]
    }

I can do the coding if you approve this features.

kuchejak commented 1 year ago

Hi @potatochick2020, I'm not sure that this would be used by many people because they would have to fill out the dictionary for all the 66 books, which is quite a task. I understand that full book names may sometimes be nicer, but I also think that the shortened form is quite alright.

As I mentioned in #28, I feel like the plugin settings are getting quite overwhelming, so I'm not the biggest fan of adding even more options, but if you are willing to do the coding, then I'm not entirely against it. Just please make sure that the setting description is easily understood. 

abbasou commented 6 months ago

Just coming back to say I appreciate this plugin and how much easier it makes my life. Was wondering if there has been any further discussion or thought about the above proposed solution and setting. I personally would be happy to fill out a dictionary once vs go back and touch up every reference I insert (for some reason it bugs me to have the shortened names). I understand the hesitation to present such a daunting list in the settings, but I believe it would be fairly self-explanatory and easily ignored if the user doesn't want to bother.

kuchejak commented 6 months ago

Hi, there has been no further discussion sadly, @potatochick2020 mentioned he would be willing to do the coding, but I guess they did not find the time yet or doesn't need the functionality anymore. I would like to implement the suggestion from #28 and I could also tackle this one with it, but it will have to wait until my exam period is finished (or maybe the urge to procrastinate will be high enough and I'll do it sooner).

kuchejak commented 5 months ago

I have added the option to the settings. Update to version 1.5.1 to use it.

abbasou commented 5 months ago

Thank you so much. Just took a few minutes to populate the conversion list and everything works beautifully. Such a QOL improvement!