After almost a year of people emailing me and leaving comments, Iâ€™ve finally made the time to update my Scripturizer Perl Module. The changes arenâ€™t big, but they provide dramatic relief to a series of annoyances that have encumbered some of you from adding more Scripture references to your blogs, church websites and other electronically distributed information. I apologize for taking so long to get around to such an important issue.
Addition of Abbreviations:
â€œIt gets a little tedious writing out Deuteronomy every time!â€
Yeah, youâ€™ve said a mouth full. So Iâ€™ve added various abbreviations to the new and improved version. Iâ€™ve done so a more hard-coded format than I like, but the regular expressions are complex enough. I want a novice to be able to look at the existing expressions for Books in the Bible and add or alter their own (expressions) as they need.
This was a painstaking process I automated to some degree with some Perl to split book names after the first three characters, then again at the fourth or fifth character depending on the length and vowel placement. I then went through each of the expressions and added or subtracted based upon a list of common Bible queries over at the ESV Bible. Many thanks to Stephen Smith for directing my attention to this data, it was incredibly helpful!
Finally, I took care of a small handful of typos, involving pluralization. I still need to write a â€œmop-upâ€ option to weed-out typos such as â€œrevalationsâ€ and â€œmathew.â€
Eliminate the addition of a space before non-white space bug.
This bug is exceptionally annoying to those who like to encapsulate their scripture references between brackets or parenthesis, such as (1 John 1:9). So annoying that back last August, Jason Rust left a comment on my blog with a fix. A fix later tried and tested and nicely documented by Joseph Markey.
Essentially, the bug was introduced when evaluating the space between a volume reference, e.g. 1 John 1:9, which in turn put a space in front of a non-volume reference such as John 1:9. The bug occurred when the character directly before the non-volume number scripture reference was anything other than a space.
What the fix does is it pushes the evaluation for the space into a variable, then pushes it in front of the hyperlink. An approach that works much better than a hard-coded space as nothing before the reference is then accurately rendered as nothing just before the hyperlink.
Eliminate the â€˜câ€™ in the gcex modifier in the regular expression.
This regular expression mode modifier did nothing in this context, except possibily eat up CPU and sometimes throw errors in the latest version of Perl.
ESV Bible flip-flop
The great people at the ESV Bible have been so helpful and responsive in the past, I figured why not say thanks in the form of directing those who select the English Standard Version option to the ESV online Bible website.
In MovableType, that would be <$MTBodyEntry scripturize=â€ESVâ€$>
Using Scripturizer as a Perl Module, that would be print scripturize(â€Phil. 4:6-7â€³, â€œESVâ€).
XHTML compliant hyperlinks
Ampersands are now represented as &
Well, this is sorta a no-brainer. For those of you using the MovableType Scripturizer plug-in, leave the file /plugins/Scripturizer.pl alone.
Replace the file /extlib/Sermonizer/Scripture.pm with the referenced code below. That should be it, but first make a backup of the old one just in case.
Here is where I have it set-up on my PC for general purposes using ActiveStateâ€™s Perl Dev Kit: c:\perl\site\lib\Sermonizer\Scripturizer.pm.
Thatâ€™s pretty much it. If you can think of anything else, let me know and weâ€™ll see about adding it.
Otherwise, Iâ€™d like to work on something else Stephen Smith of ESV sent me, a routine that fetches a snippet via their webservice. His code works but I have some MT centric things I want to tackle when slicing-n-dicing an XML stream of Matthew 5. That and I feel a full-blown ESV.pm module coming on. Well, Stephen has already created one, but Iâ€™ve got these ideas â€¦ and this compiler â€¦ well, you get the picture.
There is also a much needed death-blow to typos method subroutine that needs to be written. The question is, do I write it into the same pass, or do I run first a clean-up pass filter, then scripturize? Any thoughts would be appreciated.
Again, thanks to everyone for their input. I couldnâ€™t have done any of this without your valuable input. Even if I could, it wouldnâ€™t have been as much fun.
Download the PM â€¦ Sermonizer::Scripturizer.pm
view it as text: Sermonizer::Scripturizer.pm
Find a bug? Have a suggestion? Leave a comment. Weâ€™ll do our best to see it gets taken care of â€¦ quickly. Get it to me in the next couple of days and Iâ€™ll try to add it as an update to this article.