$ brew install cowsay lolcat ansifilter
$ cowsay Hello, world | lolcat -f | ansifilter --html -o output.html
Generates this rendered output from Safari:
Generating with --fragment
removes the head
and body
and style
tags, leaving just a bunch of <span style="color:...">
tags.
For example:
<span style="color:#03d2a9;"> </span><span style="color:#04d6a5;">_</span><span style="color:#05d9a1;">_</span><span style="color:#06dc9d;">_</span><span style="color:#07de99;">_</span><span style="color:#08e195;">_</span><span style="color:#0ae491;">_</span><span style="color:#0ce68d;">_</span><span style="color:#0de988;">_</span><span style="color:#0feb84;">_</span><span style="color:#11ed80;">_</span><span style="color:#14ef7c;">_</span><span style="color:#16f177;">_</span><span style="color:#18f373;">_</span><span style="color:#1bf56f;">_</span><span style="color:#1df66b;"> </span><span style="color:#20f867;"></span>
It appears that Hugo does not like the inline / embedded --fragment
code, and it does not render properly.
Rendering without --fragment
causes there to be extra <html>
and <head>
tags which is clearly not desirable -- but also doesn't work.
It looks like my raw HTML fragment is replaced with:
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<blockquote>
</blockquote>