Hi everyone,
first of all: thanks for the great tool!
I am having a little issue:
I am including some php listings in a post using the "..listing: file.php php" restructured directive.
I want to keep only one file in the listings folder and create multiple code blocks in the generated HTML, hence I am using the start-after/end-before combo in the following way:
.. listing:: file.php php
:start-after: //LISTING_AFTER1
:end-before: //LISTING_BEFORE1
some restructured text talking about the first block
.. listing:: file.php php
:start-after: //LISTING_AFTER2
:end-before: //LISTING_BEFORE2
some other restructured text about the second block... and so on.
It works great with all the other languages, but I'm having a little problem with php:
In the generated HTML the syntax highlight for each block is turned off.
This happens because the included php code does not contains the "<?php ... ?>" tag.
I took a look at nikola source code, in particular at the file
nikola/plugins/task/listings.py , which, I suppose, is delegated to the generation of the correct Highlight, and I saw that the pigments library is used.
The pygments'
php lexer has a
startinline argument (disabled by default) that prevent highlighting if the code does not start with the "<?php" tag.
Do you know if is possible to pass this argument trough any configuration or as an option of the ".. listing::" directive?
Thanks everyone in advance,
regards.
Giorgio