2017-05-03 21 views
1

如何在獅身人面像禁用語法高亮?在獅身人面像中禁用語法高亮(雪花石膏主題)

我試過設置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

回答

1

viewcode適用語法高亮只Python源文件。要僅在這些文件中禁用突出顯示,您可以通過在lexer邏輯中添加, 'none'修改此行來編輯文件的來源。

if env.config.highlight_language in ('python3', 'default', 'none'): 

看起來您已經提交了PR for it

對於由獅身人面像的敘述文檔中呈現的所有其他文件,您可以禁用conf.py全球關注:

highlight_language ='none' 

那麼這將是你的修飾viewcode繼承。