【问题标题】:Can I display asciidoc document in github?我可以在 github 中显示 asciidoc 文档吗?
【发布时间】:2019-01-15 07:42:03
【问题描述】:

我能否像当前查看 Markdown 文件一样在 github 上显示 asciidoc 文件?根据这个博客entry,我应该可以做到这一点:

如果您对使用 AsciiDoc 感兴趣,请前往 GitHub 并使用文件扩展名 .asciidoc 或 .adoc 在您的存储库或 gist 中创建一个新文件。

但是我尝试这样做,但没有成功。谁能告诉我如何获取 asciidoc 文档以在 Github 上显示格式良好的文本?

这是我尝试用 Asciidoc 测试的文档。 https://github.com/00krishna/proj_blog/blob/master/test.adoc

【问题讨论】:

  • 您是否有无法正确显示的文档的 URL?
  • 嘿@KeithThompson,我刚刚添加了一个测试文件的链接。

标签: github asciidoc


【解决方案1】:

您的文件在语法上无效(或者该行被视为纯文本)。

您的原始文件:

==This is a test
this is a test of using asciidoc

== 后面没有空格;我认为这是必需的。

正确显示的修改版本:

== This is a test
this is a test of using asciidoc

参见this Gist 中的test.adoctest2.adoc

此功能的语法“单行标题”记录在 Asciidoc user guidesection 11.2 中。

【讨论】:

  • 哈哈,就这么简单啊。这太棒了。感谢您的提示。我也让它在 github 上工作。
  • 只是为了澄清。扩展名为 .adoc 的文件不会出现在 Github Wiki 中,只有 .asciidoc 在那里工作。但是当你的仓库中有.adoc 文件并从code browser 打开它时,它会被渲染得很好。
【解决方案2】:

作为已接受答案的补充,Github(或至少 Github 的 Wiki 部分)仅接受 .asciidoc 后缀。 .adoc.ad 似乎不起作用。我之所以遇到这个问题,是因为我尝试手动将 wiki 中的页面从 .md 更改为 .ad 并且它们不会呈现,所以如果您的问题仍然存在,请检查此问题。

【讨论】:

  • 也许.ad 不起作用,但.adoc 起作用,至少对于my answer 中的示例。
猜你喜欢
  • 2014-08-02
  • 1970-01-01
  • 1970-01-01
  • 2021-10-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-18
  • 1970-01-01
相关资源
最近更新 更多