%titlecase_proper{} - a better %title{} template function with configurability #4007
trapd00r
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Super awesome! Let us know if you need help figuring out the configuration system to realize that last to-do item. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So it all started here.
I wasn't happy with the way the
%title{}
template function worked and tried various things until I came up with a simple plugin that simply used the titlecase library.It works great with titlecasing everything that should be titlecased (New York Times Manual of Style) while leaving short words alone (a, and, for...).
However, I still wasn't completely satisfied though; at times there are words that should neither be titlecased, uppercased or lowercased but rather have a specific casing: for example the acronym 'PhD'. So I whipped up some more code and now the plugin can read ~/.beets_titlecase, where words are defined one per line, and their case will never be changed. Let's check it out:
The plugin is available here.
I'm still new to the world of python, so on the todo list is to replace the configuration file with ability to read a list of words to not be touched from
config.yaml
: https://beets.readthedocs.io/en/stable/dev/plugins.html#read-configuration-optionsBeta Was this translation helpful? Give feedback.
All reactions