tim-hub / obsidian-bible-reference

Take Bible Study notes easily in the popular note-taking app Obsidian, with automatic verse and reference suggestions.
https://antioch.tech/obsidian-bible-reference/
MIT License
225 stars 41 forks source link

Allow templated strings instead of options for customizing verse callout format #109

Closed brennenputh closed 6 months ago

brennenputh commented 1 year ago

With all the customization that needs to be provided to allow users the freedom to format how they want, the configuration options will quickly explode in size. This PR instead implements a template system for the header and footer, allowing much greater flexibility for less configuration options.

Pain points are mainly related to moving from the old system to the new one, but are not extensive. A problem that is difficult to address is whether the collapsible verses option should still be around or be replaced by this system. A hackfix is implemented here, but it is not a great fix.

Unfinished aspects of this PR:

brennenputh commented 1 year ago

I have finished the migration code. Consider this a call for testers, this is ready for anyone who's willing.

ajrty33 commented 1 year ago

I have finished the migration code. Consider this a call for testers, this is ready for anyone who's willing.

I'll test it out! Until then, it looks like > [!Bible] is left out of the customization? If that is added as a header option, then it can be removed to allow a minimal output that just shows up like a quote like:

Verse text Verse reference

brennenputh commented 1 year ago

I considered adding it to the format string by default, but was unsure. If that's a desired feature, it's not hard to make configurable. My thought was that it just makes the string longer.

brennenputh commented 1 year ago

The callout prefixes are now in the customization - both for the header and the footer. Also, added a nice bright red warning on the migrator.

RandomUserWithInternet commented 1 year ago

What is the purpose of > [!Bible]?

brennenputh commented 1 year ago

What is the purpose of > [!Bible]?

https://help.obsidian.md/Editing+and+formatting/Callouts

tim-hub commented 1 year ago

Thanks for all of this, I will try to give it a test too by weekends.

brennenputh commented 1 year ago

New task that needs completed:

I'm moving atm, so I may not be able to do much for a week or two. I don't believe it is the largest problem to block merge, but certainly something that should be done.

brennenputh commented 1 year ago

I have added a basic auto migration trigger, however it is quite basic and will run when a user has installed the plugin for the first time.

tim-hub commented 1 year ago

Again, thanks so much for the contribution,

Please excuse me, as the project main maintainer, I have to be very careful to approve such a big settings change.

Personally, I like KISS too both in codes and UI, codes should be simple for dev, UI should be clear for users.

I left some comments and requests to changes. The Requests to Changes are big too. As I said above, there are some risk above, I have to be careful

brennenputh commented 1 year ago

I am going to remove the additions to the README, as it seems that similar content has moved to the wiki. For reference, below is the markdown block that was added to the README to explain the formatting options.

### Formatting Strings

These are special substitutions used in the formatting settings.

| Template String          | Substitution                 |
|--------------------------|------------------------------|
| {{bible_version}}        | Current Bible version        |
| {{book}}                 | Name of the quoted book      |
| {{chapter}}              | Number of the quoted chapter |
| {{verse_range}}          | Range of quoted verses       |
| {{verse_reference_link}} | Link to the API reference    |
| {{content}}              | The verse content            |
brennenputh commented 1 year ago

(note - not ready for re-review yet, I wasn't expecting the merge to be as large as it was)

brennenputh commented 1 year ago

I believe the main blocker here is still the old formatting settings and what is happening with them - is this correct? I don't believe it makes sense to have both types even if one is hidden behind a toggle, as all functions of the older type can be served by the newer with a basic understanding of markdown and templating syntax (and are easy to migrate on startup). That said, I do understand the desire for simpler settings, and so I am going to try to create a dialog to let users simply configure the template that resembles the older settings page. Maybe this is a silly idea, but I believe it would be the most straightforward way of simplifying the code.

tim-hub commented 1 year ago

I believe the main blocker here is still the old formatting settings and what is happening with them - is this correct? I don't believe it makes sense to have both types even if one is hidden behind a toggle, as all functions of the older type can be served by the newer with a basic understanding of markdown and templating syntax (and are easy to migrate on startup). That said, I do understand the desire for simpler settings, and so I am going to try to create a dialog to let users simply configure the template that resembles the older settings page. Maybe this is a silly idea, but I believe it would be the most straightforward way of simplifying the code.

In my own opinion,

translator / converter will be better than migrator.


But it is OK to leave it for me for now, I could try to make the settings convertible between old and new.

tim-hub commented 1 year ago

I am going to remove the additions to the README, as it seems that similar content has moved to the wiki. For reference, below is the markdown block that was added to the README to explain the formatting options.

### Formatting Strings

These are special substitutions used in the formatting settings.

| Template String          | Substitution                 |
|--------------------------|------------------------------|
| {{bible_version}}        | Current Bible version        |
| {{book}}                 | Name of the quoted book      |
| {{chapter}}              | Number of the quoted chapter |
| {{verse_range}}          | Range of quoted verses       |
| {{verse_reference_link}} | Link to the API reference    |
| {{content}}              | The verse content            |

Thanks, these is a good table.

If possible, do you mind taking a screenshot for the UI change?

stale[bot] commented 9 months ago

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.

tim-hub commented 9 months ago

I am going to remove the additions to the README, as it seems that similar content has moved to the wiki. For reference, below is the markdown block that was added to the README to explain the formatting options.

### Formatting Strings

These are special substitutions used in the formatting settings.

| Template String          | Substitution                 |
|--------------------------|------------------------------|
| {{bible_version}}        | Current Bible version        |
| {{book}}                 | Name of the quoted book      |
| {{chapter}}              | Number of the quoted chapter |
| {{verse_range}}          | Range of quoted verses       |
| {{verse_reference_link}} | Link to the API reference    |
| {{content}}              | The verse content            |

Maybe something like this.

image

This is from another obsidian plugin

stale[bot] commented 7 months ago

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.