[latex3-commits] [git/LaTeX3-latex3-latex3] l3doc: Initial split of l3doc (10a41e153)

Phelype Oleinik phe.h.o1 at gmail.com
Mon Sep 9 14:04:16 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : l3doc
Link       : https://github.com/latex3/latex3/commit/10a41e1534dcc4ee606b460107ae851291bda0be

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

commit 10a41e1534dcc4ee606b460107ae851291bda0be
Author: Phelype Oleinik <phe.h.o1 at gmail.com>
Date:   Mon Sep 9 09:04:16 2019 -0300

    Initial split of l3doc


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

10a41e1534dcc4ee606b460107ae851291bda0be
 l3kernel/l3.ins    |   1 +
 l3kernel/l3doc.dtx | 241 +++++++++++++++++++++++++++++++++--------------------
 2 files changed, 150 insertions(+), 92 deletions(-)

diff --git a/l3kernel/l3.ins b/l3kernel/l3.ins
index 8affab2c2..ef9fcde47 100644
--- a/l3kernel/l3.ins
+++ b/l3kernel/l3.ins
@@ -114,6 +114,7 @@ and all files in that bundle must be distributed together.
 \generate{\file{expl3-generic.tex}{\from{expl3.dtx}       {generic,loader}}}
 
 \generate{\file{l3doc.cls}        {\from{l3doc.dtx}       {class}}}
+\generate{\file{l3doc.sty}        {\from{l3doc.dtx}       {package}}}
 % not distributed:
 %\generate{\file{l3doc.ist}        {\from{l3doc.dtx}       {docist}}}
 
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index ddf376350..042804004 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -56,9 +56,9 @@ and all files in that bundle must be distributed together.
 \fi
 %</driver>
 %
-%<*driver|class>
+%<*driver|class|package>
 \RequirePackage{expl3,xparse,calc}
-%</driver|class>
+%</driver|class|package>
 %
 %<*driver>
 \ProvidesFile{l3doc.dtx}[2017/03/18 L3 Experimental documentation class]
@@ -72,20 +72,23 @@ and all files in that bundle must be distributed together.
 % This isn't included in the typeset documentation because it's a bit
 % ugly:
 %<*class>
-\ProvidesExplClass{l3doc}{2018-04-30}{}
+\ProvidesExplClass{l3doc}{2019-08-27}{}
   {L3 Experimental documentation class}
 %</class>
+%<*package>
+\ProvidesExplPackage{l3doc}{2019-08-27}{}
+  {L3 Experimental documentation package}
+%</package>
 % \fi
 %
 % \title{The \cls{l3doc} class}
 % \author{\Team}
-% \date{Released 2019-09-08}
+% \date{Released 2019-08-25}
 % \maketitle
 % \tableofcontents
 %
 % \begin{documentation}
 %
-%
 % \section{Introduction}
 %
 % This is an ad-hoc class for documenting the \pkg{expl3} bundle, a
@@ -552,11 +555,11 @@ and all files in that bundle must be distributed together.
 % \section{\pkg{l3doc} implementation}
 %
 %    \begin{macrocode}
-%<*class>
+%<@@=codedoc>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<@@=codedoc>
+%<*package>
 %    \end{macrocode}
 %
 % \subsection{Variables}
@@ -710,7 +713,9 @@ and all files in that bundle must be distributed together.
 %   }
 %   Information about package options.
 %    \begin{macrocode}
-\bool_new:N \g_@@_lmodern_bool
+%</package>
+%<class>\bool_new:N \g_@@_lmodern_bool
+%<*package>
 \bool_new:N \g_@@_checkfunc_bool
 \bool_new:N \g_@@_checktest_bool
 \bool_new:N \g_@@_kernel_bool
@@ -727,6 +732,9 @@ and all files in that bundle must be distributed together.
 \tl_new:N \l_@@_tmpb_tl
 \int_new:N \l_@@_tmpa_int
 \int_new:N \l_@@_tmpa_seq
+%</package>
+%<class>\dim_new:N \l_@@_tmpa_dim
+%<*package>
 %    \end{macrocode}
 % \end{variable}
 %
