#31 adding pygments options to code directive

Default
closed-duplicate
nobody
None
5
2017-08-21
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

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2012-10-17

    prototype implementation

     
    Last edit: Anonymous 2016-12-24
  • 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
    
     
  • Dmitry Shachnev

    Dmitry Shachnev - 2013-10-04

    I have now attached an updated patch version in patches/112.

     
  • Ben Ramsey

    Ben Ramsey - 2017-08-18

    Is this something the project is still considering? I'd love to have the ability to pass additional Pygments options. How can I help make this happen?

     
    • Günter Milde

      Günter Milde - 2017-08-21

      Is this something the project is still considering?
      It is not ruled out but also not a high priority todo item.

      I'd love to have the ability to pass additional Pygments options. How can I help make this happen?
      A generic starter for contributors is in the Docutils documentation under
      http://docutils.sourceforge.net/docs/dev/policies.html#how-to-get-a-new-feature-into-docutils.

      For ideas in this particular case, have a look at the suggestions and preconditions in the discussion of patch/112.

      For help on getting started and discussion of details, the docutils-devel mail list may be a good place.

       
  • Günter Milde

    Günter Milde - 2017-08-21
    • status: open --> closed-duplicate
    • Group: --> Default
     
  • Günter Milde

    Günter Milde - 2017-08-21

    Closing as duplicate: Discussion moved to
    patches/112.

     

Log in to post a comment.