Open ryanmartinneutrino opened 6 years ago
I found this library: https://github.com/scrivo/highlight.php
Highlight.PHP works like https://highlightjs.org/ but instead of rendering using JavaScript in the web browser for online version of books, Pressbooks could render code as plain HTML then apply CSS. This should make code syntax highlighting work in Epubs and PDFs.
Looks like Prince already supports Lea Verou's Prism.js library: https://prismjs.com/. See https://www.princexml.com/forum/topic/2510/prism.js-highlighter-support + https://www.princexml.com/forum/topic/2242/js-generated-syntax-highlighting-doesnt-show-up-in-pdf. Add'l reference doc for working wtih JS in Prince: https://www.princexml.com/doc/javascript/ + https://www.princexml.com/doc/prince-input/#applying-javascript-in-prince
Feature Scope
Feature Description
Wordpress has numerous plugins that allow code contained within a pre tag to be syntax highlighted. These work well in pressbooks for online version of books, however, they do not work in the exports. It would be great to implement/modify a plugin that would allow syntax highlighting to show up in exported books.
Feature Use Case
Any book that includes coding examples would benefit from this.
Other Notes