def coq_code_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
#pylint: disable=dangerous-default-value
"""And inline role for Coq source code"""
options['language'] = 'Coq'
return code_role(role, rawtext, text, lineno, inliner, options, content)
## Too heavy:
## Forked from code_role to use our custom tokenizer; this doesn't work for
## snippets though: for example CoqDoc swallows the parentheses around this:
## “(a: A) (b: B)”
# set_classes(options)
# classes = ['code', 'coq']
# code = utils.unescape(text, 1)
# node = nodes.literal(rawtext, '', *highlight_using_coqdoc(code), classes=classes)
# return [node], []
# TODO pass different languages?
评论列表
文章目录