@@ -930,30 +938,22 @@ and all files in that bundle must be distributed together.
 % \begin{macro}
 %   {
 %     \seq_set_split:NoV,
+%     \seq_gput_right:Nf,
 %     \str_case:fn,
 %     \tl_count:f,
-%     \tl_greplace_all:Nxn,
 %     \tl_greplace_all:Nno,
 %     \tl_if_head_eq_charcode:oNTF,
 %     \tl_if_head_eq_charcode:oNT,
 %     \tl_if_head_eq_charcode:oNF,
-%     \tl_if_head_eq_meaning:VNF,
-%     \tl_if_in:noTF,
 %     \tl_if_in:ooTF,
 %     \tl_if_in:NoTF,
 %     \tl_if_in:NoT,
 %     \tl_if_in:NoF,
 %     \tl_remove_all:Nx,
 %     \tl_replace_all:Nxn,
-%     \tl_replace_all:Nnx,
 %     \tl_replace_all:Non,
 %     \tl_replace_all:Nno,
-%     \tl_replace_once:Noo,
 %     \tl_to_str:f,
-%     \tl_to_str:o,
-%     \prop_get:NxNTF,
-%     \prop_put:Nxn,
-%     \prop_gput:NVx,
 %   }
 %   A few missing variants.
 %    \begin{macrocode}
@@ -961,24 +961,16 @@ and all files in that bundle must be distributed together.
 \cs_generate_variant:Nn \seq_gput_right:Nn { Nf }
 \cs_generate_variant:Nn \str_case:nn { fn }
 \cs_generate_variant:Nn \tl_count:n { f }
-\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx , Nno }
+\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nno }
 \cs_generate_variant:Nn \tl_if_empty:nTF { f }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT  { o }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF  { o }
-\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF  { V }
-\cs_generate_variant:Nn \tl_if_in:nnTF { no , oo }
-\cs_generate_variant:Nn \tl_if_in:NnTF { No }
-\cs_generate_variant:Nn \tl_if_in:NnT  { No }
-\cs_generate_variant:Nn \tl_if_in:NnF  { No }
+\prg_generate_conditional_variant:Nnn
+  \tl_if_head_eq_charcode:nN { o } { T , F , TF }
+\prg_generate_conditional_variant:Nnn \tl_if_in:nn { oo } { TF }
+\prg_generate_conditional_variant:Nnn \tl_if_in:Nn { No } { T , F , TF }
 \cs_generate_variant:Nn \tl_remove_all:Nn   { Nx }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno }
-\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , No , Nno }
 \cs_generate_variant:Nn \tl_set_rescan:Nnn { NnV }
-\cs_generate_variant:Nn \tl_to_str:n { f , o }
-\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
-\cs_generate_variant:Nn \prop_put:Nnn { Nx }
-\cs_generate_variant:Nn \prop_gput:Nnn { NVx }
+\cs_generate_variant:Nn \tl_to_str:n { f }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -989,7 +981,7 @@ and all files in that bundle must be distributed together.
 %   cope with the case of |#1| starting with \cs{c_backslash_str}
 %   which should be expanded and considered to be \enquote{normal}.
 %    \begin{macrocode}
