Hi, What parts do you want to access? Please tell me your idea in detail.
Thanks, Takeshi KOMIYA 2016年9月8日木曜日 6時38分47秒 UTC+9 Thomas Schultz: > > Thanks for the reply! > > Sure, me see if I can make more sense of this. > > We have a javascript app that is generating a styled site from JSON that's > formatted per my example above. > We also have a normal sphinx site. I'm hoping that I can get sphinx to > generate both the normal sphinx site and this customized JSON as output. > > We have sphinx documentation already, rst's a toc..etc. > I'm not sure how napoleon works for this other than generating the autodoc > rst files? Maybe I missed something though? > > Attempting the parse the XML output could be an option but it would be > really nice to access the the class/methods/params directly. > Maybe a Writer is the way to accomplish this? > This was referenced in the sphinx writer.py, but I'm not sure how to > access the parts I would need to populate the above JSON? > > http://www.arnebrodowski.de/blog/write-your-own-restructuredtext-writer.html > > > On Wednesday, September 7, 2016 at 10:57:31 AM UTC-4, Peter Burdine wrote: >> >> Can you describe your starting point and goals a bit more? It looks like >> you may be trying to autodoc source code in json format? >> >> If that is the case, then you might want to look at the source for the >> napolean extension (well, it is built into sphinx now). >> https://pypi.python.org/pypi/sphinxcontrib-napoleon >> That seems to get all of the data you want. >> >> Or instead of building a new builder, you could use the napolean >> extension to build your documents and output it in xml or pseudoxml, then >> post process the output in the above format (xml -> json isn't too >> difficult). >> >> >> On Wednesday, September 7, 2016 at 7:18:02 AM UTC-7, Thomas Schultz wrote: >>> >>> Hello! >>> >>> I'm working on a project that has sphinx generated documentation and we >>> are trying to also make a JSON output of these docs with a very specific >>> format. >>> >>> >>> Example of desired JSON output: >>> { >>> "description": "\n Define API Queries.", >>> "examples": [], >>> "id": "google.cloud.bigquery.query.queryresults", >>> "methods": [{ >>> "examples": [], >>> "exceptions": [], >>> "id": "google.cloud.bigquery.query.QueryResults.__init__", >>> "name": "__init__", >>> "params": [], >>> "returns": [], >>> "source": "google/cloud/bigquery/query.py#L60", >>> "type": "instance" >>> }, { >>> "examples": [], >>> "exceptions": [], >>> "id": "google.cloud.bigquery.query.QueryResults.fetch_data", >>> "name": "fetch_data", >>> "params": [{ >>> "description": " token representing a cursor into the >>> table's rows.", >>> "name": "page_token", >>> "nullable": null, >>> "optional": null, >>> "types": ["string or NoneType"] >>> }] >>> }] >>> } >>> >>> >>> I attempted to make a custom builder for this a while ago but I wasn't >>> able to access the above pieces of data in a predictable way. >>> >>> If you have any resources you could point me towards or suggestions, I >>> would be very grateful! >>> >>> >>> Thank you! >>> >> -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
