aboutsummaryrefslogtreecommitdiff
path: root/ekdosis.dtx
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2019-04-26 18:11:44 +0200
committerRobert Alessi <alessi@robertalessi.net>2019-04-26 18:11:44 +0200
commit7aa2b0c21de0f45a4e350893077d706ad678d25b (patch)
treea04c18ede95b8b09bb7d6ad5e5ac0b4eae61bfbc /ekdosis.dtx
parentff786c88dd442a9744f33fe36cf28fdd9be0368e (diff)
downloadekdosis-7aa2b0c21de0f45a4e350893077d706ad678d25b.tar.gz
renamed ekdosis.textotei() to local function textotei(). set tei_p_open to true before passing str on to textotei()
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r--ekdosis.dtx30
1 files changed, 15 insertions, 15 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 056d13e..e612149 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -998,7 +998,7 @@ local function cmdtotei(str)
998 return str 998 return str
999end 999end
1000 1000
1001function ekdosis.textotei(str) 1001local function textotei(str)
1002 str = xml_entities(str) 1002 str = xml_entities(str)
1003 if tei_p_open 1003 if tei_p_open
1004 then 1004 then
@@ -1040,8 +1040,8 @@ function ekdosis.openteistream()
1040 f:write("<listWit>", "\n") 1040 f:write("<listWit>", "\n")
1041 for i = 1,#listWit do 1041 for i = 1,#listWit do
1042 f:write('<witness xml:id=\"', listWit[i].xmlid, "\">", "\n") 1042 f:write('<witness xml:id=\"', listWit[i].xmlid, "\">", "\n")
1043 f:write('<abbr type="siglum">', ekdosis.textotei(listWit[i].abbr), "</abbr>", "\n") 1043 f:write('<abbr type="siglum">', textotei(listWit[i].abbr), "</abbr>", "\n")
1044 f:write(ekdosis.textotei(listWit[i].detailsDesc), "\n") 1044 f:write(textotei(listWit[i].detailsDesc), "\n")
1045 f:write("<msDesc>", "\n") 1045 f:write("<msDesc>", "\n")
1046 if listWit[i].msIdentifier.settlement == "" 1046 if listWit[i].msIdentifier.settlement == ""
1047 and listWit[i].msIdentifier.repository == "" 1047 and listWit[i].msIdentifier.repository == ""
@@ -1052,16 +1052,16 @@ function ekdosis.openteistream()
1052 else 1052 else
1053 f:write("<msIdentifier>", "\n") 1053 f:write("<msIdentifier>", "\n")
1054 if listWit[i].msIdentifier.settlement ~= "" then 1054 if listWit[i].msIdentifier.settlement ~= "" then
1055 f:write("<settlement>", ekdosis.textotei(listWit[i].msIdentifier.settlement), "</settlement>", "\n") 1055 f:write("<settlement>", textotei(listWit[i].msIdentifier.settlement), "</settlement>", "\n")
1056 else end 1056 else end
1057 if listWit[i].msIdentifier.repository ~= "" then 1057 if listWit[i].msIdentifier.repository ~= "" then
1058 f:write("<repository>", ekdosis.textotei(listWit[i].msIdentifier.repository), "</repository>", "\n") 1058 f:write("<repository>", textotei(listWit[i].msIdentifier.repository), "</repository>", "\n")
1059 else end 1059 else end
1060 if listWit[i].msIdentifier.idno ~= "" then 1060 if listWit[i].msIdentifier.idno ~= "" then
1061 f:write("<idno>", ekdosis.textotei(listWit[i].msIdentifier.idno), "</idno>", "\n") 1061 f:write("<idno>", textotei(listWit[i].msIdentifier.idno), "</idno>", "\n")
1062 else end 1062 else end
1063 if listWit[i].msIdentifier.msName ~= "" then 1063 if listWit[i].msIdentifier.msName ~= "" then
1064 f:write("<msName>", ekdosis.textotei(listWit[i].msIdentifier.msName), "</msName>", "\n") 1064 f:write("<msName>", textotei(listWit[i].msIdentifier.msName), "</msName>", "\n")
1065 else end 1065 else end
1066 f:write("</msIdentifier>", "\n") 1066 f:write("</msIdentifier>", "\n")
1067 end 1067 end
@@ -1071,16 +1071,16 @@ function ekdosis.openteistream()
1071 while listWit[i].handDesc[j] 1071 while listWit[i].handDesc[j]
1072 do 1072 do
1073 f:write("<handDesc xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n") 1073 f:write("<handDesc xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n")
1074 -- f:write('<p><abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr></p>", "\n") 1074 -- f:write('<p><abbr type="siglum">', textotei(listWit[i].handDesc[j].abbr), "</abbr></p>", "\n")
1075 if listWit[i].handDesc[j].handNote == "" 1075 if listWit[i].handDesc[j].handNote == ""
1076 then 1076 then
1077 f:write('<handNote><abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr></handNote>", "\n") 1077 f:write('<handNote><abbr type="siglum">', textotei(listWit[i].handDesc[j].abbr), "</abbr></handNote>", "\n")
1078 else 1078 else
1079 f:write("<handNote>", "\n") 1079 f:write("<handNote>", "\n")
1080 f:write('<abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n") 1080 f:write('<abbr type="siglum">', textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n")
1081 f:write("<p>", ekdosis.textotei(listWit[i].handDesc[j].handNote), "</p>", "\n") 1081 f:write("<p>", textotei(listWit[i].handDesc[j].handNote), "</p>", "\n")
1082 f:write("</handNote>", "\n") 1082 f:write("</handNote>", "\n")
1083 -- f:write("<handNote>\n<p>", ekdosis.textotei(listWit[i].handDesc[j].handNote), "</p>\n</handNote>", "\n") 1083 -- f:write("<handNote>\n<p>", textotei(listWit[i].handDesc[j].handNote), "</p>\n</handNote>", "\n")
1084 end 1084 end
1085 j = j + 1 1085 j = j + 1
1086 f:write("</handDesc>", "\n") 1086 f:write("</handDesc>", "\n")
@@ -1090,12 +1090,12 @@ function ekdosis.openteistream()
1090 if listWit[i].history ~= nil then 1090 if listWit[i].history ~= nil then
1091 f:write("<history>", "\n") 1091 f:write("<history>", "\n")
1092 f:write("<origin>", "\n") 1092 f:write("<origin>", "\n")
1093 f:write("<origDate>", ekdosis.textotei(listWit[i].history.origin.origDate), "</origDate>", "\n") 1093 f:write("<origDate>", textotei(listWit[i].history.origin.origDate), "</origDate>", "\n")
1094 f:write("</origin>", "\n") 1094 f:write("</origin>", "\n")
1095 f:write("</history>", "\n") 1095 f:write("</history>", "\n")
1096 end 1096 end
1097 -- if listWit[i].detailsDesc == "" then else 1097 -- if listWit[i].detailsDesc == "" then else
1098 -- f:write("<p>", ekdosis.textotei(listWit[i].detailsDesc), "</p>", "\n") 1098 -- f:write("<p>", textotei(listWit[i].detailsDesc), "</p>", "\n")
1099 -- end 1099 -- end
1100 f:write("</msDesc>", "\n") 1100 f:write("</msDesc>", "\n")
1101 f:write("</witness>", "\n") 1101 f:write("</witness>", "\n")
@@ -1159,9 +1159,9 @@ end
1159 1159
1160function ekdosis.exporttei(str) 1160function ekdosis.exporttei(str)
1161 local f = io.open(teifilename.."_tmp.xml", "a+") 1161 local f = io.open(teifilename.."_tmp.xml", "a+")
1162 str = ekdosis.textotei(str)
1163 f:write("\n<p>") 1162 f:write("\n<p>")
1164 tei_p_open = true 1163 tei_p_open = true
1164 str = textotei(str)
1165 f:write(str) 1165 f:write(str)
1166 if tei_p_open 1166 if tei_p_open
1167 then 1167 then