1
votes

I need a syntax highlighter which inputs a code sample and wrap its language tokens in some html element with some color CSS class. This way with only CSS and HTML syntax highlighting will work without the need of JS. I want the code to appear in an EPUB file and cause my reader (Kindle PaperWhite) does not support JS, i have to highlight my code only with HTML and CSS. My preferable programming environment is JS and Python but if there is such a syntax highligher in another language I will be glad to hear about it.

1
Well there is pygments.org . Any reason not to use that one?madflow
I guess most highlighters do have an option to just generate html, see e.g. prismjs.com "Usage with Node"georg

1 Answers

0
votes

I used Ace.js on a few projects. The trick is to embed the page using some sort of iframe or the EPUB equivalent. It looks like you can embed an iframe in a kindle (just search iframe)