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

Missa Version names (new try) & ePUB conformity with macOS #4099

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions standalone/tools/epubgen2/Ehoras.setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$priest='0';;
$building='0';;
$lang1='Latin';;
$psalmvar='0';;
$whitebground='0';;
$blackfont='black';;
$smallblack='82 black';;
Expand All @@ -12,13 +13,18 @@ $smallfont='63 red';;
$titlefont='113 red';;
$screenheight='1024';;
$textwidth='80';;
$oldhymns='0';;
$nonumbers='0';;
$nofancychars='0';;
$noinnumbers='1';;
$noflexa='0';;

[parameterscheck]
bbtbtcccccccnn
bbtbbtcccccccnnbbbbb

[general]
$expand='psalms';;
$version='Rubrics 1960';;
$version='Rubrics 1960 - 1960';;
$lang2='English';;
$accented='plain';;

Expand Down
38 changes: 38 additions & 0 deletions standalone/tools/epubgen2/Emissa.setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[parameters]
$pope='(nomen Papae),(name of Pope)';;
$bishop='(nomen Episcopi),(name of Bishop)';;
$lang1='Latin';;
$whitebground='1';;
$blackfont='black';;
$smallblack='82 black';;
$redfont=' italic red';;
$initiale='150 bold italic red';;
$largefont='113 bold italic red';;
$smallfont='63 red';;
$titlefont='113 red';;
$screenheight='1024';;
$textwidth='80';;
$nofancychars='0';;
$building='0';;

[parameterscheck]
ttobcccccccnnbb

[general]
$version='Rubrics 1960 - 1960';;
$lang2='English';;
$votive='Hodie';;
$rubrics='1';;
$solemn='0';;

[generalcheck]
ooobb

[generalc]
$version1='Rubrics 1960 - 1960';;
$version2='New Mass';;
$lang1='Latin';;
$lang2='Latin';;

[generalccheck]
oooo
35 changes: 21 additions & 14 deletions standalone/tools/epubgen2/EofficiumXhtml.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package main;
#use CGI::Cookie;;
use CGI::Carp qw(fatalsToBrowser);
use File::Basename;
use LWP::Simple;
use Time::Local;

#use DateTime;
Expand All @@ -34,9 +33,16 @@ package main;
our $Hk = 0;
our $Ck = 0;
our $officium = 'Eofficium.pl';
our $version = 'Rubrics 1960';
our $version = 'Rubrics 1960 - 1960';

@versions = ('Trident 1570', 'Trident 1910', 'Divino Afflatu', 'Reduced 1955', 'Rubrics 1960', '1960 Newcalendar');
@versions = (
'Trident - 1570',
'Trident - 1910',
'Divino Afflatu - 1954',
'Reduced - 1955',
'Rubrics 1960 - 1960',
'Rubrica 1960 - 2020 USA/Rubrics 1960 Newcalendar',
);

#***common variables arrays and hashes
#filled getweek()
Expand Down Expand Up @@ -73,13 +79,14 @@ package main;
$Bin = "$Bin/../../../web/cgi-bin/horas";
}

require "$Bin/do_io.pl";
require "$Bin/../DivinumOfficium/do_io.pl";
require "$Bin/../DivinumOfficium/SetupString.pl";
require "$Bin/horascommon.pl";
require "$Bin/dialogcommon.pl";
require "$Bin/../DivinumOfficium/dialogcommon.pl";

require "$Bin/setup.pl";
require "$Bin/../DivinumOfficium/setup.pl";
require "$Bin/horas.pl";
require "$Bin/horasscripts.pl";
require "$Bin/specials.pl";
require "$Bin/specmatins.pl";

Expand Down Expand Up @@ -214,7 +221,7 @@ ()

#setcookies('horasgp', 'general');
}
if (!$version) { $version = 'Rubrics 1960'; }
if (!$version) { $version = 'Rubrics 1960 - 1960'; }
if (!$lang2) { $lang2 = 'English'; }
$only = ($lang1 =~ $lang2) ? 1 : 0;