-\prg_new_protected_conditional:Npnn \@@_if_almost_str:n #1 { TF , T , F }
+\prg_new_protected_conditional:Npnn \@@_if_almost_str:n #1 { T , F , TF }
   {
     \int_compare:nNnTF
       { \tl_count:n {#1} }
@@ -1017,7 +1009,7 @@ and all files in that bundle must be distributed together.
 % \begin{macro}[TF]{\@@_str_if_begin:nn, \@@_str_if_begin:oo}
 %   True if the first string starts with the second.
 %    \begin{macrocode}
-\prg_new_protected_conditional:Npnn \@@_str_if_begin:nn #1#2 { TF , T , F }
+\prg_new_protected_conditional:Npnn \@@_str_if_begin:nn #1#2 { T , F , TF }
   {
     \tl_if_in:ooTF
       { \exp_after:wN \scan_stop: \tl_to_str:n {#1} }
@@ -1026,7 +1018,7 @@ and all files in that bundle must be distributed together.
       { \prg_return_false: }
   }
 \prg_generate_conditional_variant:Nnn \@@_str_if_begin:nn
-  { oo } { TF , T , F }
+  { oo } { T , F , TF }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1276,12 +1268,12 @@ and all files in that bundle must be distributed together.
 %   of |#1|, and the original signature with an extra pair of braces.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_base_form_signature_do:nnn #1#2#3
-  {
+  { % Unused?
     \@@_split_function_do:nn {#1}
       { \@@_base_form_aux:nnnnnN {#1} {#2} {#3} }
   }
 \cs_new_protected:Npn \@@_base_form_aux:nnnnnN #1#2#3#4#5#6
-  {
+  { % Unused?
     \bool_if:NTF #6
       {
         \tl_if_head_eq_charcode:nNTF {#4} :
@@ -1306,7 +1298,7 @@ and all files in that bundle must be distributed together.
 %   accepts YYYY or YYYY-MM too).  Compares them using |#2| (one of |<|,
 %   |=|, |>|), filling in zeros for missing data.
 %    \begin{macrocode}
-\prg_new_conditional:Npnn \@@_date_compare:nNn #1#2#3 { TF , T , F , p }
+\prg_new_conditional:Npnn \@@_date_compare:nNn #1#2#3 { p , T , F , TF }
   { \@@_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop }
 \cs_new:Npn \@@_date_compare_aux:w
     #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
@@ -1396,7 +1388,12 @@ and all files in that bundle must be distributed together.
   }
 %    \end{macrocode}
 %
-% \subsection{Options and configuration}
+% \subsection{Class options and configuration}
+%
+%    \begin{macrocode}
+%</package>
+%<*class>
+%    \end{macrocode}
 %
 %    \begin{macrocode}
 \DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
@@ -1404,6 +1401,12 @@ and all files in that bundle must be distributed together.
 %
 %    \begin{macrocode}
 \DeclareOption { full }
+  { \PassOptionsToPackage { full } { l3doc } }
+\DeclareOption { onlydoc }
+  { \PassOptionsToPackage { onlydoc } { l3doc } }
+%</class>
+%<*package>
+\DeclareOption { full }
   {
     \bool_gset_true:N \g_@@_typeset_documentation_bool
     \bool_gset_true:N \g_@@_typeset_implementation_bool
@@ -1420,10 +1423,22 @@ and all files in that bundle must be distributed together.
   { \bool_gset_true:N \g_@@_checkfunc_bool }
 \DeclareOption { nocheck }
   { \bool_gset_false:N \g_@@_checkfunc_bool }
+%</package>
+%<*class>
+\DeclareOption { check }
+  { \PassOptionsToPackage { check } { l3doc } }
+\DeclareOption { nocheck }
+  { \PassOptionsToPackage { nocheck } { l3doc } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \DeclareOption { checktest }
+  { \PassOptionsToPackage { checktest } { l3doc } }
+\DeclareOption { nochecktest }
+  { \PassOptionsToPackage { nochecktest } { l3doc } }
+%</class>
+%<*package>
+\DeclareOption { checktest }
   { \bool_gset_true:N \g_@@_checktest_bool }
 \DeclareOption { nochecktest }
   { \bool_gset_false:N \g_@@_checktest_bool }
@@ -1434,6 +1449,8 @@ and all files in that bundle must be distributed together.
   { \bool_gset_true:N \g_@@_kernel_bool }
 \DeclareOption { stdmodule }
   { \bool_gset_false:N \g_@@_kernel_bool }
+%</package>
+%<*class>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -1444,10 +1461,12 @@ and all files in that bundle must be distributed together.
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+%</class>
+%<*package>
 \DeclareOption { cs-break-off }
   { \bool_gset_false:N \g_@@_cs_break_bool }
 \DeclareOption { cs-break-nohyphen }
-  { \PassOptionsToPackage{nohyphen}{underscore} }
+  { \PassOptionsToPackage { nohyphen } { underscore } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -1455,12 +1474,21 @@ and all files in that bundle must be distributed together.
   { \bool_gset_true:N  \g_@@_show_notes_bool }
 \DeclareOption { hide-notes }
   { \bool_gset_false:N \g_@@_show_notes_bool }
+%</package>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+%<*class>
 \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } }
-\ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default }
+\ExecuteOptions { full, lm-default }
 \PassOptionsToClass { a4paper } { article }
+%</class>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<*package>
+\ExecuteOptions { kernel , nocheck , nochecktest }
+%</package>
 %    \end{macrocode}
 %
 % Input a local configuration file, if it exists, with a message to the
@@ -1470,6 +1498,7 @@ and all files in that bundle must be distributed together.
 % only output the informational message if it's not found.
 %
 %    \begin{macrocode}
+%<*class>
 \msg_new:nnn { l3doc } { input-cfg }
   { Local~config~file~l3doc.cfg~loaded. }
 \file_if_exist:nT { l3doc.cfg }
@@ -1480,44 +1509,18 @@ and all files in that bundle must be distributed together.
           { \msg_info:nn { l3doc } { input-cfg } }
       }
   }
+%</class>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\ProcessOptions
-%    \end{macrocode}
-%
-%
-% \subsection{Class and package loading}
-%
-%    \begin{macrocode}
-\LoadClass{article}
-\RequirePackage{doc}
-\RequirePackage
-  {
-    array,
-    alphalph,
-    amsmath,
-    amssymb,
-    booktabs,
-    color,
-    colortbl,
-    hologo,
-    enumitem,
-    pifont,
-    textcomp,
-    trace,
-    csquotes,
-    fancyvrb,
-    underscore,
-    verbatim
-  }
-\raggedbottom
+%<class|package>\ProcessOptions
 %    \end{macrocode}
 %
 % Depending on the option, load the package \pkg{lmodern} to set the
 % font.  Then replace the italic typewriter font with the oblique shape
 % instead; the former makes my skin crawl. (Will, Aug 2011)
 %    \begin{macrocode}
+%<*class>
 \bool_if:NT \g_@@_lmodern_bool
   {
     \RequirePackage[T1]{fontenc}
@@ -1527,11 +1530,41 @@ and all files in that bundle must be distributed together.
       \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{}
     \group_end:
   }
+%</class>
+%    \end{macrocode}
+%
+% \subsection{Class and package loading}
+%
+%    \begin{macrocode}
+%<class>\LoadClass{article}
+%<*class|package>
+\RequirePackage{doc}
+\RequirePackage
+  {
+    array,% Okay
+    alphalph,% Used in \DocInclude to redefine \thepart
+    amsmath,% Okay
+    amssymb,% Okay
+    booktabs,% Used \...rule, used in syntax, function, and variable environments
+    color, % Okay
+    colortbl, % \arrayrulecolor, used in syntax environment
+    hologo, % Used for logos :-)
+    enumitem, % Used for the arguments environment
+    pifont, % hollow star for rEXP
+    textcomp, % Okay
+    trace, % Okay?
+    csquotes, % Okay
+    fancyvrb, % Used for typesetting verbatim
+    underscore, % Breakable underscores (expl3 has some :-)
+    verbatim, % Okay
+  }
+%</class|package>
+%<class>\raggedbottom
 %    \end{macrocode}
 %
 % Must be last, as usual.
 %    \begin{macrocode}
-\RequirePackage{hypdoc}
+%<class|package>\RequirePackage{hypdoc}
 %    \end{macrocode}
 %
 % \subsection{Configuration and tweaks}
@@ -1540,6 +1573,7 @@ and all files in that bundle must be distributed together.
 %   A few more letters are \enquote{private} in a \LaTeX3 programming
 %   environment.
 %    \begin{macrocode}
+%<*package>
 \cs_gset:Npn \MakePrivateLetters
   {
     \char_set_catcode_letter:N \@
@@ -1607,15 +1641,20 @@ and all files in that bundle must be distributed together.
 %
 % \subsection{Design}
 %
+%    \begin{macrocode}
+%</package>
+%<*class>
+%    \end{macrocode}
+%
 % Increase the text width slightly so that width the standard fonts
 % 72~columns of code may appear in a \env{macrocode} environment.
 % Increase the marginpar width slightly, for long command names.  And
 % increase the left margin by a similar amount.
 %    \begin{macrocode}
-\setlength   \textwidth      { 385pt }
-\addtolength \marginparwidth {  30pt }
-\addtolength \oddsidemargin  {  20pt }
-\addtolength \evensidemargin {  20pt }
+\dim_set:Nn \textwidth      { 385pt }
+\dim_add:Nn \marginparwidth {  30pt }
+\dim_add:Nn \oddsidemargin  {  20pt }
+\dim_add:Nn \evensidemargin {  20pt }
 %    \end{macrocode}
 % (These were introduced when \cls{article} was the documentclass, but
 % I've left them here for now to remind me to do something about them
@@ -1628,9 +1667,9 @@ and all files in that bundle must be distributed together.
 \cs_new_eq:NN \@@_oldlist:nn \list
 \cs_gset:Npn \list #1 #2
   { \@@_oldlist:nn {#1} { #2 \dim_zero:N \listparindent } }
-\setlength \parindent  { 2em }
-\setlength \itemindent { 0pt }
-\setlength \parskip    { 0pt plus 3pt minus 0pt }
+\dim_set:Nn \parindent  { 2em }
+\dim_set:Nn \itemindent { 0pt }
+\dim_set:Nn \parskip    { 0pt plus 3pt minus 0pt }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -1649,25 +1688,35 @@ and all files in that bundle must be distributed together.
 \@addtoreset{section}{part}
 \cs_gset:Npn \l at section #1#2
   {
-    \ifnum \c at tocdepth >\z@
-      \addpenalty\@secpenalty
-      \addvspace{1.0em \@plus\p@}
-      \setlength\@tempdima{2.5em}  % was 1.5em
-      \begingroup
-        \parindent \z@ \rightskip \@pnumwidth
-        \parfillskip -\@pnumwidth
-        \leavevmode \bfseries
-        \advance\leftskip\@tempdima
-        \hskip -\leftskip
-        #1\nobreak\hfil \nobreak\hb at xt@\@pnumwidth{\hss #2}\par
-      \endgroup
-    \fi
+    \int_compare:nNnT { \c at tocdepth } > { \c_zero_int }
+      {
+        \addpenalty \@secpenalty
+        \addvspace {1.0em \@plus\p@}
+        \dim_set:Nn \l_@@_tmpa_dim { 2.5em }  % was 1.5em
+        \group_begin:
+          \dim_set_eq:NN \parindent \c_zero_dim
+          \dim_set_eq:NN \rightskip \@pnumwidth
+          \dim_set:Nn \parfillskip { -\@pnumwidth }
+          \mode_leave_vertical:
+          \bfseries
+          \dim_add:Nn \leftskip { \l_@@_tmpa_dim }
+          \skip_horizontal:n { -\leftskip }
+          #1 \nobreak \tex_hfil:D \nobreak
+          \hbox_to_wd:nn { \@pnumwidth } { \tex_hss:D #2 }
+          \par
+        \group_end:
+      }
   }
 \cs_gset:Npn \l at subsection
   { \@dottedtocline{2}{2.5em}{2.3em} }  % #2 = 1.5em
 %    \end{macrocode}
 % \end{macro}
 %
+%    \begin{macrocode}
+%</class>
+%<*package>
+%    \end{macrocode}
+%
 % \subsection{Text markup}
 %
 % Make "|" and |"| be \enquote{short verb} characters, but not in the
@@ -1768,16 +1817,19 @@ and all files in that bundle must be distributed together.
 \providecommand\marg[1]{ \Arg{#1} }
 \providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] }
 \providecommand\parg[1]{ \texttt( \meta{#1} \texttt) }
+%</package>
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\file, \env, \pkg, \cls}
 %   This list may change\dots this is just my preference for markup.
 %    \begin{macrocode}
+%<*class|package>
 \DeclareRobustCommand \file {\nolinkurl}
 \DeclareRobustCommand \env {\texttt}
 \DeclareRobustCommand \pkg {\textsf}
 \DeclareRobustCommand \cls {\textsf}
+%</class|package>
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1786,6 +1838,7 @@ and all files in that bundle must be distributed together.
 %   Control whether to typeset the documentation/implementation or not.
 %   These simply set two switches.
 %    \begin{macrocode}
+%<*package>
 \NewDocumentCommand \EnableDocumentation { }
   { \bool_gset_true:N \g_@@_typeset_documentation_bool }
 \NewDocumentCommand \EnableImplementation { }
@@ -3060,6 +3113,7 @@ and all files in that bundle must be distributed together.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_macro_dump:
   {
+
     \topsep\MacroTopsep
     \trivlist
     \cs_set:Npn \makelabel ##1
@@ -4477,9 +4531,12 @@ and all files in that bundle must be distributed together.
   }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
 %
 %    \begin{macrocode}
-%</class>
+%<class>\RequirePackage [ kernel , nocheck , nochecktest ] { l3doc }
 %    \end{macrocode}
 %
 % \subsection{Internal macros for \LaTeX3 sources}





More information about the latex3-commits mailing list