[latex3-commits] [latex3/latex3] main: Switch to keyval for l3doc options (b827af3e3)
github at latex-project.org
github at latex-project.org
Sun Dec 10 21:50:07 CET 2023
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/b827af3e3c45b8ed3c7a02a3178741dbd41e3604
>---------------------------------------------------------------
commit b827af3e3c45b8ed3c7a02a3178741dbd41e3604
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun Dec 10 20:50:07 2023 +0000
Switch to keyval for l3doc options
One rename as a result - but that should be fine.
>---------------------------------------------------------------
b827af3e3c45b8ed3c7a02a3178741dbd41e3604
l3kernel/CHANGELOG.md | 3 ++
l3kernel/l3doc.dtx | 90 +++++++++++++++++----------------------------------
2 files changed, 32 insertions(+), 61 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 104535d2b..756a51433 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Use keyval handler for `l3doc` class otions
+
## [2023-12-08]
### Added
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 2db86afbc..f98bc831e 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -263,13 +263,13 @@ and all files in that bundle must be distributed together.
% These complementary options determine if the information given using the
% \cs{NB} and \cs{NOTE} commands is printed.
%
-% \DescribeOption{cs-break-off}
+% \DescribeOption{cs-break}
% \DescribeOption{cs-break-nohyphen}
% The commands \cs{cmd} and \cs{cs} allow hyphenation of control sequences
% after (most) underscores. By default, a hyphen is used to mark the
% hyphenation, but this can be changed with the \texttt{cs-break-nohyphen}
-% class option. To disable hyphenation of control sequencies entirely, use
-% \texttt{cs-break-off}.
+% class option. To disable hyphenation of control sequences entirely, use
+% \texttt{cs-break = false}.
%
% \subsection{Partitioning documentation and implementation}
%
@@ -349,7 +349,8 @@ and all files in that bundle must be distributed together.
% These commands allow hyphenation of control sequences after (most) underscores.
% By default, a hyphen is used to mark the hyphenation, but this can be changed with
% the \texttt{cs-break-nohyphen} class option.
-% To disable hyphenation of control sequencies entirely, use \texttt{cs-break-off}.
+% To disable hyphenation of control sequences entirely, use
+% \texttt{cs-break = false}.
% \end{function}
%
%
@@ -1435,67 +1436,34 @@ and all files in that bundle must be distributed together.
% \subsection{Options and configuration}
%
% \begin{macrocode}
-\DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { full }
+\DeclareKeys
{
- \bool_gset_true:N \g_@@_typeset_documentation_bool
- \bool_gset_true:N \g_@@_typeset_implementation_bool
- }
-\DeclareOption { onlydoc }
- {
- \bool_gset_true:N \g_@@_typeset_documentation_bool
- \bool_gset_false:N \g_@@_typeset_implementation_bool
+ a5paper .code:n = \@latexerr { Option~not~supported } { } ,
+ full .code:n =
+ {
+ \bool_gset_true:N \g_@@_typeset_documentation_bool
+ \bool_gset_true:N \g_@@_typeset_implementation_bool
+ } ,
+ onlydoc .code:n =
+ {
+ \bool_gset_true:N \g_@@_typeset_documentation_bool
+ \bool_gset_false:N \g_@@_typeset_implementation_bool
+ } ,
+ check .bool_gset:N = \g_@@_checkfunc_bool ,
+ checktest .bool_gset:N = \g_@@_checktest_bool ,
+ kernel .bool_gset:N = \g_@@_kernel_bool ,
+ stdmodule .bool_gset_inverse:N = \g_@@_kernel_bool ,
+ lm-default .bool_gset:N = \g_@@_lmodern_bool ,
+ cs-break .bool_gset_inverse:N = \g_@@_cs_break_bool ,
+ cs-break-nohyphen .code:n = \PassOptionsToPackage{nohyphen}{underscore} ,
+ show-notes .bool_gset:N = \g_@@_show_notes_bool,
+ hide-notes .bool_gset_inverse:N = \g_@@_show_notes_bool
}
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareOption { check }
- { \bool_gset_true:N \g_@@_checkfunc_bool }
-\DeclareOption { nocheck }
- { \bool_gset_false:N \g_@@_checkfunc_bool }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { checktest }
- { \bool_gset_true:N \g_@@_checktest_bool }
-\DeclareOption { nochecktest }
- { \bool_gset_false:N \g_@@_checktest_bool }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { kernel }
- { \bool_gset_true:N \g_@@_kernel_bool }
-\DeclareOption { stdmodule }
- { \bool_gset_false:N \g_@@_kernel_bool }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { cm-default }
- { \bool_gset_false:N \g_@@_lmodern_bool }
-\DeclareOption { lm-default }
- { \bool_gset_true:N \g_@@_lmodern_bool }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { cs-break-off }
- { \bool_gset_false:N \g_@@_cs_break_bool }
-\DeclareOption { cs-break-nohyphen }
- { \PassOptionsToPackage{nohyphen}{underscore} }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption { show-notes }
- { \bool_gset_true:N \g_@@_show_notes_bool }
-\DeclareOption { hide-notes }
- { \bool_gset_false:N \g_@@_show_notes_bool }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } }
-\ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default }
+\DeclareUnknownKeyHandler { \PassOptionsToClass { \CurrentOption } { article } }
+\SetKeys { full , kernel , check = false , checktest = false , lm-default }
\PassOptionsToClass { a4paper } { article }
% \end{macrocode}
%
@@ -1517,7 +1485,7 @@ and all files in that bundle must be distributed together.
% \end{macrocode}
%
% \begin{macrocode}
-\ProcessOptions
+\ProcessKeyOptions
% \end{macrocode}
%
%
More information about the latex3-commits
mailing list.