[tex4ht-commits] [SCM] tex4ht updated: r373 - trunk/lit

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Wed Feb 7 14:46:27 CET 2018


Author: michal_h21
Date: 2018-02-07 15:46:27 +0200 (Wed, 07 Feb 2018)
New Revision: 373

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-sty.tex
Log:
New commands for semantic elements

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2018-02-01 00:42:04 UTC (rev 372)
+++ trunk/lit/ChangeLog	2018-02-07 13:46:27 UTC (rev 373)
@@ -1,3 +1,8 @@
+2018-02-07  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-sty.tex (tex4ht.sty): new commands for semantic elements.
+	https://puszcza.gnu.org.ua/bugs/index.php?387
+	
 2018-01-31  Karl Berry  <karl at freefriends.org>
 
 	* tex4ht-html5.tex: copyright.

Modified: trunk/lit/tex4ht-sty.tex
===================================================================
--- trunk/lit/tex4ht-sty.tex	2018-02-01 00:42:04 UTC (rev 372)
+++ trunk/lit/tex4ht-sty.tex	2018-02-07 13:46:27 UTC (rev 373)
@@ -1575,8 +1575,43 @@
 >>>   
 
 
+\Section{Logical commands}
 
+\<html Configure's\><<<
+\def\InsertTagStart#1#2{%
+  \edef\local:properties{\ifx\relax#2\relax\else\space#2\fi}
+  \HCode{<\get:tag{#1}\get:block:properties{#1}\local:properties>}%
+}
+\def\InsertTagEnd#1{\HCode{</\get:tag{#1}>}}
 
+\long\def\InlineElementStart#1#2{\InsertTagStart{#1}{#2}}
+\long\def\InlineElementEnd#1{\InsertTagEnd{#1}}
+
+\long\def\BlockElementStart#1#2{\ifvmode\IgnorePar\fi\EndP\InsertTagStart{#1}{#2}}
+\long\def\BlockElementEnd#1#2{\ifvmode\IgnorePar\fi\EndP\InsertTagEnd{#1}}
+
+% define default values for a new logical block
+\def\NewLogicalBlock#1{%
+  \SetTag{#1}{span}%
+  \expandafter\def\csname #1:properties\endcsname{}
+}
+
+\def\SetTag#1#2{\expandafter\xdef\csname #1:tagname\endcsname{#2}}
+\def\get:tag#1{\expandafter\expandafter\csname #1:tagname\endcsname}
+
+\def\SetBlockProperty#1#2#3{%
+  \expandafter\ifcsname #1:property:#2\endcsname\else%
+  \expandafter\edef\csname #1:properties\endcsname{\csname #1:properties\endcsname\space\csname #1:property:#2\endcsname }
+  \fi%
+  \expandafter\def\csname #1:property:#2\endcsname{#2="#3"}
+}
+
+\def\get:block:properties#1{%
+\expandafter\csname #1:properties\endcsname%
+}
+
+>>>
+
 \Section{Verify Elements}
 
 \<html Configure's\><<<



More information about the tex4ht-commits mailing list