summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-07 23:33:27 +0000
committerKarl Berry <karl@freefriends.org>2011-09-07 23:33:27 +0000
commitf1cddb2ae051713a3d0b9efa1251d8f85d8131fc (patch)
tree47b6a38de15329b2ffd3a196e7d85e7ad1e93032 /Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
parentea06cd2704b8ed1c5278b20798ab9e3811e0ca4e (diff)
l3kernel 2729 (5sep11)
git-svn-id: svn://tug.org/texlive/trunk@23865 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3doc.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx91
1 files changed, 73 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 7bc2ffb5687..d7d925dbfa5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -78,7 +78,7 @@ Do not distribute a modified version of this file.
% \end{macrocode}
%
%<*driver|class>
-\GetIdInfo$Id: l3doc.dtx 2674 2011-08-27 19:43:44Z mittelba $
+\GetIdInfo$Id: l3doc.dtx 2719 2011-09-04 13:40:25Z will $
{L3 Experimental documentation class}
%</driver|class>
%
@@ -180,11 +180,12 @@ Do not distribute a modified version of this file.
%
% \section{Problems \& Todo}
%
-% Problems at the moment: (1)~not flexible in the types of things that
-% can be documented; (2)~very nonstandard markup (e.g., the odd `"/
-% (...)"' tags; (3)~no obvious link between the "\begin{function}"
-% environment for documenting things to the "\begin{macro}" function
-% that's used analogously in the implementation.
+% Problems at the moment:
+% (1)~not flexible in the types of things that can be documented;
+% (2)~very nonstandard markup (e.g., the odd `"/ (...)"' tags;
+% (3)~no obvious link between the "\begin{function}" environment for
+% documenting things to the "\begin{macro}" function that's used
+% analogously in the implementation.
%
% The "macro" should probably be renamed to "function" when it is used within
% an implementation section. But they should have the same syntax before that happens!
@@ -295,7 +296,7 @@ Do not distribute a modified version of this file.
% \end{framed}
%
% Function environments take an optional argument to indicate whether the function(s) it
-% describes are expandable or defined in conditional forms. Use "EXP", "TF", or "pTF"
+% describes are expandable or restricted-expandable or defined in conditional forms. Use "EXP", "rEXP", "TF", or "pTF"
% for this; note that "pTF" implies "EXP" since predicates must always be expandable.
% As an example:
% \begin{framed}
@@ -324,7 +325,7 @@ Do not distribute a modified version of this file.
% In the old syntax, individual functions could be suffixed by an optional flag or
% two to indicate the same information given in the optional argument.
% This is still supported; use "/" to separate the function name
-% from the flag(s) and then add any of "(EXP)", "(TF)", or "(pTF)".
+% from the flag(s) and then add any of "(EXP)", "(rEXP)", "(TF)", or "(pTF)".
%
% \DescribeEnv{variable}
% If you are documenting a variable instead of a function, use the "variable" environment instead; it behaves identically to the "function" environment above.
@@ -547,13 +548,21 @@ Do not distribute a modified version of this file.
% \begin{macrocode}
\LoadClass{article}
\RequirePackage{doc}
-\RequirePackage{array,alphalph,booktabs,color,fixltx2e,enumitem,textcomp,trace,underscore,csquotes}
+\RequirePackage{array,alphalph,booktabs,color,fixltx2e,enumitem,pifont,textcomp,trace,underscore,csquotes}
% \end{macrocode}
%
% \begin{macrocode}
\bool_if:NT \g_doc_lmodern_bool {
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
+% \end{macrocode}
+% Now replace the italic typewriter font with the oblique shape instead;
+% the former makes my skin crawl. (Will, Aug 2011)
+% \begin{macrocode}
+ \begingroup
+ \ttfamily
+ \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{}
+ \endgroup
}
% \end{macrocode}
%
@@ -805,6 +814,7 @@ Do not distribute a modified version of this file.
\bool_gset_false:N \l_doc_meta_TF_bool
\bool_gset_false:N \l_doc_meta_pTF_bool
\bool_gset_false:N \l_doc_meta_EXP_bool
+ \bool_gset_false:N \l_doc_meta_rEXP_bool
\cs_set_nopar:Npn \KV_key_no_value_elt:n ##1 { \use:c {doc_meta_opt_##1:} }
\keyval_parse:NNn \KV_key_no_value_elt:n \use_none:nn {#1}
@@ -832,6 +842,11 @@ Do not distribute a modified version of this file.
}
\cs_set:Nn \doc_meta_opt_EXP: {
\bool_gset_true:N \l_doc_meta_EXP_bool
+ \bool_gset_false:N \l_doc_meta_rEXP_bool
+}
+\cs_set:Nn \doc_meta_opt_rEXP: {
+ \bool_gset_false:N \l_doc_meta_EXP_bool
+ \bool_gset_true:N \l_doc_meta_rEXP_bool
}
\cs_set:Nn \doc_meta_opt_pTF: {
\bool_gset_true:N \l_doc_meta_pTF_bool
@@ -889,9 +904,10 @@ Do not distribute a modified version of this file.
\bool_new:N \l_doc_meta_TF_bool
\bool_new:N \l_doc_meta_pTF_bool
\bool_new:N \l_doc_meta_EXP_bool
+\bool_new:N \l_doc_meta_rEXP_bool
% \end{macrocode}
%
-% \begin{macro}{\doc_showmacro_aux:w}
+% \begin{macro}[aux]{\doc_showmacro_aux:w}
% This macro is passed one of:
% \begin{quote}
% "\abc:cnx / (EXP) / \q_stop" \\
@@ -912,6 +928,9 @@ Do not distribute a modified version of this file.
\tl_if_in:nnT {#2} { (EXP) } {
\bool_gset_true:N \l_doc_meta_EXP_bool
}
+ \tl_if_in:nnT {#2} { (rEXP) } {
+ \bool_gset_true:N \l_doc_meta_rEXP_bool
+ }
\tl_if_in:nnT {#2} { (pTF) } {
\bool_gset_true:N \l_doc_meta_TF_bool
@@ -941,13 +960,15 @@ Do not distribute a modified version of this file.
\bool_gset_true:N \l_doc_meta_TF_bool
\doc_showmacro_aux_ii:w #1::\q_stop
}{
- \doc_showmacro_aux_ii:w #1::\q_stop
+ \exp_args:Nf \tl_if_head_eq_charcode:nNTF { \use_none:n #1 } {:}
+ { \doc_showmacro_aux_iii:n {#1} }
+ { \doc_showmacro_aux_ii:w #1::\q_stop }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\doc_showmacro_aux_ii:w}
+% \begin{macro}[aux]{\doc_showmacro_aux_ii:w}
% This macro is passed arguments in the following ways:
% \begin{quote}
% "\doc_showmacro_aux_ii:w "^^A
@@ -979,7 +1000,11 @@ Do not distribute a modified version of this file.
&
\bool_if:NT \l_doc_meta_EXP_bool {
\hspace{\tabcolsep}
- $\star$
+ \hyperlink{expstar}{$\star$}
+ }
+ \bool_if:NT \l_doc_meta_rEXP_bool {
+ \hspace{\tabcolsep}
+ \hyperlink{rexpstar}{\ding{73}}% hollow star
}
\tl_set:Nx \g_doc_macro_tl { \tl_to_str:N \g_doc_macro_tl }
\exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\token_to_str:N _} {/}
@@ -990,6 +1015,23 @@ Do not distribute a modified version of this file.
}
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}[aux]{\doc_showmacro_aux_iii:w}
+% This is for the case when the function is one of the weird ones like \cs{::N}.
+% \begin{macrocode}
+\cs_set_nopar:Nn \doc_showmacro_aux_iii:n {
+ \nextnewline
+ \tl_gset:Nx \g_doc_macro_tl {#1}
+ #1 &
+ \tl_set:Nx \g_doc_macro_tl { \tl_to_str:N \g_doc_macro_tl }
+ \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\token_to_str:N _} {/}
+ \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\@backslashchar} {}
+ \bool_if:NT \g_doc_full_bool {
+ \exp_args:Nf\label{doc/function/\g_doc_macro_tl}
+ }
+}
+% \end{macrocode}
+% \end{macro}
%
% \begin{environment}{syntax}
% Syntax block placed next to the list of functions to illustrate their use.
@@ -998,7 +1040,6 @@ Do not distribute a modified version of this file.
\dim_set:Nn \g_doc_syntax_dim {0.7\textwidth}
\newenvironment{syntax}{
\minipage[b]{\g_doc_syntax_dim}
- \cs_set_nopar:Npn \meta@font@select{\rmfamily\itshape} % (Will: I HATE italic cmtt!)
\small\ttfamily\raggedright
\obeyspaces\obeylines
}{
@@ -1242,10 +1283,13 @@ Do not distribute a modified version of this file.
% conditionals and auxiliary functions.
% \begin{macrocode}
\cs_set_nopar:Npn \doc_typeset_TF: {
- \itshape TF%
- \makebox[0pt][r]{%
- \color[gray]{0.5}
- \underline { \phantom{\itshape TF} \kern-0.1em }
+ \hyperlink{explTF}{%
+ \color{black}%
+ \itshape TF%
+ \makebox[0pt][r]{%
+ \color{red}
+ \underline { \phantom{\itshape TF} \kern-0.1em }
+ }
}
}
\cs_set_nopar:Npn \doc_typeset_aux:n #1 {
@@ -2038,6 +2082,17 @@ page_precedence "rnaA"
% \end{macro}
%
%
+% \begin{function}{\::N}
+% this is (no longer) weird
+% \end{function}
+%
+% \begin{macro}{\::N}
+% this is (no longer) weird
+% \end{macro}
+%
+% \begin{function}[EXP]{\foo}\end{function}
+% \begin{function}[rEXP]{\foo}\end{function}
+%
% \begin{macro}{\c_minus_one,
% \c_zero,
% \c_one,