Skip to content

Commit

Permalink
refactor: filter sensitive information by key gourps
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Jan 12, 2025
1 parent b8d3a39 commit 5756a25
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions sjtutex/source/sjtutex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4332,16 +4332,21 @@
subject .tl_set:c = { l_@@_info_subject_ #1 _tl } ,
keywords .clist_set:c = { l_@@_info_keywords_ #1 _clist } ,
author .tl_set:c = { l_@@_info_author_ #1 _tl } ,
author .groups:n = { sensitive } ,
id .meta:nn = { sjtu / info } { id = {##1} } ,
supervisor .tl_set:c = { l_@@_info_supervisor_ #1 _tl } ,
supervisor .groups:n = { sensitive } ,
assoc-supervisor .tl_set:c = { l_@@_info_assoc_supervisor_ #1 _tl } ,
assoc-supervisor .groups:n = { sensitive } ,
assoc_supervisor .meta:n = { assoc-supervisor = {##1} } ,
co-supervisor .tl_set:c = { l_@@_info_co_supervisor_ #1 _tl } ,
co-supervisor .groups:n = { sensitive } ,
co_supervisor .meta:n = { co-supervisor = {##1} } ,
degree .tl_set:c = { l_@@_info_degree_ #1 _tl } ,
department .tl_set:c = { l_@@_info_department_ #1 _tl } ,
major .tl_set:c = { l_@@_info_major_ #1 _tl } ,
fund .clist_set:c = { l_@@_info_fund_ #1 _clist } ,
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 }
Expand All @@ -4359,7 +4364,8 @@
{
\clist_map_inline:Nn \g_@@_lang_clist
{ \tl_set:cn { l_@@_info_id_ ##1 _tl } {#1} }
}
} ,
id .groups:n = { sensitive }
}
% \end{macrocode}
% \end{macro}
Expand All @@ -4368,27 +4374,6 @@
% \begin{macrocode}
\clist_map_inline:Nn \g_@@_lang_clist
{ \@@_info_keys_define:n {#1} }
% \end{macrocode}
%
% 盲审模式下隐藏作者、导师姓名等信息。
% \begin{macrocode}
\AddToHook { begindocument / before }
{
\bool_if:NT \g_@@_review_bool
{
\clist_map_inline:Nn \g_@@_lang_clist
{
\clist_map_inline:nn
{ author, supervisor }
{ \tl_clear:c { l_@@_info_ ##1 _ #1 _tl } }
\clist_map_inline:nn
{ assoc_supervisor, co_supervisor }
{ \tl_set_eq:cN { l_@@_info_ ##1 _ #1 _tl } \c_novalue_tl }
\clist_clear:c { l_@@_info_fund_ #1 _clist }
}
\tl_clear:N \l_@@_info_id_zh_tl
}
}
%</thesis>
% \end{macrocode}
%
Expand Down Expand Up @@ -5412,8 +5397,17 @@
%
% \begin{macro}{\sjtusetup}
% 用户设置接口。
% 盲审模式下不会设置敏感信息。
% \begin{macrocode}
\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } }
%<!thesis>\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } }
%<*thesis>
\exp_args:NNne \NewDocumentCommand \sjtusetup { }
{
\bool_if:NTF \g_@@_review_bool
{ \exp_not:N \keys_set_exclude_groups:nnn { sjtu } { sensitive } }
{ \exp_not:N \keys_set:nn { sjtu } }
}
%</thesis>
% \end{macrocode}
% \end{macro}
%
Expand Down

0 comments on commit 5756a25

Please sign in to comment.