From 6270bd8bbde897d19fa956af90e996b62ff4f63e Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 5 Jul 2020 08:02:15 +0200
Subject: inserting comments in the Implementation part

---
 ekdosis.dtx | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 65 insertions(+), 6 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 9cfc44f..630ebfe 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2614,24 +2614,44 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 \@onlypreamble\DeclareApparatus
 %    \end{macrocode}
 % \end{macro}
+% Apparatus-related settings and functions. Some booleans to check if
+% an apparatus should be inserted and what is the current environment.
 %    \begin{macrocode}
 \newbool{do@app}
 \newif\ifekd@state
 \newif\ifekd@isinapp
 \newif\ifekd@isinlem
+%    \end{macrocode}
+% The next boolean is shared with \pkg{arabluatex}. \cs{LRnum} is used
+% internally to ensure that numerals referring to line spans are
+% displayed in the right order.
+%    \begin{macrocode}
 \providebool{al@rlmode}
 \@ifpackageloaded{arabluatex}{}{%
   \def\setRL{\booltrue{al@rlmode}\pardir TRT\textdir TRT}
   \def\setLR{\boolfalse{al@rlmode}\pardir TLT \textdir TLT}
 }
 \protected\def\LRnum#1{\bgroup\textdir TLT#1\egroup}
+%    \end{macrocode}
+% Set counter referring to line numbers and make it global. 
+%    \begin{macrocode}
 \newcounter{ekd@lab}
 \globalcounter{ekd@lab}
+%    \end{macrocode}
+% This command inserts words in the apparatus criticus without
+% checking if both |ekd@isinapp| and |ekd@state| are set to |true|.
+%    \begin{macrocode}
 \NewDocumentCommand{\unconditional@appin}{o m}{%
   \IfNoValueTF{#1}
   {\luadirect{ekdosis.appin(\luastringO{#2})}}
   {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}%
 }
+%    \end{macrocode}
+% \begin{macro}{\blfootnote} \cs{blfootnote}\marg{footnote} is used
+% internally to insert the apparatus in the footnote block should the
+% global optional argument |layout| be set to |footins|. Therefore, it
+% is not documented.
+%    \begin{macrocode}
  % \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
 \def\blfootnote{\gdef\@thefnmark{}\@blfootnotetext}
 \long\def\@blfootnotetext#1{\insert\footins{%
@@ -2651,15 +2671,54 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
     \parindent 1em%
     \noindent
     \hb@xt@0em{\hss\@makefnmark}#1}
+%    \end{macrocode}
+% \end{macro}
+% \paragraph{Single-layer apparatus} The following commands are for
+% general settings. All of them can be used in the preamble or at any
+% point of the document:---
+% \begin{macro}{\SetLTRapp}
+% \begin{macro}{\SetRTLapp}
+% \cs{SetLTRapp} and \cs{SetRTLapp} are two argument-less commands to
+% set the direction of single-layer apparatus criticus, either LTR or
+% RTL:---
+%    \begin{macrocode}
 \newif\ifrtl@app
 \NewDocumentCommand{\SetRTLapp}{}{\rtl@apptrue}
 \NewDocumentCommand{\SetLTRapp}{}{\rtl@appfalse}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\SetSeparator}
+% \cs{SetSeparator}\marg{separator} allows to change the separator
+% between lemma texts and variant readings, which is by default
+% a closing square bracket followed by a space (\verb*+] +):---
+%    \begin{macrocode}
 \edef\ekdsep{] }
 \NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SetEndApparatus}
+% \cs{SetEndApparatus}\marg{characters} can be used to append
+% characters at the end of the apparatus block\---such as a full stop,
+% as it is customary in some editions. By default, nothing is
+% appended:---
+%    \begin{macrocode}
 \edef\ekd@end@apparatus{}
 \NewDocumentCommand{\SetEndApparatus}{m}{\edef\ekd@end@apparatus{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SetUnitDelimiter}
+% \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the
+% delimiter between entries in the apparatus criticus. By default,
+% there is no delimiter except a simple space. \cs{SetUnitDelimiter}
+% can be used to insert a broad space (with |\hskip| for instance, as
+% in the OCT series) or the divider-sign (‖, as in the Budé series):---
+%    \begin{macrocode}
 \def\ekd@unit@delim{}
 \NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}}
+%    \end{macrocode}
+% \end{macro}
+%    \begin{macrocode}
 \def\ekd@default@rule{\rule{2truein}{0.5pt}}
 \newif\iffootnoterule
 \footnoteruletrue
@@ -2675,18 +2734,18 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   \dflt@pcol@footnoterule%
   \fi
 }
-\newcommand*{\NLS}{%
-  \par%
-  \nobreak%
-  \vspace{-\parskip}%
-  \noindent%
-  \ignorespaces}
 \NewDocumentCommand{\SetDefaultRule}{m}{%
   \def\@tempa{#1}
   \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}%
   \else%
   \def\ekd@default@rule{#1}%
   \fi}
+\newcommand*{\NLS}{%
+  \par%
+  \nobreak%
+  \vspace{-\parskip}%
+  \noindent%
+  \ignorespaces}
 \newif\ifsubsq@unit
 \subsq@unittrue
 \def\add@@apparatus{%
-- 
cgit v1.2.3