Expand Down Expand Up @@ -310,7 +317,7 @@ ()
<a href="$date1-3-Prima.html">Prima</a>
&nbsp;&nbsp;
<a href="$date1-4-Tertia.html">Tertia</a>
<br />
<br/>
<a href="$date1-5-Sexta.html">Sexta</a>
&nbsp;&nbsp;
<a href="$date1-6-Nona.html">Nona</a>
Expand All @@ -334,7 +341,7 @@ ()

if ($linkmissa) {
print << "PrintTag";
<br />
<br/>
<a href="$date1-9-Missa.html">Missa</a>
PrintTag
}
Expand Down Expand Up @@ -373,9 +380,9 @@ sub headline {
}

print << "PrintTag";
<p class="cen"><span class="$daycolorclass">$headline<br /></span>
$comment<br /><br />
<span class="c">$h</span>&nbsp;&nbsp;&nbsp;
<p class="cen"><span class="$daycolorclass">$headline<br/></span>
$comment<br/><br/>
<span class="c">$h</span>&ensp;
<a href="$datep-1-Matutinum.html">&darr;</a>
$date1
<a href="$daten-1-Matutinum.html">&uarr;</a>
Expand All @@ -388,7 +395,7 @@ sub headline {
<a href="$date1-3-Prima.html">Prima</a>
&nbsp;&nbsp;
<a href="$date1-4-Tertia.html">Tertia</a>
<br />
<br/>
<a href="$date1-5-Sexta.html">Sexta</a>
&nbsp;&nbsp;
<a href="$date1-6-Nona.html">Nona</a>
Expand All @@ -400,7 +407,7 @@ sub headline {

if ($linkmissa) {
print << "PrintTag";
<br />
<br/>
<a href="$date1-9-Missa.html">Missa</a>
PrintTag
}
Expand Down
12 changes: 6 additions & 6 deletions standalone/tools/epubgen2/Ewebdia.pl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ sub setup {

if ($parmode[$i] =~ /^label/i) {
my $ilabel = $parvalue[$i];
if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "<BR />\n"); }
if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "<br/>\n"); }
$input .= "$ilabel";
$input .= "<INPUT TYPE=HIDDEN NAME=\'I$k\' VALUE=\'$parvalue[$i]\'>\n";

Expand Down Expand Up @@ -157,7 +157,7 @@ sub setup {
do_write("$datafolder/gen/$savefile.gen", $pv);
}

$input .= "<TEXTAREA NAME=\'I$k\' ID=\'I$k\' COLS=$size[1] ROWS=$size[0]>$pv</TEXTAREA><BR />\n";
$input .= "<TEXTAREA NAME=\'I$k\' ID=\'I$k\' COLS=$size[1] ROWS=$size[0]>$pv</TEXTAREA><br/>\n";
$input .= "<A HREF='#' onclick='loadrut();'>";
$input .= setfont($dialogfont) . "Load</FONT></A>";

