如何在 Sphinx 中禁用语法突出显示?
我尝试过设置 highlight language to 'none'和setting ..language:: none .
也尝试过setting it to 'text' .
我尝试删除 html 并make clean
。但语法高亮是存在的。 (使用雪花石膏主题)
conf.py
配置有以下扩展:
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'numpydoc',
]
编辑:嗯,看来 viewcode
扩展正在执行此操作 it is quite hard coded
最佳答案
viewcode
仅对 Python 源文件应用语法突出显示。要仅在这些文件中禁用突出显示,您可以通过修改 lexer
逻辑中的这一行添加 , 'none'
来编辑文件源。
if env.config.highlight_language in ('python3', 'default', 'none'):
您似乎已经提交了 PR for it .
对于 Sphinx 在叙述性文档中呈现的所有其他文件,您可以在 conf.py
中全局禁用突出显示:
highlight_language ='none'
然后这将通过您在 viewcode
中的修改继承。
关于python - 在 Sphinx 中禁用语法突出显示(Alabaster 主题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43760158/