我在读关于Ascidoc的书。我用python做了一个例子,但每次我试图用html显示一个代码博客,我都会得到一个异常'source-highlight' is not recognized as an internal or external command, operable program or batch file.
Python代码
from asciidocapi import AsciiDocAPI
asciidoc = AsciiDocAPI()
asciidoc.execute('mydoc.txt')
mydoc.txt文件:
== Example
.Optional Title
[source,python]
----
# *Source* block
# Use: highlight code listings
# (require `source-highlight` or `pygmentize`)
python('Hello world')
----
asciidoc.config
文件中的source-highlight
未被识别为命令
将
source-highlighter=source-highlight
中的source-highlighter=pygments
更改为asciidoc.config
您必须安装
pygments
(pip install Pygments
)我在Ubuntu上进行了测试,更改上述设置之前的错误消息是
/bin/sh: 1: source-highlight: not found
相关问题 更多 >
编程相关推荐