[tex4ht-commits] [SCM] tex4ht updated: r1573 - trunk/lit
Michal Hoftich
INVALID.NOREPLY at gnu.org.ua
Thu Oct 3 16:04:04 CEST 2024
Author: michal_h21
Date: 2024-10-03 14:04:04 +0000 (Thu, 03 Oct 2024)
New Revision: 1573
Modified:
trunk/lit/ChangeLog
trunk/lit/mktex4ht-cnf.tex
trunk/lit/tex4ht-4ht.tex
trunk/lit/tex4ht-html4.tex
Log:
added support for the lua-ul package
Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog 2024-10-02 20:46:24 UTC (rev 1572)
+++ trunk/lit/ChangeLog 2024-10-03 14:04:04 UTC (rev 1573)
@@ -1,3 +1,9 @@
+2024-10-03 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-4ht.tex (lua-ul.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for the Lua-ul
+ package.
+
2024-10-01 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-4ht.tex (piton.4ht): prevent default use of visible space
Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex 2024-10-02 20:46:24 UTC (rev 1572)
+++ trunk/lit/mktex4ht-cnf.tex 2024-10-03 14:04:04 UTC (rev 1573)
@@ -342,6 +342,7 @@
\AddFile{9}{sverb}
\AddFile{9}{syntax}
\AddFile{9}{soul}
+\AddFile{9}{lua-ul}
\AddFile{5}{plain}
\AddFile{9}{manmac}
\AddFile{8}{mex}
Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex 2024-10-02 20:46:24 UTC (rev 1572)
+++ trunk/lit/tex4ht-4ht.tex 2024-10-03 14:04:04 UTC (rev 1573)
@@ -39141,6 +39141,95 @@
\NewConfigure{textul}{2}
>>>
+%%%%%%%%%%%%%%%%%%%%%
+\Section{Lua-ul}
+%%%%%%%%%%%%%%%%%%%%%
+
+\<lua-ul.4ht\><<<
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% lua-ul.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<lua-ul getxcolor|>
+\ExplSyntaxOn
+|<lua-ul hooks|>
+\ExplSyntaxOff
+\Hinput{lua-ul}
+\endinput
+>>> \AddFile{9}{lua-ul}
+
+If Xcolor is not loaded explicitly in the document, the \Verb+\get:xcolorcss+ command
+is not available. We want to be able to save colors of underlines etc, so we need
+to provide a variant that will work regardless of Xcolor\dots
+
+\<lua-ul getxcolor\><<<
+\def\lua:ul:get:xcolorcss#1#2{%
+ \expandafter\extractcolorspec\expandafter{#1}{\tsf:color}%
+ \expandafter\convertcolorspec\tsf:color{HTML}\tsf:color%
+ \edef#2{\#\tsf:color}%
+}
+>>>
+
+\<lua-ul hooks\><<<
+
+\NewConfigure{highLight}{2}
+\NewDocumentCommand \:highLight {O{\l__luaul_highlight_color_tl} +m} {
+ \group_begin:
+ \lua:ul:get:xcolorcss{#1}\:highLightColor%
+ \a:highLight#2\b:highLight%
+ \group_end:
+}
+
+\HLet\highLight\:highLight
+
+\NewConfigure{strikeThrough}{2}
+\NewDocumentCommand \:strikeThrough {o +m} {
+ \group_begin:
+ \IfValueTF {#1} {
+ \lua:ul:get:xcolorcss{#1}\:strikeThroughColor%
+ }{\def\:strikeThroughColor{inherit}}
+ \a:strikeThrough#2\b:strikeThrough
+ \group_end:
+ }
+
+\HLet\strikeThrough\:strikeThrough
+
+\NewConfigure{underLine}{2}
+\NewDocumentCommand \:underLine {o +m} {
+ \group_begin:
+ \IfValueTF {#1} {
+ \__luaul_parse_generic_keys:n {
+ #1
+ }
+ }{}
+ \bool_if:NTF \l__luaul_color_set_bool {
+ % the \l__luaul_current_color_tl contains color in a format suitable for \convertcolorspec,
+ % so we cannot use \lua:ul:get:xcolorcss here
+ \expandafter\convertcolorspec\l__luaul_current_color_tl{HTML}\:tempa
+ \edef\:underLineColor{\#\:tempa}%
+ }{\def\:underLineColor{inherit}}
+ \a:underLine#2\b:underLine
+ \group_end:
+}
+
+\HLet\underLine\:underLine
+
+
+>>>
+
+Lua-ul can emulate commands defined by Soul, in that case we need to use our
+redefinitions of Lua-ul commands.
+
+\<lua-ul hooks\><<<
+\bool_if:NT \l__luaul_soulnames_bool {
+ \cs_set_eq:NN \textul \underLine \cs_set_eq:NN \ul \textul
+ \cs_set_eq:NN \textst \strikeThrough \cs_set_eq:NN \st \textst
+ \cs_set_eq:NN \texthl \highLight \cs_set_eq:NN \hl \texthl
+}
+>>>
+
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Underline and Overline}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex 2024-10-02 20:46:24 UTC (rev 1572)
+++ trunk/lit/tex4ht-html4.tex 2024-10-03 14:04:04 UTC (rev 1573)
@@ -16547,6 +16547,18 @@
>>>
%%%%%%%%%%%%%%%%
+\section{lua-ul}
+%%%%%%%%%%%%%%%%
+
+\<configure html4 lua-ul\><<<
+\Configure{highLight}{\HCode{<span class="highLight" style="background-color:\:highLightColor;">}}{\HCode{</span>}}
+\Configure{strikeThrough}{\HCode{<span class="strikeThrough" style="text-decoration-color:\:strikeThroughColor;" >}}{\HCode{</span>}}
+\Css{.strikeThrough{text-decoration: line-through;}}
+\Configure{underLine}{\HCode{<span class="underLine" style="text-decoration-color:\:underLineColor;">}}{\HCode{</span>}}
+\Css{.underLine{text-decoration: underline;}}
+>>>
+
+%%%%%%%%%%%%%%%%
\section{framed}
\<configure html4 framed\><<<
More information about the tex4ht-commits
mailing list.