久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='HjgJD'><tr id='HjgJD'><dt id='HjgJD'><q id='HjgJD'><span id='HjgJD'><b id='HjgJD'><form id='HjgJD'><ins id='HjgJD'></ins><ul id='HjgJD'></ul><sub id='HjgJD'></sub></form><legend id='HjgJD'></legend><bdo id='HjgJD'><pre id='HjgJD'><center id='HjgJD'></center></pre></bdo></b><th id='HjgJD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HjgJD'><tfoot id='HjgJD'></tfoot><dl id='HjgJD'><fieldset id='HjgJD'></fieldset></dl></div>

  • <tfoot id='HjgJD'></tfoot>

    <small id='HjgJD'></small><noframes id='HjgJD'>

    • <bdo id='HjgJD'></bdo><ul id='HjgJD'></ul>

    1. <legend id='HjgJD'><style id='HjgJD'><dir id='HjgJD'><q id='HjgJD'></q></dir></style></legend>

        如何使用 Sphinx 記錄 Python 包

        How to document Python packages using Sphinx(如何使用 Sphinx 記錄 Python 包)

          1. <legend id='Yrlzc'><style id='Yrlzc'><dir id='Yrlzc'><q id='Yrlzc'></q></dir></style></legend>

            <tfoot id='Yrlzc'></tfoot>

            <i id='Yrlzc'><tr id='Yrlzc'><dt id='Yrlzc'><q id='Yrlzc'><span id='Yrlzc'><b id='Yrlzc'><form id='Yrlzc'><ins id='Yrlzc'></ins><ul id='Yrlzc'></ul><sub id='Yrlzc'></sub></form><legend id='Yrlzc'></legend><bdo id='Yrlzc'><pre id='Yrlzc'><center id='Yrlzc'></center></pre></bdo></b><th id='Yrlzc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Yrlzc'><tfoot id='Yrlzc'></tfoot><dl id='Yrlzc'><fieldset id='Yrlzc'></fieldset></dl></div>
                <tbody id='Yrlzc'></tbody>
              • <small id='Yrlzc'></small><noframes id='Yrlzc'>

                  <bdo id='Yrlzc'></bdo><ul id='Yrlzc'></ul>
                • 本文介紹了如何使用 Sphinx 記錄 Python 包的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試用 Python 記錄一個包.目前我有以下目錄結構:

                  I am trying to document a package in Python. At the moment I have the following directory structure:

                  .
                  └── project
                      ├── _build
                      │?? ├── doctrees
                      │?? └── html
                      │??     ├── _sources
                      │??     └── _static
                      ├── conf.py
                      ├── index.rst
                      ├── __init__.py
                      ├── make.bat
                      ├── Makefile
                      ├── mod1
                      │?? ├── foo.py
                      │?? └── __init__.py
                      ├── mod2
                      │?? ├── bar.py
                      │?? └── __init__.py
                      ├── _static
                      └── _templates
                  

                  這棵樹是 sphinx-quickstart 觸發的結果.在 conf.py 我取消注釋 sys.path.insert(0, os.path.abspath('.')) 并且我有 extensions = ['sphinx.ext.autodoc'].

                  This tree is the result of the firing of sphinx-quickstart. In conf.py I uncommented sys.path.insert(0, os.path.abspath('.')) and I have extensions = ['sphinx.ext.autodoc'].

                  我的 index.rst 是:

                  .. FooBar documentation master file, created by
                     sphinx-quickstart on Thu Aug 28 14:22:57 2014.
                     You can adapt this file completely to your liking, but it should at least
                     contain the root `toctree` directive.
                  
                  Welcome to FooBar's documentation!
                  ==================================
                  
                  Contents:
                  
                  .. toctree::
                     :maxdepth: 2
                  
                  Indices and tables
                  ==================
                  
                  * :ref:`genindex`
                  * :ref:`modindex`
                  * :ref:`search`
                  

                  在所有 __init__.py 中,我都有一個文檔字符串,模塊 foo.pybar.py 也是如此.但是,在項目中運行 make html 時,我看不到任何文檔.

                  In all the __init__.py's I have a docstring and same goes to the modules foo.py and bar.py. However, when running make html in the project I don't see any of the docstings.

                  推薦答案

                  這是一個大綱:

                  1. 使用源中的文檔字符串記錄您的包.
                  2. 使用 sphinx-quickstart 創建一個 Sphinx 項目.
                  3. 運行 sphinx-apidoc 生成設置為與 autodoc 一起使用的 .rst 源.更多信息這里.

                  1. Document your package using docstrings in the sources.
                  2. Use sphinx-quickstart to create a Sphinx project.
                  3. Run sphinx-apidoc to generate .rst sources set up for use with autodoc. More information here.

                  將此命令與 -F 標志一起使用還可以創建一個完整的 Sphinx 項目.如果您的 API 變化很大,您可能需要多次重新運行此命令.

                  Using this command with the -F flag also creates a complete Sphinx project. If your API changes a lot, you may need to re-run this command several times.

                  注意事項:

                  • Sphinx 需要帶有 automoduleautoclass 等指令的 .rst 文件來生成 API 文檔.如果沒有這些文件,它不會自動從 Python 源中提取任何內容.這與 Epydoc 或 Doxygen 等工具的工作方式不同.此處對差異進行了詳細說明:docutils 和 Sphinx 之間的關系是什么?.

                  • Sphinx requires .rst files with directives like automodule or autoclass in order to generate API documentation. It does not automatically extract anything from the Python sources without these files. This is different from how tools like Epydoc or Doxygen work. The differences are elaborated a bit more here: What is the relationship between docutils and Sphinx?.

                  運行 sphinx-apidoc 后,可能需要調整 conf.py 中的 sys.path 以便 autodoc 找到您的模塊.

                  After you have run sphinx-apidoc, it may be necessary to adjust sys.path in conf.py for autodoc to find your modules.

                  為了避免出現類似這些問題的奇怪錯誤,我應該如何解決OptionParser和sphinx-build的沖突大型項目?,OptionParser 是否與 sphinx 沖突?,確保代碼結構正確,在需要時使用 if __name__ == "__main__": 守衛.

                  In order to avoid strange errors like in these questions, How should I solve the conflict of OptionParser and sphinx-build in a large project?, Is OptionParser in conflict with sphinx?, make sure that the code is properly structured, using if __name__ == "__main__": guards when needed.

                  這篇關于如何使用 Sphinx 記錄 Python 包的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)
                    <bdo id='ntCOI'></bdo><ul id='ntCOI'></ul>

                    <small id='ntCOI'></small><noframes id='ntCOI'>

                      1. <tfoot id='ntCOI'></tfoot>

                            <legend id='ntCOI'><style id='ntCOI'><dir id='ntCOI'><q id='ntCOI'></q></dir></style></legend>
                              <tbody id='ntCOI'></tbody>
                            <i id='ntCOI'><tr id='ntCOI'><dt id='ntCOI'><q id='ntCOI'><span id='ntCOI'><b id='ntCOI'><form id='ntCOI'><ins id='ntCOI'></ins><ul id='ntCOI'></ul><sub id='ntCOI'></sub></form><legend id='ntCOI'></legend><bdo id='ntCOI'><pre id='ntCOI'><center id='ntCOI'></center></pre></bdo></b><th id='ntCOI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ntCOI'><tfoot id='ntCOI'></tfoot><dl id='ntCOI'><fieldset id='ntCOI'></fieldset></dl></div>
                            主站蜘蛛池模板: 日韩视频 中文字幕 | 精品国产乱码 | 欧美极品一区二区 | 久久伦理中文字幕 | 欧美一级免费 | 国产精品视频999 | 一级一片在线观看 | 青青草免费在线视频 | 91看片在线 | 亚洲一区二区高清 | 欧美日本久久 | 国产精品视频 | 精品一区国产 | 蜜桃视频成人 | 日本综合在线观看 | 二区在线观看 | 亚洲欧美中文日韩在线v日本 | 九九九国产 | 一区二区三区四区在线视频 | 黄色一级毛片 | 韩日精品一区 | 国产免费拔擦拔擦8x高清 | 国产精品爱久久久久久久 | 99久久婷婷| 欧美精品福利 | 日日夜夜精品视频 | 精品国产一级 | 久久一二| 免费视频二区 | 亚洲综合无码一区二区 | 在线色网址 | 国产精品美女久久久久 | 九九久久99 | 在线观看国产www | 午夜视频一区二区三区 | 久久久爽爽爽美女图片 | 国产一区二区三区在线 | 日本不卡一区二区三区在线观看 | 中文字幕一区二区三区日韩精品 | 国产午夜影院 | 国产视频日韩 |