[latex3-commits] [l3svn] r6669 - l3doc: Rename "index" key to "module" and add "no-index"

noreply at latex-project.org noreply at latex-project.org
Thu Aug 18 12:45:08 CEST 2016


Author: bruno
Date: 2016-08-18 12:45:08 +0200 (Thu, 18 Aug 2016)
New Revision: 6669

Modified:
   trunk/l3kernel/l3doc.dtx
Log:
l3doc: Rename "index" key to "module" and add "no-index"

The \cs and \cmd functions take an optional key-value argument:
"module" controls which heading of the type "bool commands"
the command will appear in (in the index), while "no-index"
suppresses indexing entirely, for use for things like
\cs{\meta{name}:\meta{arg-spec}}.


Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2016-08-18 07:35:54 UTC (rev 6668)
+++ trunk/l3kernel/l3doc.dtx	2016-08-18 10:45:08 UTC (rev 6669)
@@ -297,7 +297,8 @@
 %   The \meta{options} are a key--value list which can contain the
 %   following keys:
 %   \begin{itemize}
-%     \item |index=|\meta{module}: the \meta{csname} will be indexed in
+%     \item |no-index|: the \meta{csname} will not be indexed.
+%     \item |module=|\meta{module}: the \meta{csname} will be indexed in
 %       the list of commands from the \meta{module}; the \meta{module}
 %       can in particular be |TeX| for \enquote{\TeX{} and \LaTeXe{}}
 %       commands, or empty for commands which should be placed in the
@@ -315,7 +316,7 @@
 %   \end{syntax}
 %   Analoguous to \cs{cs} but intended for \enquote{traditional} \TeX{}
 %   or \LaTeXe{} commands; they will be indexed accordingly.  This is in
-%   fact equivalent to \cs{cs} |[index=TeX, replace=false,|
+%   fact equivalent to \cs{cs} |[module=TeX, replace=false,|
 %   \meta{options}|]| \Arg{csname}.
 % \end{function}
 %
@@ -793,14 +794,16 @@
 % \begin{variable}[int]
 %   {
 %     \l_@@_cmd_tl,
-%     \l_@@_cmd_index_tl,
+%     \l_@@_cmd_module_tl,
+%     \l_@@_cmd_noindex_bool,
 %     \l_@@_cmd_replace_bool,
 %   }
 %   Variables used to control the behaviour of \cs{cmd}, \cs{cs} and
 %   \cs{tn}.
 %    \begin{macrocode}
 \tl_new:N \l_@@_cmd_tl
-\tl_new:N \l_@@_cmd_index_tl
+\tl_new:N \l_@@_cmd_module_tl
+\bool_new:N \l_@@_cmd_noindex_bool
 \bool_new:N \l_@@_cmd_replace_bool
 %    \end{macrocode}
 % \end{variable}
@@ -1466,7 +1469,7 @@
 \DeclareExpandableDocumentCommand \tn  { O{} m }
   {
     \@@_cmd:no
-      { index = TeX , replace = false , #1 }
+      { module = TeX , replace = false , #1 }
       { \c_@@_backslash_tl #2 }
   }
 %    \end{macrocode}
@@ -1633,7 +1636,8 @@
 %    \begin{macrocode}
 \keys_define:nn { l3doc/cmd }
   {
-    index     .tl_set:N     = \l_@@_cmd_index_tl        ,
+    module    .tl_set:N     = \l_@@_cmd_module_tl       ,
+    no-index  .bool_set:N   = \l_@@_cmd_noindex_bool    ,
     replace   .bool_set:N   = \l_@@_cmd_replace_bool    ,
   }
 %    \end{macrocode}
@@ -1653,6 +1657,7 @@
 %   \tn{verbatim at font}, after turning it to harmless characters if
 %   needed (and keeping the underscore breakable); in any case, spaces
 %   must be turned into \tn{@xobeysp}.  Finally, produce an index entry.
+%   Indexing is suppressed when \cs{l_@@_cmd_noindex_bool} is true.
 %    \begin{macrocode}
 \cs_new:Npn \@@_cmd:nn #1#2
   {
@@ -1666,8 +1671,9 @@
 \cs_generate_variant:Nn \@@_cmd:nn { no }
 \cs_new_protected:Npn \@@_cmd_aux:nn #1#2
   {
+    \bool_set_false:N \l_@@_cmd_noindex_bool
     \bool_set_true:N \l_@@_cmd_replace_bool
-    \tl_set:Nn \l_@@_cmd_index_tl { \q_no_value }
+    \tl_set:Nn \l_@@_cmd_module_tl { \q_no_value }
     \keys_set:nn { l3doc/cmd } {#1}
     \tl_set:No \l_@@_cmd_tl { \token_to_str:N #2 }
     \bool_if:NT \l_@@_cmd_replace_bool
@@ -1689,17 +1695,20 @@
       \tl_replace_all:Nnn \l_@@_cmd_tl { ~ } { \@xobeysp }
       \l_@@_cmd_tl
     }
-    \exp_args:No \@@_key_get:n { \l_@@_cmd_tl }
-    \quark_if_no_value:NF \l_@@_cmd_index_tl
+    \bool_if:NF \l_@@_cmd_noindex_bool
       {
-        \tl_set:Nx \l_@@_index_module_tl
-          { \tl_to_str:N \l_@@_cmd_index_tl }
+        \exp_args:No \@@_key_get:n { \l_@@_cmd_tl }
+        \quark_if_no_value:NF \l_@@_cmd_module_tl
+          {
+            \tl_set:Nx \l_@@_index_module_tl
+              { \tl_to_str:N \l_@@_cmd_module_tl }
+          }
+        \@@_special_index_module:ooon
+          { \l_@@_index_key_tl }
+          { \l_@@_index_macro_tl }
+          { \l_@@_index_module_tl }
+          { }
       }
-    \@@_special_index_module:ooon
-      { \l_@@_index_key_tl }
-      { \l_@@_index_macro_tl }
-      { \l_@@_index_module_tl }
-      { }
   }
 %    \end{macrocode}
 % \end{macro}



More information about the latex3-commits mailing list