gpt4 book ai didi

asciidoc - AsciiDoc 中的 Shell 命令

转载 作者:行者123 更新时间:2023-12-05 05:11:49 26 4
gpt4 key购买 nike


我经常在我的 asciidoc 中使用代码块。我遇到的最大问题是以“#”开头的 shell 命令(因为它们使用 root 的 shell)在 asciidoc 中呈现为注释。例如:

[source,shell]
----
# firewall-cmd --permanent --new-zone dockerc
----

这让阅读有点困惑。有没有办法使用一段 shell 代码来覆盖“行为”?谢谢

最佳答案

也许你需要设置一个source-highlighter对我来说,以下示例适用于 HTML:

= Foo
:source-highlighter: coderay

[source,shell]
----
# firewall-cmd --permanent --new-zone dockerc
--------

或者您可以张贴您的输出结果的屏幕截图吗?

关于asciidoc - AsciiDoc 中的 Shell 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55097233/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com