[latex3-commits] [latex3/tagpdf] develop: add test for para sockets (52e1006)

github at latex-project.org github at latex-project.org
Mon Sep 23 19:15:22 CEST 2024


Repository : https://github.com/latex3/tagpdf
On branch  : develop
Link       : https://github.com/latex3/tagpdf/commit/52e1006b1da30622eba405d3f2edbdc303ac450b

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

commit 52e1006b1da30622eba405d3f2edbdc303ac450b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Sep 23 19:15:22 2024 +0200

    add test for para sockets


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

52e1006b1da30622eba405d3f2edbdc303ac450b
 CHANGELOG.md    |   2 +
 tagpdf-user.dtx | 125 +++++++++++++++++++++++++++++---------------------------
 2 files changed, 67 insertions(+), 60 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90bfaf6..493fb7c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ this project uses date-based 'snapshot' version identifiers.
 ## [Unreleased]
 ### Fixed
  - corrected a few temp variables
+### Changed
+ - make para-sockets optional so that they can move to lttagging.
 
 ## [2024-09-16]
 ### Added 
diff --git a/tagpdf-user.dtx b/tagpdf-user.dtx
index 8dfa689..84f0887 100644
--- a/tagpdf-user.dtx
+++ b/tagpdf-user.dtx
@@ -977,81 +977,86 @@
 % be used if the block code is used.
 % It is possible that we will need more variants, so
 % we setup a socket so that the code can be easily switched.
+% This code should move into lttagging, so we add a test for
+% the transition.  
 %    \begin{macrocode}
-\socket_new:nn      {tagsupport/para/begin}{0}
-\socket_new:nn      {tagsupport/para/end}{0}
-
-\socket_new_plug:nnn{tagsupport/para/begin}{plain}
+\str_if_exist:cF { l__socket_tagsupport/para/begin_plug_str }
  {
-   \bool_if:NT \l_@@_para_bool
+    \socket_new:nn      {tagsupport/para/begin}{0}
+    \socket_new:nn      {tagsupport/para/end}{0}
+
+    \socket_new_plug:nnn{tagsupport/para/begin}{plain}
      {
-       \bool_if:NF \l_@@_para_flattened_bool
-          {
-            \@@_gincr_para_main_begin_int:
-            \tag_struct_begin:n
+       \bool_if:NT \l_@@_para_bool
+         {
+           \bool_if:NF \l_@@_para_flattened_bool
               {
-                tag=\l_@@_para_main_tag_tl,
+                \@@_gincr_para_main_begin_int:
+                \tag_struct_begin:n
+                  {
+                    tag=\l_@@_para_main_tag_tl,
+                  }
+                \@@_para_main_store_struct:   
               }
-            \@@_para_main_store_struct:   
-          }
-        \@@_gincr_para_begin_int:
-        \tag_struct_begin:n {tag=\l_@@_para_tag_tl}
-        \@@_check_para_begin_show:nn {green}{}
-        \tag_mc_begin:n {}
+            \@@_gincr_para_begin_int:
+            \tag_struct_begin:n {tag=\l_@@_para_tag_tl}
+            \@@_check_para_begin_show:nn {green}{}
+            \tag_mc_begin:n {}
+         }   
      }
- }
-\socket_new_plug:nnn{tagsupport/para/begin}{block}
- {
-   \bool_if:NT \l_@@_para_bool
+    \socket_new_plug:nnn{tagsupport/para/begin}{block}
      {
-       \legacy_if:nF { @inlabel }
+       \bool_if:NT \l_@@_para_bool
          {
-           \@@_check_typeout_v:n
-             {==>~ @endpe = \legacy_if:nTF { @endpe }{true}{false} \on at line }
-           \legacy_if:nF { @endpe }
-            {
-              \bool_if:NF \l_@@_para_flattened_bool
-                 {
-                   \@@_gincr_para_main_begin_int:
-                   \tag_struct_begin:n
-                    {
-                     tag=\l_@@_para_main_tag_tl,
-                     attribute-class=\l_@@_para_main_attr_class_tl,
-                    }
-                   \@@_para_main_store_struct: 
+           \legacy_if:nF { @inlabel }
+             {
+               \@@_check_typeout_v:n
+                 {==>~ @endpe = \legacy_if:nTF { @endpe }{true}{false} \on at line }
+               \legacy_if:nF { @endpe }
+                {
+                  \bool_if:NF \l_@@_para_flattened_bool
+                     {
+                       \@@_gincr_para_main_begin_int:
+                       \tag_struct_begin:n
+                        {
+                         tag=\l_@@_para_main_tag_tl,
+                         attribute-class=\l_@@_para_main_attr_class_tl,
+                        }
+                       \@@_para_main_store_struct: 
+                     }
                  }
-             }
-            \@@_gincr_para_begin_int:
-            \@@_check_typeout_v:n {==>~increment~ P \on at line }
-            \tag_struct_begin:n
-              {
-                tag=\l_@@_para_tag_tl
-                ,attribute-class=\l_@@_para_attr_class_tl
-              }
-            \@@_check_para_begin_show:nn {green}{\PARALABEL}    
-            \tag_mc_begin:n {}
-      }
-    }  
- }
+                \@@_gincr_para_begin_int:
+                \@@_check_typeout_v:n {==>~increment~ P \on at line }
+                \tag_struct_begin:n
+                  {
+                    tag=\l_@@_para_tag_tl
+                    ,attribute-class=\l_@@_para_attr_class_tl
+                  }
+                \@@_check_para_begin_show:nn {green}{\PARALABEL}    
+                \tag_mc_begin:n {}
+          }
+        }  
+     }
 %    \end{macrocode}
 % there was no real difference between the original and
 % in the block variant, only a debug message. We therefore
 % define only a plain variant.
 %    \begin{macrocode}
-\socket_new_plug:nnn{tagsupport/para/end}{plain}
-  {
-    \bool_if:NT \l_@@_para_bool
+    \socket_new_plug:nnn{tagsupport/para/end}{plain}
       {
-        \@@_gincr_para_end_int:
-        \@@_check_typeout_v:n {==>~increment~ /P \on at line }
-        \tag_mc_end:
-        \@@_check_para_end_show:nn {red}{}
-        \tag_struct_end:
-        \bool_if:NF \l_@@_para_flattened_bool
-         {
-           \@@_gincr_para_main_end_int:
-           \tag_struct_end:
-         }
+        \bool_if:NT \l_@@_para_bool
+          {
+            \@@_gincr_para_end_int:
+            \@@_check_typeout_v:n {==>~increment~ /P \on at line }
+            \tag_mc_end:
+            \@@_check_para_end_show:nn {red}{}
+            \tag_struct_end:
+            \bool_if:NF \l_@@_para_flattened_bool
+             {
+               \@@_gincr_para_main_end_int:
+               \tag_struct_end:
+             }
+          }  
       }
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list.