[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Testmetadata (#743) (3f6e15c9)

GitHub noreply at github.com
Wed Jan 12 18:02:43 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/3f6e15c99bb51b64b2162bf2caf939873c903b4c

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

commit 3f6e15c99bb51b64b2162bf2caf939873c903b4c
Author: Ulrike Fischer <news3 at nililand.de>
Date:   Wed Jan 12 18:02:43 2022 +0100

    Testmetadata (#743)
    
    * correct github address
    
    * update bundle name to LaTeX-lab
    
    * correct guard
    
    * rename bundle to LaTeX-lab
    
    * update keys to state in pdfresources
    
    * expand @@ correctly
    
    * clean up comments
    
    * add dtx for testphase files
    
    * missing end description
    
    * correct docu
    
    * add entries to changes text
    
    * add reference to documentation
    
    * allow test to search the texmf
    
    * remove description of activate
    
    * introduction sentence in docu
    
    * point to key documentation
    
    * remove reminder  [ci skip]
    
    * correct copyright form
    
    * add phase-I, phase-II
    
    * Some doc changes, needs further cleanup and more text.
    
    * documentation update (something wrong with *-doc.tex)
    
    * improve doc
    
    Co-authored-by: Ulrike Fischer <fischer at troubleshooting-tex.de>
    Co-authored-by: Frank Mittelbach <frank.mittelbach at latex-project.org>


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

3f6e15c99bb51b64b2162bf2caf939873c903b4c
 base/changes.txt                                   |   4 +
 base/doc/ltnews35.tex                              |   6 +-
 base/ltmeta.dtx                                    |   4 +-
 .../tlb-metadata-000.lvt                           |   0
 .../testfiles-search/tlb-metadata-000.tlg          |  25 +-
 .../testfiles-search/tlb-metadata-000.xetex.tlg    |  27 +-
 base/testfiles/tlb-metadata-000.tlg                |  10 -
 required/latex-lab/build.lua                       |  10 +-
 required/latex-lab/changes.txt                     |  10 +-
 required/latex-lab/documentmetadata-support.dtx    | 345 ++++++++++++---------
 required/latex-lab/documentmetadata-support.ins    |  16 +-
 required/latex-lab/latex-lab-testphase.dtx         |  75 +++++
 12 files changed, 306 insertions(+), 226 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 8bb024b0..c8f78ffe 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -5,6 +5,10 @@ It is provided for convenience only.  It therefore makes no claims to
 completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
+2021-12-30 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+
+	* ltmeta.dtx:
+	Adapted bundle name to new name `LaTeX-lab'
 
 2022-01-06  Joseph Wright  <Joseph.Wright-project.org>
 
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 91a77802..9b8d9c0f 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -179,9 +179,9 @@ using it. At the same time, not using the new consolidated interface
 means that existing documents are in no way affected by the work that
 is carried out and is in a wider alpha or beta test phase.
 
-\emph{either add info about some already existing keys or add a
-  reference to the place the the right documentation about this is
-  stored (to be determined).}
+Documentation about the new command and
+already existing keys are in \file{l3meta.pdf} and \file{documentmetadata-support.pdf}
+and also in the documentation of the \pkg{pdfmanagement-testphase} package.
 
 
 \section{The \pkg{latex-lab} bundle}
diff --git a/base/ltmeta.dtx b/base/ltmeta.dtx
index 1b71049d..e1c296ae 100644
--- a/base/ltmeta.dtx
+++ b/base/ltmeta.dtx
@@ -102,7 +102,7 @@
 %    which can't be detected automatically like |dvipdfmx|,
 %    must be set in the first \cs{DocumentMetadata} call (if there is more than one).
 %
-%    The full set of keys currently supported is documented elsewhere
+%    The full set of keys currently supported is documented in \texttt{documentmetadata-support.pdf}
 %    for now.
 %
 %
@@ -140,7 +140,7 @@
      {%
        \@latex at error{No support files for
                     \noexpand\DocumentMetadata found}
-         {Is the 'documentmetadata-support' bundle installed?%
+         {Is the 'LaTeX-lab' bundle installed?%
          \MessageBreak
          Without it, the declaration is ignored.}%
 %    \end{macrocode}
diff --git a/base/testfiles/tlb-metadata-000.lvt b/base/testfiles-search/tlb-metadata-000.lvt
similarity index 100%
rename from base/testfiles/tlb-metadata-000.lvt
rename to base/testfiles-search/tlb-metadata-000.lvt
diff --git a/required/latex-lab/testfiles/documentmetadata-support-001.tlg b/base/testfiles-search/tlb-metadata-000.tlg
similarity index 56%
copy from required/latex-lab/testfiles/documentmetadata-support-001.tlg
copy to base/testfiles-search/tlb-metadata-000.tlg
index 5c2fa3bc..a97b5081 100644
--- a/required/latex-lab/testfiles/documentmetadata-support-001.tlg
+++ b/base/testfiles-search/tlb-metadata-000.tlg
@@ -1,6 +1,5 @@
-This is a generated file for the l3build validation system.
+This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-First call:
 (documentmetadata-support.ltx (../pdfmanagement-testphase.sty
 Package: pdfmanagement-testphase ....-..-.. v... LaTeX PDF management testphase bundle
 (../pdfmanagement-testphase.ltx
@@ -9,16 +8,7 @@ File: pdfmanagement-testphase.ltx ....-..-.. v... PDF management code (testphase
 (../l3bitset.sty
 Package: l3bitset ....-..-.. L3 Experimental bitset support
 \l__bitset_internal_int=\count...
-)))) (../l3backend-dvips.def
-File: l3backend-dvips.def ....-..-.. L3 backend support: dvips
-\l__pdf_internal_box=\box...
-\g__pdf_backend_object_int=\count...
-\l__pdf_backend_content_box=\box...
-\l__pdf_backend_model_box=\box...
-\g__pdf_backend_annotation_int=\count...
-\g__pdf_backend_link_int=\count...
-\g__pdf_backend_link_sf_int=\count...
-) (../l3backend-testphase-dvips.def
+)))) (../l3backend-testphase-dvips.def
 File: l3backend-testphase-dvips.def ....-..-.. LaTeX PDF management testphase bundle backend support:dvips
 (../l3ref-tmp.sty
 Package: l3ref-tmp ....-..-.. L3 Experimental cross-referencing
@@ -40,17 +30,6 @@ Patching header in \@outputpage
 Patching footer in \@outputpage
 Patching \@makecol for tagging
 Patching \@makecol for tagging
-LaTeX hooks Warning: Generic hook 'package/after/multicol' is deprecated.
-(hooks)              Use hook 'package/multicol/after' instead.
 )
-LaTeX hooks Warning: Generic hook 'package/after/xcolor' is deprecated.
-(hooks)              Use hook 'package/xcolor/after' instead.
 Package pdfmanagement Info: loading pdfmanagement firstaid code for pgf
-LaTeX hooks Warning: Generic hook 'file/after/pgfrcs.sty' is deprecated.
-(hooks)              Use hook 'file/pgfrcs.sty/after' instead.
-LaTeX hooks Warning: Generic hook 'file/after/hyperxmp.sty' is deprecated.
-(hooks)              Use hook 'file/hyperxmp.sty/after' instead.
 )
-Second call:
-> \ShowTagging=undefined.
-l. ...\show\ShowTagging
diff --git a/required/latex-lab/testfiles/documentmetadata-support-001.tlg b/base/testfiles-search/tlb-metadata-000.xetex.tlg
similarity index 52%
copy from required/latex-lab/testfiles/documentmetadata-support-001.tlg
copy to base/testfiles-search/tlb-metadata-000.xetex.tlg
index 5c2fa3bc..33deefea 100644
--- a/required/latex-lab/testfiles/documentmetadata-support-001.tlg
+++ b/base/testfiles-search/tlb-metadata-000.xetex.tlg
@@ -1,6 +1,5 @@
-This is a generated file for the l3build validation system.
+This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-First call:
 (documentmetadata-support.ltx (../pdfmanagement-testphase.sty
 Package: pdfmanagement-testphase ....-..-.. v... LaTeX PDF management testphase bundle
 (../pdfmanagement-testphase.ltx
@@ -9,17 +8,8 @@ File: pdfmanagement-testphase.ltx ....-..-.. v... PDF management code (testphase
 (../l3bitset.sty
 Package: l3bitset ....-..-.. L3 Experimental bitset support
 \l__bitset_internal_int=\count...
-)))) (../l3backend-dvips.def
-File: l3backend-dvips.def ....-..-.. L3 backend support: dvips
-\l__pdf_internal_box=\box...
-\g__pdf_backend_object_int=\count...
-\l__pdf_backend_content_box=\box...
-\l__pdf_backend_model_box=\box...
-\g__pdf_backend_annotation_int=\count...
-\g__pdf_backend_link_int=\count...
-\g__pdf_backend_link_sf_int=\count...
-) (../l3backend-testphase-dvips.def
-File: l3backend-testphase-dvips.def ....-..-.. LaTeX PDF management testphase bundle backend support:dvips
+)))) (../l3backend-testphase-xetex.def
+File: l3backend-testphase-xetex.def ....-..-.. LaTeX PDF management testphase bundle backend support:XeTeX
 (../l3ref-tmp.sty
 Package: l3ref-tmp ....-..-.. L3 Experimental cross-referencing
 )
@@ -40,17 +30,6 @@ Patching header in \@outputpage
 Patching footer in \@outputpage
 Patching \@makecol for tagging
 Patching \@makecol for tagging
-LaTeX hooks Warning: Generic hook 'package/after/multicol' is deprecated.
-(hooks)              Use hook 'package/multicol/after' instead.
 )
-LaTeX hooks Warning: Generic hook 'package/after/xcolor' is deprecated.
-(hooks)              Use hook 'package/xcolor/after' instead.
 Package pdfmanagement Info: loading pdfmanagement firstaid code for pgf
-LaTeX hooks Warning: Generic hook 'file/after/pgfrcs.sty' is deprecated.
-(hooks)              Use hook 'file/pgfrcs.sty/after' instead.
-LaTeX hooks Warning: Generic hook 'file/after/hyperxmp.sty' is deprecated.
-(hooks)              Use hook 'file/hyperxmp.sty/after' instead.
 )
-Second call:
-> \ShowTagging=undefined.
-l. ...\show\ShowTagging
diff --git a/base/testfiles/tlb-metadata-000.tlg b/base/testfiles/tlb-metadata-000.tlg
deleted file mode 100644
index c9c3b369..00000000
--- a/base/testfiles/tlb-metadata-000.tlg
+++ /dev/null
@@ -1,10 +0,0 @@
-This is a generated file for the LaTeX2e validation system.
-Don't change this file in any respect.
-! LaTeX Error: No support files for \DocumentMetadata found.
-See the LaTeX manual or LaTeX Companion for explanation.
-Type  H <return>  for immediate help.
- ...                                              
-l. ...\DocumentMetadata
-                     {}   % --- what happens?
-Is the 'documentmetadata-support' bundle installed?
-Without it, the declaration is ignored.
diff --git a/required/latex-lab/build.lua b/required/latex-lab/build.lua
index 33de1bb7..296c794f 100644
--- a/required/latex-lab/build.lua
+++ b/required/latex-lab/build.lua
@@ -8,12 +8,16 @@ module = "latex-lab"
 
 ctanpkg = "latex-lab"
 
--- Location of main directory: use Unix-style path separators
 maindir = "../.."
 
 -- Minor modifications to file types
-installfiles = {"*.ltx", "*.sty", "*.tex"}
-typesetfiles = {"*.dtx"}
+installfiles = {"*.ltx", "*.sty"}
+typesetfiles = {
+                 "latex-lab-testphase.dtx",
+                 "*-doc.tex",
+		 "*-code.tex",
+	       }
+
 unpackfiles  = {"*.ins"}
 
 sourcefiles  = {"*.dtx", "*.ins", "*-????-??-??.sty"}
diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index 514b77c5..9551d74b 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,5 +1,11 @@
-2021-12-16  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+2021-12-30 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+
+	* documentmeta-support.dtx:
+	cleaned up keys and bundle name
+    * added latex-lab-testphase.dtx for wrappers for the testphase
+    key.
+
+2021-12-16 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
 
 	* README.md:
 	Add the bundle to support project work.
-
diff --git a/required/latex-lab/documentmetadata-support.dtx b/required/latex-lab/documentmetadata-support.dtx
index 1fffb76d..0c7a1d9d 100644
--- a/required/latex-lab/documentmetadata-support.dtx
+++ b/required/latex-lab/documentmetadata-support.dtx
@@ -1,6 +1,7 @@
 % \iffalse meta-comment
 %
-%% File: documentmetadata-support.dtx (C) 2021 LaTeX Project
+%% File: documentmetadata-support.dtx
+% Copyright (C) 2021-2022 The LaTeX Project
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -12,10 +13,16 @@
 %
 % The development version of the bundle can be found below
 %
-%    https://github.com/FrankMittelbach/
+%    https://github.com/latex3/latex2e
 %
 % for those people who are interested or want to report an issue.
 %
+%    \begin{macrocode}
+\def\documentmetadatasupportversion{1.0a}
+\def\documentmetadatasupportdate{2022-01-12}
+%    \end{macrocode}
+%
+%
 %<*driver>
 \documentclass{l3doc}
 \EnableCrossrefs
@@ -27,78 +34,146 @@
 %
 % \fi
 %
-
-% \title{The \texttt{documentmetadata-support} code\thanks{}}
-% \author{Frank Mittelbach, \LaTeX{} Project}
-%
-% \maketitle
-%
-%
-% \begin{abstract}
-% \end{abstract}
 %
-% \section{Introduction}
-%
-%    Currently the following keys are implemented:
+%\NewDocElement[macrolike = false ,
+%		 toplevel  = true,
+%                idxtype   =  key  ,
+%                noprint   = true  ,
+%                idxgroup  = metadata keys ,
+%                printtype = \textit{key}
+%               ]{Mkey}{mkey}
 %
-%    \begin{description}
-%       \item[\texttt{backend}] to specify the backend to use; this is
-%           usually determined automatically.
-%^^A       This will probably be extended to  pass the value also to packages.
 %
-%       \item[\texttt{pdfversion}] e.g. \texttt{pdfversion=1.7}
+% \title{The \texttt{documentmetadata-support} code\thanks{This file
+%      has version \documentmetadatasupportversion\ dated
+%      \documentmetadatasupportdate,  \copyright\ \LaTeX\
+%    Project.}}
+% \author{Frank Mittelbach, Ulrike Fischer, \LaTeX{} Project}
 %
-%       \item[\texttt{uncompress}] no value. Forces an uncompressed pdf.
+% \maketitle
 %
-%       \item[\texttt{lang}] to set the Lang entry in the Catalog.
-%          E.g. \texttt{lang=de-DE}. The initial value is |en-US|
 %
-%       \item[\texttt{pdfstandard}] Choice key to set the pdf standard.
-%         Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as
-%         values. The casing is irrelevant, |a-1b| works too.
-%         The underlying code to ensure the requirements (as far as they
-%         can be ensured) is incomplete, but a color profile is included and the
-%         /OutputIntent is set. The |u| variants for example do not force unicode,
-%         but they will pass the information to hyperref and hyperxmp. The |a| variants
-%         do \emph{not} enforce (or even test) a tagged pdf yet.
-%         More information can be found in the documentation
-%         of \pkg{l3pdfmeta}.
+% \section{Introduction}
 %
-%       \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
+%    The kernel command \cs{DocumentMetadata}, which can be used as
+%    the very first declaration in a document (i.e., before
+%    \cs{documentclass}), defines metadata and other configuration
+%    data that applies to the document as a whole (using a key/value
+%    syntax).
+%
+%    While the underlying functionality is still under
+%    development (e.g., further keys will be added over time and keys
+%    marked temporary may vanish again) the code for
+%    \cs{DocumentMetadata} is place in a separate bundle, so that it
+%    is easier to update it without the need to build a full \LaTeX{}
+%    release. Over time the functionality will move fully into the
+%    kernel.
+%
+%    From a process perspective \cs{DocumentMetadata} loads the
+%    \pkg{pdfmanagement} code the first time it is called and then
+%    redefines itself to only manage key/value pairs in case it is
+%    called more than once. In particular, this means that a document
+%    without a \cs{DocumentMetadata} declaration has no code available
+%    for extended management of PDF output as needed for various
+%    features developed as part of the multi-year ``Tagged PDF''
+%    project~\cite{blueprint}.
+%
+%
+%
+% \section{Currently supported key/values}
+%
+%
+% Currently the following keys are implemented for \cs{DocumentMetadata}:
+% \DescribeMkey{colorprofiles}
+% \DescribeMkey{debug}
+% \DescribeMkey{lang}
+% \DescribeMkey{pdfstandard}
+% \DescribeMkey{pdfversion}
+% \DescribeMkey{testphase}
+% \DescribeMkey{uncompress}
+%
+% \begin{description}
+%    \item[\texttt{backend}] Passes the backend name to expl3. This is
+%      needed only if the needed backend can't be automatically
+%      determined or if the workflow used requires a special backend.
+%
+%^^A    This will probably be extended to  pass the value also to
+%^^A      packages.
+%
+%    \item[\texttt{pdfversion}] Sets the PDF version explicitly, e.g., \texttt{pdfversion=1.7}
+%    \item[\texttt{uncompress}] (no value) Forces an uncompressed pdf
+%      --- mainly for debugging purposes.
+%
+%    \item[\texttt{lang}] Explicitly sets the Lang entry in the Catalog,
+%     e.g., \texttt{lang=de-DE}. If not given the default value used is |en-US|.
+%
+%    \item[\texttt{pdfstandard}] Choice key to set the pdf standard.
+%      Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as
+%      values. The casing is irrelevant, |a-1b| works too.
+%      The underlying code to ensure the requirements (as far as they
+%      can be ensured) is still incomplete, but a color profile is included and the
+%      \texttt{/OutputIntent} is set. The |u| variants for example do not force unicode,
+%      but they will pass the information to hyperref and hyperxmp. The |a| variants
+%      do \emph{not} enforce (or even test) a tagged pdf yet.
+%      More information can be found in the documentation
+%      of \pkg{l3pdfmeta}.
+%
+%    \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
 %       are described in the documentation of \pkg{l3pdfmeta}.
 %
-%       \item[\texttt{pdfmanagement}] Boolean. This activates/deactivates
-%         the core management code. By default the value is true.
-%
-%       \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches
+%    \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts
+%    and their effect will change over time, when testphase packages are added or
+%    removed or when the code is moved into the kernel.
+%     \begin{description}
+%    \item[\texttt{phase-I}]
+%       This value loads code implementing the first phase of the project~\cite{blueprint}, i.e., it 
+%       will load the tagpdf package. It will also activate tagging by issuing
+%       |\tagpdfsetup{activate,interwordspace}|. This phase
+%       is frozen.
+%    \item[\texttt{phase-II}]
+%       This is the current development phase.
+%       Currently it differs from \texttt{phase-I} only in one point: It will
+%       additionally activate tagging of paragraphs with
+%       |\tagpdfsetup{paratagging}|. In the upcoming months it will
+%       also enable automatic tagging of other basic document elements.
+%    \end{description}
+%    The |testphase| key can only be used in the first \cs{DocumentMetadata}.
+%
+%    \item[\texttt{debug}] This key activates some debug options. It takes a list of key-values
+%    as value. Currently the following keys are known:
+%     \begin{description}
+%     \item[\texttt{para}] with the default and only value |show|. It will activate the |paratagging-show|
+%       option of \pkg{tagpdf},
+%     \item[\texttt{log}]  with the values as described in the documentation \pkg{tagpdf},
+%     \item[\texttt{uncompress}] which does the same as |uncompress| as main key
+%     \item[\texttt{pdfmanagement}] a boolean which allows to deactivate the pdfmanagement.
+%     \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches
 %       related to them. More information can be found in the documentation of
 %       \pkg{pdfmanagement-firstaid}.
-%
-%       \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts
-%       and their effect will change over time, when testphase packages are added or
-%       removed when the code is moved into the kernel. Currently the accepted values are
-%       \texttt{tagpdf} (this loads the tagpdf package), \texttt{headings} (this loads
-%       code which reimplements heading commands), and \texttt{ptagging}, which loads code
-%       to allow paragraph tagging to work with engines other than luatex.
-%       \item[\texttt{activate}] This key is used to enable some document wide functions. It is
-%       currently in an experimental state. The values and their behaviour are subject to change.
-%       Currently the only value is |tagging|,
-%       which will do |\tagpdfsetup{activate,paratagging,interwordspace}|. It requires that
-%       \pkg{tagpdf} has been loaded first with the |testphase| key.
-%       \item[\texttt{debug}] This key activates some debug options. Currently only the
-%       keys |para| (with the default and only value |show|),
-%       and |log| (with the values of \pkg{tagpdf}) and |uncompress| (which does the same
-%       as |uncompress| as main key)  are known.
 %    \end{description}
+% \end{description}
+%
+% \bibliographystyle{plain}
+%
+% \begin{thebibliography}{9}
 %
+% \bibitem{blueprint} Frank Mittelbach and Chris Rowley:
+%   \emph{\LaTeX{} Tagged PDF\,---\,A blueprint for a large project}.
+%   \url{https://latex-project.org/publications/indexbyyear/2020/}
 %
+% \end{thebibliography}
 %
-% \StopEventually{\setlength\IndexMin{200pt}  \PrintIndex  }
 %
 %
+% \MaybeStop{\setlength\IndexMin{200pt}  \PrintIndex  }
+%
+% \begin{implementation}
+%
 % \section{The Implementation}
 %
+%
 %    \begin{macrocode}
+%<@@=pdfmanagement>
 %<*code>
 %    \end{macrocode}
 %
@@ -132,7 +207,7 @@
 %    The backend can contain management commands, so the boolean should
 %    be set to true first.
 %    \begin{macrocode}
-        \bool_gset_true:N \g__pdfmanagement_active_bool
+        \bool_gset_true:N \g_@@_active_bool
         \keys_set_groups:nnn { document / metadata} {init}{ #1 }
         %if no backend has been loaded force it now:
         \str_if_exist:NF \c_sys_backend_str
@@ -146,12 +221,12 @@
           \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
         \ExplSyntaxOff\makeatother
 %    \end{macrocode}
-%    Set the default language, process the rest of the keys,
+%    Set the default language (this requires that the backend has been loaded),
+%    process the rest of the keys,
 %    and setup the generic driver.
 %    \begin{macrocode}
-%FMi wouldn't it be cleaner to set the default when declaring the key?
         \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
-        \bool_if:NT \g__pdfmanagement_active_bool
+        \bool_if:NT \g_@@_active_bool
           {
             \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
           }
@@ -168,28 +243,20 @@
         \cs_set_protected:Npn \DocumentMetadata ##1
           {
             \keys_set_filter:nnn  { document / metadata } { init } { ##1 }
-%FMi
             \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-%FMi this doesn't seem to need the F case if we move the removal to
-%    the front
             \bool_if:NT \g__pdfmanagement_active_bool
              {
-%FMi               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
                \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
              }
-%FMi             {
-%FMi               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-%FMi             }
           }
 %    \end{macrocode}
-% Load more modules, the testphase code and the firstaid code.
+% Load more modules, the testphase code and the firstaid code. The code is only
+% loaded in the first \cs{DocumentMetadata} call!
 %    \begin{macrocode}
-%FMi this doesn't look correct -- testphase code is not loaded if only
-%    in second call --- see test 001
-        \g__pdfmanagement_testphase_tl
+        \g_@@_testphase_tl
         \RequirePackage{pdfmanagement-firstaid}
       }
-}
+  }
 %    \end{macrocode}
 %  \end{macro}
 
@@ -197,20 +264,23 @@
 
 
 %    \begin{macrocode}
-
 %FMi defined elsewhere
 %FMi
-%FMi \clist_new:N \g__pdfmanagement_firstaidoff_clist
-%FMi \tl_new:N \g__pdfmanagement_testphase_tl
-
+%FMi \clist_new:N \g_@@_firstaidoff_clist
+%FMi \tl_new:N \g_@@_testphase_tl
+% UFi should the definition move to here?
 \keys_define:nn { document / metadata }
   {
-     backend .choices:nn =
-       { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
-       {
+    backend .choices:nn =
+      { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
+      {
         \sys_load_backend:n {#1}
       },
-    ,backend .groups:n = { init }
+    backend .groups:n = { init } ,
+  }
+
+\keys_define:nn { document / metadata }
+  {
     ,pdfversion .code:n =
       {
         \pdf_version_gset:n { #1 }
@@ -246,57 +316,38 @@
       {
         \msg_warning:nnn{pdf}{unknown-standard}{#1}
       }
-    ,pdfmanagement .bool_gset:N = \g__pdfmanagement_active_bool
-    ,firstaidoff .clist_gset:N = \g__pdfmanagement_firstaidoff_clist
     ,testphase .multichoice:
     ,testphase / tagpdf .code:n =
       {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+        \tl_gput_right:Nn\g_@@_testphase_tl
           {
-            \RequirePackage{tagpdf}
-            \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
-          }
-      }
-    ,testphase / headings .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \RequirePackage{headings-testphase}
-            \AddToDocumentProperties [document]{testphase/headings}{loaded}
-          }
-      }
-    ,testphase / ptagging .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \AddToHook{class/after}
+            \file_if_exist_input:nF {tagpdf-latex-lab-testphase.ltx}
               {
-                \RequirePackage{ptagging-testphase}
-                \AddToDocumentProperties [document]{testphase/ptagging}{loaded}
+                \RequirePackage{tagpdf}
+                \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
+                \tagpdfsetup{activate,paratagging,interwordspace}
+                \AddToDocumentProperties [document]{tagging}{active}
+                \AddToDocumentProperties [document]{tagging/para}{active}
+                \AddToDocumentProperties [document]{tagging/interwordspace}{active}
               }
           }
       }
     ,testphase / unknown .code:n =
       {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+        \tl_gput_right:Nn\g_@@_testphase_tl
            {
-             \AddToHook{class/after}
-               {
-                 \RequirePackage{#1-testphase}
-                 \AddToDocumentProperties [document]{testphase/#1}{loaded}
-               }
+             \file_if_exist_input:nF {#1-latex-lab-testphase.ltx}
+              {
+                 \msg_warning:nnn{meta}{latex-lab-pkg-missing}{#1}
+              }
            }
       }
     ,activate .multichoice:
     ,activate / tagging .code:n =
       {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{activate,paratagging,interwordspace}
-            \AddToDocumentProperties [document]{tagging}{active}
-            \AddToDocumentProperties [document]{tagging/para}{active}
-            \AddToDocumentProperties [document]{tagging/interwordspace}{active}
-          }
+        \PackageWarning{pdfmanagement-testphase}
+         {The~activate~key~is~deprecated.\MessageBreak
+          Tagging~is~activated~with~'testphase=tagpdf'~directly}{}
       }
     ,debug .code:n =
       {
@@ -304,30 +355,48 @@
       }
     ,debug / para .code:n =
       {
-        \AddToHook{package/after/tagpdf}
+        \AddToHook
+          {
+            package/tagpdf/after
+          }
           {
-            \tagpdfsetup{paratagging-show}
+             \tagpdfsetup{paratagging-show}
           }
       }
     ,debug / log .code:n =
       {
-        \AddToHook{package/after/tagpdf}
+        \AddToHook
+          {
+           package/tagpdf/after
+          }
           {
-            \tagpdfsetup{log=#1}
+             \tagpdfsetup{log=#1}
           }
       }
     ,debug / uncompress .code:n =
       {
         \pdf_uncompress:
       }
+    ,debug / pdfmanagement .bool_gset:N = \g_@@_active_bool
+    ,debug / firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist
   }
+
+
 %    \end{macrocode}
-%    
+% \subsection{Messages}
 %    \begin{macrocode}
-\msg_new:nnn  { meta } { after-class }
-              {
+%UFi is meta the right module name here?
+\prop_gput:Nnn \g_msg_module_type_prop { meta } { LaTeX }
+\prop_gput:Nnn \g_msg_module_name_prop { meta } { DocumentMetadata }
+
+\msg_new:nnn { meta } { after-class }
+             {
                 \token_to_str:N \DocumentMetadata \c_space_tl
                 should~be~used~only~before~\token_to_str:N\documentclass
+             }
+\msg_new:nnn { meta } { latex-lab-pkg-missing }
+             {
+               LaTeX-lab~package~'#1'~not~found.
               }
 %    \end{macrocode}
 %
@@ -337,40 +406,10 @@
 %
 %
 %    \begin{macrocode}
-%<*code>
+%</code>
 %    \end{macrocode}
 %
+% \end{implementation}
+%
 % \Finale
 %
-
-
-
-\endinput
-
-\prop_new:N \g__pdfmanagement_documentproperties_prop %
-\NewDocumentCommand\AddToDocumentProperties{O{\@currname}mm}
-  {
-    \exp_args:NNx
-      \prop_gput:Nnn \g__pdfmanagement_documentproperties_prop
-        {
-          \tl_if_blank:eTF {#1}{top-level/}{#1/} #2
-        }
-        { #3}
-  }
-\NewExpandableDocumentCommand\GetDocumentProperties{m}
-  {
-    \prop_item:Nn \g__pdfmanagement_documentproperties_prop {#1}
-  }
-\msg_new:nnn  { pdfmanagement } { show-properties }
-  {
-    The~following~document~properties~have~been~stored:
-    #1
-  }
-\NewDocumentCommand\ShowDocumentProperties {}
-  {
-    \msg_show:nnx {pdfmanagement}{show-properties}
-      {
-        \prop_map_function:NN \g__pdfmanagement_documentproperties_prop \msg_show_item:nn
-      }
-  }
-
diff --git a/required/latex-lab/documentmetadata-support.ins b/required/latex-lab/documentmetadata-support.ins
index 136fbabf..431f88d8 100644
--- a/required/latex-lab/documentmetadata-support.ins
+++ b/required/latex-lab/documentmetadata-support.ins
@@ -3,10 +3,10 @@
 %% driver files from the dtx file(s) in this package when run through
 %% LaTeX or TeX.
 %%
-%% Copyright 2021 LaTeX Project
+%% Copyright (C) 2021-2022 The LaTeX Project
 %%
 %%
-%% This file is part of the documentmetadata-support Bundle for LaTeX.
+%% This file is part of the `LaTeX-lab Bundle' for LaTeX.
 %% -------------------------------------------------------------------
 %%
 %% It may be distributed and/or modified under the
@@ -29,7 +29,7 @@
 
 \keepsilent
 
-\usedir{tex/latex/contrib/documentmetadata-support}
+\usedir{tex/latex/contrib/latex-lab}
 
 \preamble
 
@@ -37,7 +37,7 @@ This is a generated file.
 
 Copyright 2021 LaTeX Project
 
-This file was generated from file(s) of the LaTeX `documentmetadata-support Bundle'.
+This file was generated from file(s) of the  `LaTeX-lab Bundle'.
 ------------------------------------------------------------------------------------
 
 It may be distributed and/or modified under the
@@ -49,12 +49,12 @@ and version 1.3c or later is part of all distributions of LaTeX
 version 2008 or later.
 
 This file may only be distributed together with a copy of the LaTeX
-`documentmetadata-support Bundle'. You may however distribute the `documentmetadata-support Bundle'
+`LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
 without such generated files.
 
 The newest sources can be found below
 
-   https://github.com/latex3/documentmetadata-support/
+   https://github.com/latex3/latex2e/required/latex-lab
 
 where one can also log issues in case there are any.
 
@@ -64,4 +64,8 @@ where one can also log issues in case there are any.
 
 \generate{\file{documentmetadata-support.ltx}{\from{documentmetadata-support.dtx}{code}}}
 
+\generate{\file{tagpdf-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{tagpdf}}}
+\generate{\file{phase-I-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{phase-I}}}
+\generate{\file{phase-II-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{phase-II}}}
+
 \endbatchfile
diff --git a/required/latex-lab/latex-lab-testphase.dtx b/required/latex-lab/latex-lab-testphase.dtx
new file mode 100644
index 00000000..670bbaf4
--- /dev/null
+++ b/required/latex-lab/latex-lab-testphase.dtx
@@ -0,0 +1,75 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-testphase.dtx
+% Copyright (C) 2021-2022 The LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-testphase.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+
+% \title{The \texttt{latex-lab-testphase} code\thanks{}}
+% \author{Ulrike Fischer \LaTeX{} Project}
+%
+% \maketitle
+%
+%
+% \begin{abstract}
+% \end{abstract}
+%
+% \section{Introduction}
+%
+%    This code implements small files which can be loaded with the |testphase|
+%    key of \cs{DocumentMetadata}. Currently it only contains a
+%    wrapper for \pkg{tagpdf}, but this will be extended to allow user to load
+%    well defined parts of the tagged PDF project.
+%
+%
+%
+% \StopEventually{\setlength\IndexMin{200pt}  \PrintIndex  }
+%
+%
+% \section{The Implementation}
+%
+%    \begin{macrocode}
+%<*tagpdf|phase-I|phase-II>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\RequirePackage{tagpdf}
+\AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
+%</tagpdf|phase-I|phase-II>
+%<tagpdf|phase-II>\tagpdfsetup{activate,paratagging,interwordspace}
+%<phase-I>\tagpdfsetup{activate,interwordspace}
+%<*tagpdf|phase-I|phase-II>
+\AddToDocumentProperties [document]{tagging}{active}
+\AddToDocumentProperties [document]{tagging/para}{active}
+\AddToDocumentProperties [document]{tagging/interwordspace}{active}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</tagpdf|phase-I|phase-II>
+%    \end{macrocode}
+% \Finale
+%





More information about the latex3-commits mailing list.