'source-highlight' 未被识别为内部或外部命令
'source-highlight' is not recognized as an internal or external command
我正在阅读有关 asciidoc 的内容。我在 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
未被识别为命令。
在你的 asciidoc.config
中将 source-highlighter=source-highlight
更改为 source-highlighter=pygments
。
您必须安装 pygments
(pip install Pygments
)。
我已经在 Ubuntu 上进行了测试,更改上述设置之前的错误消息是 /bin/sh: 1: source-highlight: not found
。
我正在阅读有关 asciidoc 的内容。我在 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
未被识别为命令。
在你的 asciidoc.config
中将 source-highlighter=source-highlight
更改为 source-highlighter=pygments
。
您必须安装 pygments
(pip install Pygments
)。
我已经在 Ubuntu 上进行了测试,更改上述设置之前的错误消息是 /bin/sh: 1: source-highlight: not found
。