I’m looking for a tool that takes code as input and outputs this code as syntax highlighted HTML+CSS.
It can either be a local tool (running natively on GNU/Linux) or a self-hosted web app (Linux server). In either case, it must be FLOSS.
The tool doesn’t have to guess the language; I’m fine with selecting it.
It should escape characters that might conflict with (X)HTML, e.g.
It should use only
span elements to markup the code.
It should not use the
style attribute! Either use the
style element (so I can copy the CSS and paste it into my stylesheet) or offer a separate CSS file.
For that, it should use
class attributes (
data-* is okay, too). At best it uses semantic class values, and some kind of prefix to avoid name conflicts.
Just to give a poor example, here is an HTML input followed by an acceptable output:
<p>Lheben teil brann i annon ar <b id="foo">neledh</b> neledhi gar godrebh.</p>
<span class="sh-html-tag"><p></span>Lheben teil brann i annon ar <span class="sh-html-tag"><b <span class="sh-html-attribute">id="foo"</span>></span>neledh<span class="sh-html-tag"></b></span> neledhi gar godrebh.<span class="sh-html-tag"></p></span>