I have a Pyramid application with Cornice package where I defined Resources
(rather than Services
) and I wonder if it is possible to generate Sphinx documentation for this project with a help of Cornice's Sphinx integration?
I managed to generate some sort of documentation but it seems like majority of features are not available for Resources, only for Services, for example, documenting Pyramid code in this way:
@resource(collection_path='/parse/', path='/parse/{id}', cors_origins=('*',), description="Temporary description.")
class Parser(object):
@view(renderer='json')
def collection_post(self):
"""
Some description for this function...
:param str smth: Some parameter
:return: Returns something
"""
return
and building Sphinx documentation like this:
.. cornice-autodoc::
:modules: my_app.views.views_parser
:ignore: parser
will result in few unnecessary and few missing parts in documentation:
collection_post
itself is not documented,collection_path
and path
from resource
declaration):(example snippet from generated documentation)
Temporary description.
Response: json
Temporary description.
What I would like to know is:
Parser
instead of Collection_Parser
),:ignore:
statement (e.g. I don't want to document /parse/{id}
part),collection_post
in my case)...and many other things...
It seems like this is either impossible or not documented at all. If the case is that this is impossible is there any other (at least semi-automated) solution for documenting my project?
Seems like this is not possible because Cornice does not support this kind of functionality (https://github.com/mozilla-services/cornice/issues/279)...