[latex3-commits] [git/LaTeX3-latex3-latex3] master: Remove dead hyperlinks when TF explanation is not typeset (fix #477) (c669c55)

Bruno Le Floch bruno at le-floch.fr
Sat Mar 2 14:42:49 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/c669c553084b5133563f140e429bdfd82e012156

>---------------------------------------------------------------

commit c669c553084b5133563f140e429bdfd82e012156
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sat Mar 2 14:39:51 2019 +0100

    Remove dead hyperlinks when TF explanation is not typeset (fix #477)
    
    Same for the hyperlinks on star and hollow star for expandable commands.
    I've also removed the red color because it is only used for links.


>---------------------------------------------------------------

c669c553084b5133563f140e429bdfd82e012156
 l3kernel/l3doc.dtx |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index ed0f60d..4795e07 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1905,6 +1905,7 @@ and all files in that bundle must be distributed together.
 \NewDocumentCommand { \CodedocExplainEXP } { }
   {
     \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}%
+    \write \@auxout { \def \string \Codedoc at expstar { } }
     \@@_typeset_exp:\ indicates~fully~expandable~functions,~which~
     can~be~used~within~an~\texttt{x}-type~argument~(in~plain~
     \TeX{}~terms,~inside~an~\cs{edef}),~as~well~as~within~an~
@@ -1913,6 +1914,7 @@ and all files in that bundle must be distributed together.
 \NewDocumentCommand { \CodedocExplainREXP } { }
   {
     \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}%
+    \write \@auxout { \def \string \Codedoc at rexpstar { } }
     \@@_typeset_rexp:\ indicates~
     restricted~expandable~functions,~which~can~be~used~within~an~
     \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~
@@ -1921,6 +1923,7 @@ and all files in that bundle must be distributed together.
 \NewDocumentCommand { \CodedocExplainTF } { }
   {
     \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}%
+    \write \@auxout { \def \string \Codedoc at explTF { } }
     \@@_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~
     whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~
     argument~specifiers~expect~different~
@@ -2082,18 +2085,30 @@ and all files in that bundle must be distributed together.
 %   to typeset conditionals and auxiliary functions.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_typeset_exp:
-  { \hyperlink{expstar} {$\star$} }
+  {
+    \cs_if_exist:NTF \Codedoc at expstar
+      { \hyperlink { expstar } }
+      { \mbox }
+    {$\star$}
+  }
 \cs_new_protected:Npn \@@_typeset_rexp:
-  { \hyperlink{rexpstar} {\ding{73}} } % hollow star
+  {
+    \cs_if_exist:NTF \Codedoc at rexpstar
+      { \hyperlink { rexpstar } }
+      { \mbox }
+    { \ding { 73 } } % hollow star
+  }
 \cs_new_protected:Npn \@@_typeset_TF:
   {
-    \hyperlink{explTF}
+    \cs_if_exist:NTF \Codedoc at explTF
+      { \hyperlink { explTF } }
+      { \mbox }
       {
         \color{black}
         \itshape TF
         \makebox[0pt][r]
           {
-            \color{red}
+            \cs_if_exist:NT \Codedoc at explTF { \color{red} }
             \underline { \phantom{\itshape TF} \kern-0.1em }
           }
       }





More information about the latex3-commits mailing list