Проблемы с Sphinx документированием методов класса
Я пытаюсь использовать Sphinx для документирования создаваемого пакета Python, и все работало нормально, пока я не добавил несколько классов. Я просто предоставлю полный набор предупреждений, чтобы не пропустить что-то важное:
Running Sphinx v1.2.3
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] opt.core
/Users/marshallfarrier/Workspace/pynance/doc/source/opt.core.rst:44: WARNING: toctree references unknown document 'pynance.opt.core.Options.exps'
/Users/marshallfarrier/Workspace/pynance/doc/source/opt.core.rst:44: WARNING: toctree references unknown document 'pynance.opt.core.Options.info'
/Users/marshallfarrier/Workspace/pynance/doc/source/opt.core.rst:44: WARNING: toctree references unknown document 'pynance.opt.core.Options.quotetime'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] opt.core
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.exps'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.info'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.quotetime'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.exps'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.get'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.metrics'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.strikes'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.core.Spread.cal'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.multi.Multi.dblcal'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.multi.Multi.diagbtrfly'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.vert.Vertical.straddle'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.exps'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.info'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.quotetime'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.exps'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.get'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.metrics'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.price.Price.strikes'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.core.Spread.cal'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.multi.Multi.dblcal'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.multi.Multi.diagbtrfly'
None:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.spread.vert.Vertical.straddle'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.exps'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.info'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'pynance.opt.core.Options.quotetime'
writing additional files... (18 module code pages) _modules/index genindex py-modindex search
copying static files... done
copying extra files... done
dumping search index... done
dumping object inventory... done
build succeeded, 28 warnings.
Build finished. The HTML pages are in build/html.
Дело в том, что все эти методы класса (такие как pynance.opt.core.Options.exps
) отображаются в выходной документации, и в разделе "Методы" для страницы класса они являются кликабельными ссылками. Единственная проблема с выводом состоит в том, что ссылка "Следующая тема" исчезает там, где она не должна.
Вот так мой .rst
файлы организованы на примере pynance.opt.core.Options.exps
, Первый, index.rst
имеет:
.. toctree::
opt
...
Тогда я в том же каталоге opt.rst
со следующим содержанием:
.. automodule:: pynance.opt
.. toctree::
opt.core
...
Тогда у меня в файле opt.core.rst
:
.. automodule:: pynance.opt.core
.. autoclass:: Options
:members:
Что я здесь не так делаю? Я хочу, чтобы все мои методы класса отображались корректно, а ссылки "Следующая тема" связывали весь мой пакет.