Hi all!

Does anyone know of a way to use members of sphinx to pull doc string 
information for use within another code?

I'm trying to write a decorator that will parse the reST doc strings for 
information about param descriptions/types and log them into a database for 
use in other parts of the code. I realize that I mainly just need the reST 
parsing functions out of sphinx but from my review of the code they all 
seemed linked to the sphinx environment for creating the docs... I'm having 
a hard time trying to figure out how I can use it outside of its intended 
framework.

Example:
def doc(x):
    """
    Description is here ;-)

    :param x: X is some variable
    :type x: int
    :return: Return some stuff
    :rtype: float
    """
   pass

What I'd like to get out of the method to parse would be a dictionary 
similar to:

{
    "description": "Description is here ;-)",
    "inputs":{"x":{"description":"X is some variable"},"type":int},
    "return":{"description":"Return some stuff"},"type":float}
}

Anyone know of a way to use sphinx's already awesome methods to do 
something like this?

-- 
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.

Reply via email to