Hi Chris, Thanks for the quick reply. I know that simply changing the CSS does not work and that I need to invoke either the reST thing (or the pygments directly). My question is how do I invoke the reST thing from with in the plugin code.
Thanks again for your help, Adriaan On Wednesday, March 25, 2020 at 10:56:34 AM UTC+1, Chris Warrick wrote: > > On Wed, 25 Mar 2020 at 10:47, Adriaan Rol <adria...@gmail.com > <javascript:>> wrote: > > > > I am using the plugin publication_list to generate a publication list > for my personal website. One of the features is that it shows a foldable > block of bibtex code. However, for this it does not use syntax > highlighting. > > > > I can use manual syntax highlighting in a regular (.rst) post using the > `.. code:: bibtex` snippet. (see first screenshot). The Nikola .rst > compilation takes care of proper code-highlighting. However, when I use the > plugin, the html is created using the `publication_list.py`. I can easily > change this html to for example change the class to use the "code bibtex" > class. This ensures I use the right .css but it does not use the proper > highlighting (as this requires pygments and other details that Nikola > normally takes care of. > > > > Is there a way to invoke the Nikola code highlighting from the python in > the plugin so that I can use syntax highlighting in the code generated > html? > > Syntax highlighting is done by Nikola in Python, not in JS, so adding > CSS classes will have no effect. You would need to modify the plugin > so that it calls either the reST thing to generate code blocks, or use > pygments + NikolaPygmentsHTML directly, and put the pygments output in > the plugin’s output files. > > -- > Chris Warrick <https://chriswarrick.com/> > PGP: 5EAAEA16 > -- You received this message because you are subscribed to the Google Groups "nikola-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/a9256b7d-1b69-4150-ab97-4a05d0d74c99%40googlegroups.com.