[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Highlight.js available as a XPath extension functi

Subject: Re: Highlight.js available as a XPath extension function
From: "Norman Tovey-Walsh ndw@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Jul 2020 07:20:32 -0000
Re:  Highlight.js available as a XPath extension functi
Christophe Marchand cmarchand@xxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> writes:
> which is not yet open-sourced - I wanted to use exactly the same
> highlighter...

Yes. I faced exactly the same problem. I had been using PrismJS for
syntax highlighting in the browser, but I needed to be able to produce
PDFs. It was annoying that the PDFs werenbt syntax highlighted.

Ibve tinkered with calling JavaScript from the JVM (I have a
cx:javascript step), but at a glance, it didnbt seem practical to run
Prism in that context (does highlightJS really not use any of the DOM
APIs? Or does GraalsJS now support them?)

I cooked up an XProc pipeline to use Pygments in the PDF toolchain, but
then the PDFs had different syntax highlighting than the browser :-(

For the DocBook xslTNG stylesheets, I just went with Pygments in both
places. And since Ibm (temporarily!) getting by without an XProc
implementation in that context, I coded it up as an extension function.

Ibve also now coded up a proper XInclude implementation as an extension
function and a RELAX NG validator. [Expletive] pipelines are useful and
being without them is damned inconvenient!

> You complain about forking processes, but embedding a GraalJS engine

Right. I had seen your note about GraalJS being kind of heavyweight and
I didnbt want to give the impression that Pygments was going to be
faster!

Ibll try to get your extension working too.

                                        Be seeing you,
                                          norm

--
Norman Tovey-Walsh <ndw@xxxxxxxxxx>
https://nwalsh.com/

> She was mostly immensely relieved to think that virtually everything
> that anybody had ever told her was wrong. (Mrs. E. Kapelsen)--Douglas
> Adams

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.