Debian Codegraph @

texmf-dist/tex/generic/tex4ht/lua-ul.4ht

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % lua-ul.4ht (2024-10-03-13:41), generated from tex4ht-4ht.tex
3 % Copyright 2024 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <http://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2024-10-03-13:41}
21
22 \def\lua:ul:get:xcolorcss#1#2{%
23 \expandafter\extractcolorspec\expandafter{#1}{\tsf:color}%
24 \expandafter\convertcolorspec\tsf:color{HTML}\tsf:color%
25 \edef#2{\#\tsf:color}%
26 }
27
28 \ExplSyntaxOn
29
30 \NewConfigure{highLight}{2}
31 \NewDocumentCommand \:highLight {O{\l__luaul_highlight_color_tl} +m} {
32 \group_begin:
33 \lua:ul:get:xcolorcss{#1}\:highLightColor%
34 \a:highLight#2\b:highLight%
35 \group_end:
36 }
37
38 \HLet\highLight\:highLight
39
40 \NewConfigure{strikeThrough}{2}
41 \NewDocumentCommand \:strikeThrough {o +m} {
42 \group_begin:
43 \IfValueTF {#1} {
44 \lua:ul:get:xcolorcss{#1}\:strikeThroughColor%
45 }{\def\:strikeThroughColor{inherit}}
46 \a:strikeThrough#2\b:strikeThrough
47 \group_end:
48 }
49
50 \HLet\strikeThrough\:strikeThrough
51
52 \NewConfigure{underLine}{2}
53 \NewDocumentCommand \:underLine {o +m} {
54 \group_begin:
55 \IfValueTF {#1} {
56 \__luaul_parse_generic_keys:n {
57 #1
58 }
59 }{}
60 \bool_if:NTF \l__luaul_color_set_bool {
61 % the \l__luaul_current_color_tl contains color in a format suitable for \convertcolorspec,
62 % so we cannot use \lua:ul:get:xcolorcss here
63 \expandafter\convertcolorspec\l__luaul_current_color_tl{HTML}\:tempa
64 \edef\:underLineColor{\#\:tempa}%
65 }{\def\:underLineColor{inherit}}
66 \a:underLine#2\b:underLine
67 \group_end:
68 }
69
70 \HLet\underLine\:underLine
71
72
73 \bool_if:NT \l__luaul_soulnames_bool {
74 \cs_set_eq:NN \textul \underLine \cs_set_eq:NN \ul \textul
75 \cs_set_eq:NN \textst \strikeThrough \cs_set_eq:NN \st \textst
76 \cs_set_eq:NN \texthl \highLight \cs_set_eq:NN \hl \texthl
77 }
78
79 \ExplSyntaxOff
80 \Hinput{lua-ul}
81 \endinput
82