如何将GitHub Wiki转换为GitHub页面?

时间:2016-12-16 11:43:00

标签: github markdown wiki

我希望我现有的GitHub Wiki可以作为GitHub页面使用。

我尝试将所有.md个文件复制到/docssetting that as the source for pages - 但它会破坏所有内部链接。

所以我看到Read the [[documentation]] or [[Help|get help]].而不是链接。

在GitHub页面上托管我的wiki的最简单方法是什么?

3 个答案:

答案 0 :(得分:2)

您需要为每个页面创建手动Markdown链接。

[[documentation]][[Help|get help]]样式链接为wikilinks,通常仅用于维基。它们不是标准Markdown语法的一部分,Jekyll不支持(GitHub Pages使用它们)。请注意,GitHub Wiki支持both styles,因此如果您愿意,可以在导入之前编辑链接。

要么是,您需要编辑链接以手动指向相应的页面:

Read the [documentation](path/to/documentation/) or [Help](path/to/get_help.html]

当然,您需要调整上述路径以指向正确的位置。作为替代方案,您可以使用Jekyll permalinks,它可以为您提供快捷方式来识别特定页面而无需指定完整路径。

答案 1 :(得分:1)

刚收到GitHub的直接电话。

  

恐怕没有简单的答案。您需要脚本或手动将wiki格式URL更改为正确的降价格式。

     

我们只是添加了相对链接到GitHub页面:

     

https://github.com/blog/2290-relative-links-for-github-pages

     

至少应该让事情变得简单,因为您不需要完全限定所有网址。

     

所以你可以改变:

     

Read the [[documentation]] or [[Help|get help]].

     

     

Read the [documentation](documentation.md) or [Help](get%20help.md).

     

或者,您可以使用pandoc和下面的脚本为您进行转换:

     

https://github.com/philipashlock/mediawiki-to-markdown

     

但我自己没有测试过,所以我不能保证它会起作用。

     

这可能是有用的功能,所以我将与团队分享,希望将来能够轻松转换

答案 2 :(得分:0)

有一些工具可以自动执行。看看github-wikito-converter

从Github Wiki或任何其他基于markdown的Wiki生成HTML和PDF文档。

limedocs-wiki-converter