From 6923c53bbe2fa38e2ea5ae3873df0c9e993a9a7c Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 23 May 2020 11:04:39 +0200
Subject: added type attribute to lem and rdg

---
 ekdosis.dtx | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 9c6a878..dcc4c9b 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -751,7 +751,7 @@ Running "make install" installs the files in the local TeX tree.
     }\unexpanded\expandafter{\ekd@postrefnum}%
   }%
 \define@cmdkeys[ekd]{lemrdg}[ekdlr@]{wit, alt, pre, post, prewit,
-  postwit}
+  postwit, type}
 \define@cmdkey[ekd]{lem}[ekdl@]{sep}{}
 \presetkeys[ekd]{lem}{sep=\ekdsep}{}
 \define@boolkeys[ekd]{lem}[ekdl@]{nolem, nosep}[true]
@@ -1482,7 +1482,7 @@ local cmdtotags = {
    {a="textsc", b="hi", c=" rend=\"smallcaps\""},
    {a="textsf", b="hi", c=" rend=\"sf\""},
    {a="arbup", b="hi", c=" rend=\"sup\""},
-   {a="txarb", b="s", c=" xml:lang=\"ar-arb\""},
+   {a="txarb", b="s", c=" xml:lang=\"arb\""},
    {a="arb", b="s",
     c=" xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\""}
 }
@@ -1496,7 +1496,7 @@ local texpatttotags = {
 local envtotags = {
    {a="ekdverse", b="lg", c=""},
    {a="txarabtr", b="p", c=" xml:lang=\"ar-Latn\" type=\"transliterated\""},
-   {a="txarab", b="p", c=" xml:lang=\"ar-arb\""},
+   {a="txarab", b="p", c=" xml:lang=\"arb\""},
    {a="center", b="p", c=" rend=\"centered\""},
    {a="verse", b="lg", c=""},
    {a="arab", b="p",
@@ -1637,15 +1637,21 @@ local function lem_rdg_totei(str)
 	      function(bkslash, cmd, opt, arg)
 		 opt = string.sub(opt, 2, -2)
 		 arg = string.sub(arg, 2, -2)
-		 opt = get_attr_value(opt, "wit")
+		 -- opt = get_attr_value(opt, "wit")
+		 --
+		 teiwit = get_attr_value(opt, "wit")
+		 if teiwit ~= "" then teiwit = " wit=\""..ekdosis.getsiglum(teiwit, "tei").."\"" else end
+		 teitype = get_attr_value(opt, "type")
+		 if teitype ~= "" then teitype = " type=\""..teitype.."\"" else end
+		 --
 		 if opt == ""
 		 then
 		    return lem_rdg_totei(string.format("<%s>%s</%s>",
 						       cmd, arg, cmd))
 		 else
-		    opt = ekdosis.getsiglum(opt, "tei")
-		    return lem_rdg_totei(string.format("<%s wit=\"%s\">%s</%s>",
-						       cmd, opt, arg, cmd))
+		    -- opt = ekdosis.getsiglum(opt, "tei")
+		    return lem_rdg_totei(string.format("<%s%s%s>%s</%s>",
+						       cmd, teiwit, teitype, arg, cmd))
 		 end
    end)
    str = gsub(str, spcenc^-0 * dblbkslash * lemrdg * spcenc^-1 * bcbraces * spcenc^-1,
-- 
cgit v1.2.3

