Issue #790 resolved

Add input type(s) as optional argument to NameHighlightFilter

J Smith
created an issue

Currently the NameHighlightFilter only converts tokens of type Name. There is no filter to convert tokens of other types. For lexers such as the CommonLispLexer, in which almost everything is lexed as Token.Name,Variable, this is problematic - the only workaround it to write and entire filter, which can be daunting to non-python programmers, or users of Sphinx who just want to get something working quickly with a new lines of code.

I suggest a constructor that could be called like this: {{{

!python

    filter = NameHighlightFilter(
        names=['foo', 'bar', 'baz'],
        tokentype=Name.Function,
        inputtokentypes=[Name, Name.Variable, 
                         Name.Builtin])

}}}

Comments (5)

  1. Log in to comment