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

时间:2017-06-13 01:14:47

标签: python python-sphinx

我得到了如何使用numpy docstrings来记录各个类和方法等等,但是我还希望有一个页面向用户展示如何在我们工厂的环境中使用我的包(即如何访问Jupyter笔记本) ,如何将我的包加载到其中,如何设置环境,以及如何在实践中使用它)。有没有办法直接在Sphinx中做到这一点?或者我需要使用其他程序构建HTML页面吗?

1 个答案:

答案 0 :(得分:2)

是的!通常,当您想要编写散文文档时,您可以将其直接写入Sphinx docs目录中的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创建的有些相似。)

相关问题