gpt4 book ai didi

python - 如何在 Sphinx 中制作教程页面?

转载 作者:行者123 更新时间:2023-12-01 02:53:12 25 4
gpt4 key购买 nike

我了解如何使用 numpy 文档字符串来记录各个类和方法等,但我还希望有一个页面向用户展示如何在我们设施的环境中使用我的包(即如何访问 Jupyter 笔记本) ,如何将我的包加载进去,如何设置环境,以及如何在实践中使用它)。有没有办法直接在 Sphinx 中执行此操作?或者我需要使用其他程序构建 HTML 页面吗?

最佳答案

是的!通常,当您想要编写散文文档时,您可以将其直接写入 Sphinx 文档目录中的 reStructuredText 文件中。

因此,例如,您将创建一个 installation.rst,它可能如下所示:

Installation
============

To access the Jupyter notebook, go to `this site <https://example.com>`_

然后,您可以编辑 index.rst 中的目录,如下所示:

.. toctree::
:maxdepth: 2

installation
some_other_preexisting_page
another_preexisting_page

(这一切都假设您的 Sphinx 设置看起来有点类似于 sphinx-quickstart 创建的内容。)

关于python - 如何在 Sphinx 中制作教程页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44510901/

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