简体   繁体   中英

Syntax highlighting only with HTML and CSS

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.

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 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM