Edgewall Software

Changes between Version 1 and Version 2 of Ticket #5654, comment 9


Ignore:
Timestamp:
Jun 18, 2015, 10:47:54 AM (9 years ago)
Author:
Ryan J Ollos

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5654, comment 9

    v1 v2  
    77> Because we define a code-block for the processor {{{php}}}, I see no need to explicitly state it again (like {{{ #!php lexer.php.startinline=true }}} or {{{#!php php.startinline=true}}}).
    88
    9 I've looked into this. The Lexer classes don't declare the valid options. They will consume valid options as keyword arguments and ignore invalid options. [wiki:1.1/WikiProcessors#AvailableProcessors MIME Type Processors] support some keyword arguments that are known by `formatter.py`: [browser:/tags/trac-1.1.5/trac/wiki/formatter.py#L349 lineno, marks, id]. The only option I can see for allowing Pygments Lexer options to be specified in a MIME WikiProcessor is to consider all unknown keyword arguments to be lexer options. I think that is probably okay though since the Lexers will just ignore any unknown options. We could also see if Pygments is willing to consider an enhancement in which they specify the valid option names as a class attribute.
     9In Trac, [wiki:1.1/WikiProcessors#AvailableProcessors MIME Type WikiProcessors] support some keyword arguments that are known by `formatter.py`: [browser:/tags/trac-1.1.5/trac/wiki/formatter.py#L349 lineno, marks, id]. However, there doesn't seem to be a way for Trac to know the options supported by the Lexers. The Lexer classes don't declare the valid options. Instances of the Lexer classes will consume valid options as keyword arguments and ignore invalid options.
     10
     11The only way I can see to allow Pygments Lexer options to be specified in a MIME WikiProcessor usage is to consider all unknown keyword arguments to be lexer options. I think that is probably okay though since the Lexers will just ignore any unknown options. We could also see if Pygments is willing to consider an enhancement in which they specify the valid option names as a class attribute.