Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#31 adding pygments options to code directive

open
nobody
None
5
2013-10-04
2012-10-17
Anonymous
No

some pygments lexers support options (notably the pycon lexer supports a python3 flag that enables python3 support).
the attached patch propose to support passing options to pygments using this syntax:

.. code:: pycon
:pygments-options: python3

>>> print("coucou")
coucou

remark:
the attached patch supports a list of key[=value] as pygments-options content, but values can not be lists, which would be needed to support all pygments lexer options.

Discussion


  • Anonymous
    2012-10-17

    prototype implementation

     
    Last edit: Anonymous 4 days ago
  • Günter Milde
    Günter Milde
    2013-08-21

    How about separating the pygments-options by newlines in the input to
    allow list arguments?

    .. code:: lua
       :pygments-options: disabled_modules = foo, bar
                          ensurenl = True
    
     
  • I have now attached an updated patch version in patches/112.