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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Mon Sep 28 22:10:14 CEST 2020


Author: michal_h21
Date: 2020-09-28 23:10:14 +0300 (Mon, 28 Sep 2020)
New Revision: 801

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
Added support for colored minted listings

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2020-09-28 16:41:12 UTC (rev 800)
+++ trunk/lit/ChangeLog	2020-09-28 20:10:14 UTC (rev 801)
@@ -2,6 +2,9 @@
 
 	* tex4ht-html4.tex (html4.4ht): use <pre> element for fancy verbatim.
 	https://tex.stackexchange.com/q/564532/2891
+	* tex4ht-4ht.tex (minted.4ht),
+	tex4ht-html4.tex (html4.4ht): added support for colored Minted listings.
+	https://tex.stackexchange.com/a/564579/2891
 
 2020-09-22  Michal Hoftich  <michal.h21 at gmail.com>
 

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2020-09-28 16:41:12 UTC (rev 800)
+++ trunk/lit/tex4ht-4ht.tex	2020-09-28 20:10:14 UTC (rev 801)
@@ -23867,7 +23867,7 @@
 
 \<minted.4ht\><<<
 % minted.4ht (|version), generated from |jobname.tex
-% Copyright 2019 TeX Users Group
+% Copyright 2020 TeX Users Group
 |<TeX4ht license text|>
 \NewConfigure{InlineCode}{2}
 
@@ -23883,6 +23883,17 @@
 
 \HLet\minted at inline@iii\:tempa
 
+% support for background color in Minted listings
+\NewConfigure{MintedColorbg}{2}
+\renewenvironment{minted at colorbg}[1]{%
+  \colorlet{shadecolor}{#1}%
+  \extractcolorspec{shadecolor}{\:tempa}%
+  \expandafter\convertcolorspec\:tempa{HTML}\minted:bgcolor%
+  \a:MintedColorbg%
+  }
+  {\b:MintedColorbg\medskip\noindent}
+
+
 \Hinput{minted}
 \endinput
 >>> \AddFile{9}{minted}

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2020-09-28 16:41:12 UTC (rev 800)
+++ trunk/lit/tex4ht-html4.tex	2020-09-28 20:10:14 UTC (rev 801)
@@ -15098,7 +15098,15 @@
 \Configure{InlineCode}{\HCode{<code>}}{\HCode{</code>}}
 >>>
 
+Configuration for listings with colored backgrounds
+\<configure html4 minted\><<<
+\Configure{MintedColorbg}
+   {\ifvmode\IgnorePar\fi\EndP\HCode{<div class="minted-color-box" style="background-color:\#\minted:bgcolor">}}
+   {\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+>>>
 
+
+
 %%%%%%%%%%%%%%%%%%%%
 \subsection{pythontex}
 %%%%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.