我在sphinx中建立文件时遇到问题。我有一个asyncio-nats-client库,但无法理解它如何依赖于构建狮身人面像markdown文档。
我已经为我的asyncio python项目安装了sphinx和recommonmark库。当我输入make markdown
时,出现错误消息:
WARNING: autodoc: failed to import class 'api_access_rules.API' from module 'lib'; the following exception was raised:
No module named 'nats'
我在Pycharm工作,我的项目结构是:
- project_name
- docs
- lib
在lib中,我有要制作markdown文档的类。 在docs sphinx文件
中这是我的conf.py:
import os
import sys
sys.path.insert(0,os.path.join(os.path.dirname(__file__),'../../'))
extensions = [
'recommonmark','sphinx.ext.autodoc','sphinx.ext.todo','sphinx.ext.coverage','sphinx.ext.extlinks',]
source_suffix = {
'.rst': 'restructuredtext','.txt': 'markdown','.md': 'markdown',}
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'bizstyle'
html_static_path = ['_static']
还有我的index.rst:
Welcome to managing-nats-api's documentation!
=============================================
.. toctree::
:maxdepth: 2
:caption: Contents:
.. autoclass:: lib.api_access_rules.API
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
请帮忙,我将近一周时间尝试解决此问题。尝试make clean
无结果。