From ea9c242353810b74472dcb7c1d4a283a22472992 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 5 Jul 2020 12:35:11 +0200
Subject: expkv-opt just arrived, so removed xkeyval

---
 ekdosis.dtx | 75 +++++++++++++++++++++----------------------------------------
 1 file changed, 26 insertions(+), 49 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 9ce51e4..6fa4895 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2309,66 +2309,43 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 %    \end{macrocode}
 % Set global options:---
 %    \begin{macrocode}
-\RequirePackage{xkeyval}
+\RequirePackage{expkv-opt}
+\RequirePackage{expkv-def}
 \newif\if@pkg@float
 \newif\if@pkg@footins
-\define@choicekey{ekdosis.sty}{layout}{float, footins}[float]{%
-  \edef\layout@float{float}
-  \edef\layout@footins{footins}
-  \edef\@tempa{#1}
-  \ifx\@tempa\layout@float\@pkg@floattrue\fi
-  \ifx\@tempa\layout@footins\@pkg@floatfalse\@pkg@footinstrue\fi
-}
 \newif\if@pkg@ekddivs
-\define@choicekey+{ekdosis.sty}{divs}{ekdosis, latex}[ekdosis]{
-  \edef\divs@ekdosis{ekdosis}
-  \edef\divs@latex{latex}
-  \edef\@tempa{#1}
-  \ifx\@tempa\divs@ekdosis\@pkg@ekddivstrue\fi
-  \ifx\@tempa\divs@latex
-    \@pkg@ekddivsfalse
-    \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}
-  \fi
-}{\PackageError{ekdosis}{divs option must be either 'ekdosis' or 'latex'}}
 \newif\if@parnotesroman
 \newif\if@pkg@parnotes
-\define@choicekey+{ekdosis.sty}{parnotes}{true, false, roman}[true]{%
-  \edef\@pntrue{true}\edef\@pnfalse{false}\edef\@pnrm{roman}
-  \edef\@tempa{#1}
-  \ifx\@tempa\@pnfalse
-  \else
-  \ifx\@tempa\@pntrue\@pkg@parnotestrue
-  \else
-  \ifx\@tempa\@pnrm
-    \@pkg@parnotestrue\@parnotesromantrue
-  \fi\fi\fi
-}{\PackageWarning{ekdosis}{parnotes: erroneous input (ignored)}}
 \newif\iftei@export
-\define@choicekey{ekdosis.sty}{teiexport}{true, false, tidy}[true]{%
-  \edef\@exptrue{true}\edef\@expfalse{false}\edef\@exptidy{tidy}
-  \edef\@tempa{#1}
-  \ifx\@tempa\@expfalse
-  \else
-  \ifx\@tempa\@exptrue
-  \tei@exporttrue
-  \AtBeginDocument{\luadirect{ekdosis.openteistream()}}%
-  \AtEndDocument{\luadirect{ekdosis.closeteistream()}}
-  \else
-  \ifx\@tempa\@exptidy
-  \tei@exporttrue
-  \AtBeginDocument{\luadirect{ekdosis.openteistream()}}%
-  \AtEndDocument{\luadirect{ekdosis.closeteistream("tidy")}}
-  \else\fi\fi\fi}
-\ExecuteOptionsX{layout,divs}
-\ProcessOptionsX\relax
+\ekvdefinekeys{ekdosis}{
+  choice layout = {float = {\@pkg@floattrue},
+    footins = {\@pkg@footinstrue}},
+  initial layout = float,
+  choice divs = {ekdosis = {\@pkg@ekddivstrue},
+    latex = {\@pkg@ekddivsfalse
+      \AtBeginDocument{\luadirect{ekdosis.setekddivsfalse()}}}},
+  initial divs = ekdosis,
+  choice parnotes = {false = {},
+    true = {\@pkg@parnotestrue},
+    roman = {\@pkg@parnotestrue\@parnotesromantrue}},
+  default parnotes = true,
+  choice teiexport = {false = {},
+    true = {\tei@exporttrue
+      \AtBeginDocument{\luadirect{ekdosis.openteistream()}}%
+      \AtEndDocument{\luadirect{ekdosis.closeteistream()}}},
+    tidy = {\tei@exporttrue
+      \AtBeginDocument{\luadirect{ekdosis.openteistream()}}%
+      \AtEndDocument{\luadirect{ekdosis.closeteistream("tidy")}}}},
+  default teiexport = true
+}
+\ekvoProcessLocalOptions{ekdosis}
 %    \end{macrocode}
 % \paragraph{Required Packages} \label{ref:ekdrequirements} In
-% addition to \pkg{iftex} and \pkg{xkeyval}, a list of the packages
-% that are required by \pkg{ekdosis} follows:---
+% addition to \pkg{iftex} \pkg{expkv-opt} and \pkg{expkv-def}, a list
+% of the packages that are required by \pkg{ekdosis} follows:---
 %    \begin{macrocode}
 \RequirePackage{luacode}
 \RequirePackage{paracol}
-\RequirePackage{expkv-def}
 \RequirePackage{xparse}
 \RequirePackage{etoolbox}
 \RequirePackage{lineno}
-- 
cgit v1.2.3