Expand Down Expand Up @@ -444,7 +444,7 @@ sub setvrbar {
# #remove auxiliary characters
# $text =~ s/wait[0-9]+//ig;
# $text =~ s/\_/ /g;
# $text =~ s/\{\:.*?\:\}(<BR />)*\s*//g;
# $text =~ s/\{\:.*?\:\}(<br/>)*\s*//g;
# $text =~ s/\{\:.*?\:\}//sg;
# $text =~ s/\`//g;
#
Expand Down Expand Up @@ -496,7 +496,7 @@ sub setvrbar {
# #$htmltext .= setfont($blackfont,$text) . "</DIV>\n";
# #if ($only || !columnsel($lang)) {$htmltext .= "</DIV>\n";}
#
# $text =~ s/<BR>/<br \/>/sg;
# $text =~ s/<BR>/<br\/>/sg;
#
# #$text =~ s/\n//g;
# print $text;
Expand Down Expand Up @@ -542,8 +542,8 @@ sub longtd {
my $a1 = shift;
my $a2 = shift;

my @a1 = split('<BR />', $a1);
my @a2 = split('<BR />', $a2);
my @a1 = split('<br/>', $a1);
my @a2 = split('<br/>', $a2);
my @b1 = splice(@b1, @b1);
my @b2 = splice(@b2, @b2);
my $i;
Expand Down
38 changes: 19 additions & 19 deletions standalone/tools/epubgen2/epubgen2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OPTIONS:
-m Generate Mass propers in addition to office texts.

-r RUBRICS The rubrics to use. Defaults to 1960.
Supported values are: 1570, 1910, DA, 1955, 1960, Newcal, Dominican, Monastic
Supported values are: 1570, 1910, DA, 1955, 1960, Newcal, Dominican

-c FILENAME The cover image to use without path. It must be a file in the data
directory. Defaults to "cover.jpg".
Expand All @@ -66,16 +66,16 @@ CDUR=$(pwd)
EPUBDIR=$CDUR/output #output directory, defaults to "output" subdirectory in the folder this script is in.
COVER_FILENAME=cover.jpg #a jpg file name to serve as cover (it has to exist in SOURCEDATADIR) #ascensio.jpg
RUBRICS_CODE=1960
RUBRICS=Rubrics%201960
RUBRICS=Rubrics%201960%20%2D%201960
RUBRICS_NAME=
NOFANCYCHARS=1 #0 or 1; when 1, "fancy" characters such as ℟ ℣ +︎ ✠ ✙︎ are replaced with R. V. + + +
OPTIONAL_KINDLEGEN_PATH=/usr/local/bin/kindlegen #full path to kindlegen executable, if exists, used to convert the resulting EPUB files to MOBI format as well

#constants
#supported rubrics as in Eofficium.pl
ALL_RUBRICS_CODES=(Monastic 1570 1910 DA 1955 1960 Newcal Dominican)
ALL_RUBRICS=("Monastic" "Tridentine 1570" "Tridentine 1910" "Divino Afflatu" "Reduced 1955" "Rubrics 1960" "1960 Newcalendar" "Ordo Praedicatorum")
ALL_RUBRICS_NAME=("_Monastic" "_1570" "_1910" "_DA" "_1955" "" "NC")
ALL_RUBRICS_CODES=(1570 1910 DA 1955 1960 Newcal Dominican)
ALL_RUBRICS=("Tridentine - 1570" "Tridentine - 1910" "Divino Afflatu - 1954" "Reduced - 1955" "Rubrics 1960 - 1960" "Rubrics 1960 - 2020 USA" "Ordo Praedicatorum - 1962")
ALL_RUBRICS_NAME=("_1570" "_1910" "_DA" "_1955" "" "NC" "OP")

YEAR_RE='^[0-9]+$'

Expand Down Expand Up @@ -317,10 +317,10 @@ generateHour() {
}

generateHours() {
echo -e "\e[1m:: Starting to generate hours\e[0m"
echo -e "\033[1m:: Starting to generate hours\033[0m"
foreachHourInRange generateHour
echo ""
echo -e "\e[1m:: Finished the generation of hours\e[0m"
echo -e "\033[1m:: Finished the generation of hours\033[0m"
}


Expand Down Expand Up @@ -385,15 +385,15 @@ outputYearToFile() {


generateTOCs() {
echo -e "\e[1m:: Starting to create TOCs\e[0m"
echo -e "\033[1m:: Starting to create TOCs\033[0m"

#generate OPF per month
foreachMonthInRange outputMonthToFile

#generate OPF per year
foreachYear outputYearToFile

echo -e "\e[1m:: Finished the creating of TOCs\e[0m"
echo -e "\033[1m:: Finished the creating of TOCs\033[0m"
}

#################################################################################################################
Expand Down Expand Up @@ -423,7 +423,7 @@ printf '<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuid_id" version="2.0">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/">
<meta name="cover" content="cover"/><dc:date>'
date --iso-8601
date +"%Y-%m-%dT%H:%M:%S:%z"
printf "</dc:date><dc:title>Breviarium $1</dc:title>
<dc:creator>Divinum Officium</dc:creator>
<dc:publisher></dc:publisher>
Expand Down Expand Up @@ -491,15 +491,15 @@ outputYearToFileOPF() {
}

generateOPF() {
echo -e "\e[1m:: Starting to create OPFs\e[0m"
echo -e "\033[1m:: Starting to create OPFs\033[0m"

#generate OPF per month
foreachMonthInRange outputMonthToFileOPF

#generate OPF per year
foreachYear outputYearToFileOPF

echo -e "\e[1m:: Finished the creating of OPFs\e[0m"
echo -e "\033[1m:: Finished the creating of OPFs\033[0m"
}

#Expects OPF_FILENAME to be set.
Expand Down Expand Up @@ -679,11 +679,11 @@ createEPUBYear() {
}

createEPUBs() {
echo -e "\e[1m:: Starting to create EPUBs for each month\e[0m"
echo -e "\033[1m:: Starting to create EPUBs for each month\033[0m"
foreachMonthInRange createEPUBMonth
echo -e "\e[1m:: Starting to create EPUBs for each year\e[0m"
echo -e "\033[1m:: Starting to create EPUBs for each year\033[0m"
foreachYear createEPUBYear
echo -e "\e[1m:: Finished the creation of EPUBs\e[0m"
echo -e "\033[1m:: Finished the creation of EPUBs\033[0m"
}


Expand All @@ -704,13 +704,13 @@ convertMOBIYear() {
createMOBIs() {
if [[ ! -e "$OPTIONAL_KINDLEGEN_PATH" ]]
then
echo "\e[1m:: KindleGen not found in $OPTIONAL_KINDLEGEN_PATH, skipping the conversion to of MOBI format. \e[0m"
echo "\033[1m:: KindleGen not found in $OPTIONAL_KINDLEGEN_PATH, skipping the conversion to of MOBI format. \033[0m"
else
echo -e "\e[1m:: Starting the conversion to MOBI format for each month\e[0m"
echo -e "\033[1m:: Starting the conversion to MOBI format for each month\033[0m"
foreachMonthInRange convertMOBIMonth
echo -e "\e[1m:: Starting the conversion to MOBI format for each year\e[0m"
echo -e "\033[1m:: Starting the conversion to MOBI format for each year\033[0m"
foreachYear convertMOBIYear
echo -e "\e[1m:: Finished the conversion to MOBI format\e[0m"
echo -e "\033[1m:: Finished the conversion to MOBI format\033[0m"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion web/cgi-bin/DivinumOfficium/FileIO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use warnings;
BEGIN {

package DivinumOfficium::FileIO;
require "horas/do_io.pl";
require "DivinumOfficium/do_io.pl";
}

BEGIN {
Expand Down
30 changes: 29 additions & 1 deletion web/cgi-bin/DivinumOfficium/RunTimeOptions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,42 @@ use constant LEGACY_VERSION_NAMES => {
'Reduced 1955' => 'Reduced - 1955',
'Monastic' => 'Monastic - 1963',
'1960 Newcalendar' => 'Rubrics 1960 - 2020 USA',
'Dominican' => 'Ordo Praedicatorum - 1962',

# safeguard switch from missa to horas
'Tridentine - 1910' => 'Tridentine - 1906',
'Ordo Praedicatorum Dominican 1962' => 'Ordo Praedicatorum - 1962',
'Rubrics 1960 Newcalendar' => 'Rubrics 1960 - 2020 USA',
};

use constant LEGACY_MISSA_VERSION_NAMES => {
'Tridentine 1570' => 'Tridentine - 1570',
'Tridentine 1910' => 'Tridentine - 1910',
'Rubrics 1960' => 'Rubrics 1960 - 1960',
'Reduced 1955' => 'Reduced - 1955',
'1960 Newcalendar' => 'Rubrics 1960 - 2020 USA',
'Dominican' => 'Ordo Praedicatorum Dominican 1962',

# safeguard switch from horas to missa
'Monastic Tridentinum 1617' => 'Tridentine - 1570',
'Monastic Divino 1930' => 'Divino Afflatu - 1954',
'Monastic - 1963' => 'Rubrics 1960 - 1960',
'Tridentine - 1888' => 'Tridentine - 1910',
'Tridentine - 1906' => 'Tridentine - 1910',
'Ordo Praedicatorum - 1962' => 'Ordo Praedicatorum Dominican 1962',
};

# exported

sub check_version {
my $v = shift;
my $missa = shift;

LEGACY_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
if (!$missa) {
return LEGACY_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
} else {
return LEGACY_MISSA_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
}
}

sub check_horas {
Expand Down
File renamed without changes.
File renamed without changes.
Loading