Sphinx inline code highlight

前端 未结 6 1615
暖寄归人
暖寄归人 2021-02-07 11:03

I use Sphinx to make a website that contains code samples. I\'m successful using the .. code-block directive to get syntax highlighting. But I can\'t get inline syn

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 11:44

    syntax_highlight is an ordinary docutils setting, which can be set in docutils.conf. This file is respected by Sphinx too, if placed in the Sphinx's configuration directory (where conf.py resides):

    [restructuredtext parser]
    syntax_highlight = short
    

    This is much better than patching docutils or sphinx code or creating a long name CSS file.

提交回复
热议问题