[latex3-commits] [git/LaTeX3-latex3-pdfresources] testtagging: some preliminery tagging (0da50f4)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sat Aug 7 20:28:15 CEST 2021
Repository : https://github.com/latex3/pdfresources
On branch : testtagging
Link : https://github.com/latex3/pdfresources/commit/0da50f42d1aed040d8dae3ae414a32c69eabaac4
>---------------------------------------------------------------
commit 0da50f42d1aed040d8dae3ae414a32c69eabaac4
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sat Aug 7 20:28:15 2021 +0200
some preliminery tagging
>---------------------------------------------------------------
0da50f42d1aed040d8dae3ae414a32c69eabaac4
build.lua | 3 +-
l3pdffield-checkbox.dtx | 7 ++-
support/l3doc-tagging-testphase.sty | 115 ++++++++++++++++++++++++++++++++++++
3 files changed, 123 insertions(+), 2 deletions(-)
diff --git a/build.lua b/build.lua
index 0de8bf3..ab3f36d 100644
--- a/build.lua
+++ b/build.lua
@@ -8,7 +8,7 @@ packagedate="2021-07-31"
bundle = ""
module = "pdfmanagement-testphase"
-typesetexe="pdflatex-dev"
+typesetexe="lualatex-dev"
installfiles = {"*.sty","*.cls","*.def","*.lua","*.ltx"}
if options["target"] == "ctan" then
@@ -29,6 +29,7 @@ else
"firstaid/xcolor-patches-tmp-ltx.sty",
"firstaid/color-ltx.sty",
"support/pdfmanagement-regressiontest.sty",
+ "support/l3doc-tagging-testphase.sty",
"newpackages/new-bookmark.sty",
"newpackages/bkm-generic.def",
"newpackages/new-attachfile.sty",
diff --git a/l3pdffield-checkbox.dtx b/l3pdffield-checkbox.dtx
index a1386fc..a19fdfd 100644
--- a/l3pdffield-checkbox.dtx
+++ b/l3pdffield-checkbox.dtx
@@ -24,11 +24,15 @@
%
%<*driver>
\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DeclareDocumentMetadata{testphase={tagpdf},activate=tagging,
+%debug={para=show,uncompress}
+}
\makeatletter
\declare at file@substitution{doc.sty}{doc-v3beta.sty}
\makeatother
\documentclass[full]{l3doc}
+\usepackage{l3doc-tagging-testphase}
+\usepackage{unicode-math}
\usepackage{array,booktabs}
\usepackage{l3pdffield-testphase,bearwear}
\hypersetup{pdfauthor=The LaTeX Project,
@@ -377,6 +381,7 @@
% \end{macrocode}
% \subsection{Variables}
% There are no specific variables.
+%
% \subsection{Messages}
% There are no specific messages.
% \subsection{Appearances}
diff --git a/support/l3doc-tagging-testphase.sty b/support/l3doc-tagging-testphase.sty
new file mode 100644
index 0000000..6473815
--- /dev/null
+++ b/support/l3doc-tagging-testphase.sty
@@ -0,0 +1,115 @@
+\ProvidesPackage{l3doc-tagging-testphase}
+ [2021/08/07 v0.1 tagging patches for l3doc documentation (UF)]
+
+\RequirePackage{etoolbox}
+
+\pretocmd \@startsection{\par%<---hm
+ \tagpdfparaOff\tagstructbegin{tag=H#2}\tagmcbegin{tag=H#2}}{}{\fail}
+\AddToHook{cmd/@xsect/after}{\tagmcend\tagstructend\tagpdfparaOn\ignorespaces}
+
+\ExplSyntaxOn
+\patchcmd\@outputpage
+ {\hb at xt@\textwidth{\@thehead}}
+ {
+ \hb at xt@\textwidth
+ {
+ \bool_set_false:N \l__tag_para_bool
+ \bool_gset_eq:NN \g__ptagging__saved_in_mc_bool \g__tag_in_mc_bool
+ \bool_gset_false:N \g__tag_in_mc_bool
+ \tag_mc_begin:n {artifact=pagination}
+ \hfil
+ \tag_stop_group_begin:
+ \@thehead
+ \tag_stop_group_end:
+ \tag_mc_end:
+ \bool_gset_eq:NN \g__tag_in_mc_bool\g__ptagging_saved_in_mc_bool
+ \hfil
+ }
+ }
+{\typeout{Patching~ \string\@outputpage\space for~ tagging}}{\PATCHerror }
+
+\patchcmd\@outputpage
+ {\hb at xt@\textwidth{\@thefoot}}
+ {
+ \hb at xt@\textwidth
+ {
+ \bool_set_false:N \l__tag_para_bool
+ \bool_gset_eq:NN \g__ptagging_saved_in_mc_bool \g__tag_in_mc_bool
+ \bool_gset_false:N \g__tag_in_mc_bool
+ \hfil
+ \tag_mc_begin:n {artifact=pagination}
+ \tag_stop_group_begin:
+ \@thefoot
+ \tag_stop_group_end:
+ \tag_mc_end:
+ \bool_gset_eq:NN \g__tag_in_mc_bool\g__ptagging_saved_in_mc_bool
+ \hfil
+ }
+ }
+{\typeout{Patching~ \string\@outputpage\space for~ tagging}}{\PATCHerror }
+
+
+\cs_set_protected:Npn \__codedoc_typeset_functions:
+ {
+ \small\ttfamily
+ \__codedoc_target:
+ \Hy at MakeCurrentHref { HD. \int_use:N \c at HD@hypercount }
+ \tag_mc_end_push:
+ \tag_mc_begin:n {artifact=pagination}
+ \tag_stop_group_begin:
+ \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
+ \toprule
+ \__codedoc_function_extra_labels:
+ \__codedoc_names_typeset:
+ \__codedoc_typeset_dates:
+ \bottomrule
+ \end{tabular}
+ \tag_stop_group_end:
+ \tag_mc_end:
+ \tag_mc_begin_pop:n{}
+ \normalfont\normalsize
+ }
+
+\AddToHook{env/function/before}{\tagpdfparaOff\par}
+\AddToHook{env/function/after}{\par\tagpdfparaOn}
+\cs_set_protected:Npn \__codedoc_syntax:w
+ {
+ \box_if_empty:NF \g__codedoc_syntax_box
+ { \msg_error:nn { l3doc } { multiple-syntax } }
+ \dim_set:Nn \l__codedoc_syntax_dim
+ {
+ \textwidth
+ \bool_if:NT \l__codedoc_long_name_bool
+ { + 0.75 \marginparwidth - \l__codedoc_trial_width_dim }
+ }
+ \hbox_gset:Nw \g__codedoc_syntax_box
+ \small \ttfamily
+ \arrayrulecolor{white}
+ \begin{tabular} { @{} l @{} }
+ \noalign{\tag_mc_begin:n{artifact}} \toprule\noalign{\tag_mc_end:}
+ \tag_struct_begin:n{tag=Code}\tag_mc_begin:n{tag=Code}
+ \begin{minipage}[t]{\l__codedoc_syntax_dim}
+ \raggedright
+ \obeyspaces
+ \obeylines
+ }
+
+\cs_set_protected:Npn \__codedoc_syntax_end:
+ {
+ \end{minipage}
+ \tag_mc_end: \tag_struct_end:
+ \end{tabular}
+ \arrayrulecolor{black}
+ \hbox_gset_end:
+ \bool_if:NF \l__codedoc_in_function_bool
+ {
+ \begin{quote}
+ \mode_leave_vertical:
+ \box_use_drop:N \g__codedoc_syntax_box
+ \end{quote}
+ }
+ }
+\AddToHook{env/syntax/after}{\par\tagpdfparaOn}
+
+\ExplSyntaxOff
+\endinput
More information about the latex3-commits
mailing list.