Skip to content

Commit

Permalink
feat: support custom extra info keys
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Jan 11, 2025
1 parent c090366 commit 70c4c87
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions sjtutex/source/sjtutex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4363,7 +4363,19 @@
fund .groups:n = { sensitive } ,
date .meta:nn = { sjtu / info } { date = {##1} } ,
display-date .tl_set:c = { l_@@_info_date_ #1 _tl } ,
show .clist_set:c = { l_@@_info_show_ #1 _clist }
show .clist_set:c = { l_@@_info_show_ #1 _clist } ,
show .groups:n = { sensitive } ,
extra .meta:nn = { sjtu / info / #1 / extra } {##1} ,
extra / unknown .code:n =
{
\keys_if_exist:nnF { sjtu / info / #1 } { \l_keys_key_tl }
{
\tl_set_eq:NN \l_@@_tmp_tl \l_keys_key_tl
\tl_replace_all:Nnn \l_@@_tmp_tl { - } { _ }
\tl_set:co { l_@@_name_ \l_@@_tmp_tl _ #1 _tl } { \use_i:nn ##1 }
\tl_set:co { l_@@_info_ \l_@@_tmp_tl _ #1 _tl } { \use_ii:nn ##1 }
}
}
}
}
% \end{macrocode}
Expand Down Expand Up @@ -4610,8 +4622,22 @@
{
\tl_set:Nn \l_@@_tmp_tl {##1}
\tl_replace_all:Nnn \l_@@_tmp_tl { - } { _ }
\exp_args:Nv \tl_if_novalue:nF
{ l_@@_info_ \l_@@_tmp_tl _ \l_@@_lang_tl _tl }
\bool_lazy_all:nT
{
{
\tl_if_exist_p:c
{ l_@@_name_ \l_@@_tmp_tl _ \l_@@_lang_tl _tl }
}
{
\tl_if_exist_p:c
{ l_@@_info_ \l_@@_tmp_tl _ \l_@@_lang_tl _tl }

}
{
! \exp_args:Nv \tl_if_novalue_p:n
{ l_@@_info_ \l_@@_tmp_tl _ \l_@@_lang_tl _tl }
}
}
{
\clist_put_right:Ne \l_@@_tmp_clist
{
Expand Down

0 comments on commit 70c4c87

Please sign in to comment.