On Wed, 25 Mar 2020 at 10:47, Adriaan Rol <adriaan....@gmail.com> 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/CAMw%2Bj7K2bBKjBYLgczikCEX27zmcKJhR1YXs7fLqsdwH8wTjfQ%40mail.gmail.com.

Reply via email to