[latex3-commits] [l3svn] 01/02: l3doc: reduce some hypertext targets.

noreply at latex-project.org noreply at latex-project.org
Fri Aug 19 09:55:04 CEST 2016


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit f09011ab643b6b0e8f3fb4a557477be37a4411d7
Author: Qing Lee <sobenlee at gmail.com>
Date:   Fri Aug 19 04:45:00 2016 +0800

    l3doc: reduce some hypertext targets.
    
    It is suitable to only make a common target for a block of names.
---
 l3kernel/l3doc.dtx |   46 +++++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 19 deletions(-)

diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 70906af..1686aed 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1309,7 +1309,8 @@ Do not distribute a modified version of this file.
 %
 %    \begin{macrocode}
 \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } }
-\ExecuteOptions { full, a4paper, nocheck, nochecktest, lm-default }
+\ExecuteOptions { full, nocheck, nochecktest, lm-default }
+\PassOptionsToClass { a4paper } { article }
 %    \end{macrocode}
 %
 % Input a local configuration file, if it exists, with a message to the
@@ -2190,7 +2191,6 @@ Do not distribute a modified version of this file.
 \cs_new_protected:Npn \@@_function_typeset_start:
   {
     \par \bigskip \noindent
-    \phantomsection
   }
 \cs_new_protected:Npn \@@_function_typeset_stop:
   {
@@ -2335,7 +2335,9 @@ Do not distribute a modified version of this file.
 \cs_new_protected:Npn \@@_typeset_functions:
   {
     \small\ttfamily
-    \begin{tabular} { @{} l @{} r @{} }
+    \HD at target
+    \Hy at MakeCurrentHref { HD. \int_use:N \c at HD@hypercount }
+    \begin{tabular} [t] { @{} l @{} r @{} }
       \toprule
       \@@_function_extra_labels:
       \@@_names_typeset:
@@ -2480,7 +2482,7 @@ Do not distribute a modified version of this file.
       \arrayrulecolor{white}
       \begin{tabular} { @{} l @{} }
         \toprule
-        \begin{minipage}{\l_@@_syntax_dim}
+        \begin{minipage}[t]{\l_@@_syntax_dim}
           \raggedright
           \obeyspaces
           \obeylines
@@ -2597,7 +2599,12 @@ Do not distribute a modified version of this file.
     \box_clear:N \l_@@_macro_index_box
     \vbox_set:Nn \l_@@_macro_box
       {
-        \hbox:n { \strut }
+        \hbox:n
+          {
+            \strut
+            \int_compare:nNnT \l_@@_macro_int = \c_zero
+              { \HD at target }
+          }
         \vskip \int_eval:n { \l_@@_macro_int - 1 } \baselineskip
       }
   }
@@ -2712,7 +2719,8 @@ Do not distribute a modified version of this file.
 \cs_new_protected:Npn \@@_macro_index:nN #1#2
   {
     \seq_gput_right:Nn \g_@@_nested_names_seq {#1}
-    \bool_if:NTF #2
+    \DoNotIndex {#1}
+    \bool_if:NT #2
       {
         \bool_if:NF \l_@@_macro_aux_bool
           { \seq_gput_right:Nn \g_doc_macros_seq {#1} }
@@ -2720,12 +2728,10 @@ Do not distribute a modified version of this file.
           \hbox_unpack_clear:N \l_@@_macro_index_box
           \int_gincr:N \c at CodelineNo
           \@@_special_index:nn {#1} { main }
-          \DoNotIndex {#1}
           \int_gdecr:N \c at CodelineNo
         \exp_args:NNNo \hbox_set_end:
           \tl_set:Nn \saved at indexname { \l_@@_index_key_tl }
       }
-      { \DoNotIndex {#1} }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -2756,15 +2762,9 @@ Do not distribute a modified version of this file.
 \cs_new_protected:Npn \@@_print_macroname:n #1
   {
     \strut
-    \HD at target
-
-    % TODO: INEFFICIENT(!)
-    \exp_args:NNx \seq_if_in:NnTF \g_doc_functions_seq
-      { #1 \bool_if:NT \l_@@_macro_TF_bool { \tl_to_str:n {TF} } }
-      {
-        \@@_get_hyper_target:nN {#1} \l_@@_tmpa_tl
-        \exp_last_unbraced:NNo \hyperref [ \l_@@_tmpa_tl ]
-      }
+    \@@_get_hyper_target:nN {#1} \l_@@_tmpa_tl
+    \cs_if_exist:cTF { r@ \l_@@_tmpa_tl }
+      { \exp_last_unbraced:NNo \hyperref [ \l_@@_tmpa_tl ] }
       { \use:n }
       {
         \int_compare:nTF { \str_count:n {#1} <= 28 }
@@ -3704,9 +3704,17 @@ Do not distribute a modified version of this file.
 \cs_generate_variant:Nn \@@_special_index_module:nnnnN { ooo }
 \cs_new_protected:Npn \@@_special_index_aux:nnnnnn #1#2#3#4#5#6
   {
-    \HD at target
     \@@_special_index_set:Nn \l_@@_index_escaped_macro_tl {#2}
-    \index
+    \str_if_eq:onTF { \@currenvir } { macrocode }
+      { \codeline at wrindex }
+      {
+        \str_case:nnF {#6}
+          {
+            { main }  { \codeline at wrindex }
+            { usage } { \index }
+          }
+          { \HD at target \index }
+      }
       {
         \tl_if_empty:nF { #3 #4 #5 }
           { #3 #5 \actualchar #4 #5 \levelchar }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list