如何在没有服务器的本地计算机上使用Mkdocs?

2024-05-23 23:45:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我安装了Mkdocs(python3.6.5),编辑并构建了降价文件。在

我试着打开总水管索引.html文件,但我不能直接打开链接到其他HTML文件的HTML页面。在

使用命令提示符并键入“mkdocs serve”,我可以打开链接页面。我知道这是没有服务器的Mkdocs的正常功能。在

我可以在本地计算机上使用Mkdocs吗?在


Tags: 文件功能服务器编辑键入链接html页面
2条回答

根据doc,您可以在mkdocs.yml中添加{}并重新生成它。在

The default style of use_directory_urls: true creates more user friendly URLs, and is usually what you'll want to use. The alternate style (edit: use_directory_urls: false) can occasionally be useful if you want your documentation to remain properly linked when opening pages directly from the file system, because it creates links that point directly to the target file rather than the target directory.

根据官方文档,您可以使用mkdocs build生成html文件。它们将存储在名为site的文件夹中。您不必运行mkdocs serve,就可以打开生成的文件。在

相关问题 更多 >