Sphinx 1.0b2 autodoc: parameter types not showing up in info field lists

190 views
Skip to first unread message

John Fisher

unread,
Jun 23, 2010, 7:38:33 AM6/23/10
to sphinx-dev
I've just started using Sphinx to document my first real Python
project and am loving it so far.

I'm having a problem with autodoc though: I haven't managed to get
parameter types to show up in the parameter list of function/methods
in HTML builds. I haven't found anything either in Sphinx'
documentation nor the internet regarding this problem.

From what I've read, with this:

class data_source_local(data_source):
"""
Extends :class:`data_source` to use a local CSV file.
"""
def __init__(self, csv_path):
"""
Uses local CSV file.

:param csv_path: Path to CSV file
:type csv_path: string
"""

I should be getting this:

class customreports.data_source_local(csv_path)¶

Extends data_source to use a local CSV file.

Uses local CSV file.
Parameters:
* csv_path – (string) Path to CSV file

But what I get in the parameter list is this (note the missing string
type):

* csv_path – Path to CSV file

Have I overlooked a configuration option? http://sphinx.pocoo.org/markup/desc.html#info-field-lists
doesn't mention any, and this is the only page I found that refers to
the issue.

I just tried a manual attempt, and even copying the example
'format_exception' function from the previous link results in a
typeless parameter list.

Doug

unread,
Jul 20, 2010, 11:45:46 AM7/20/10
to sphinx-dev


On Jun 23, 7:38 am, John Fisher <juanrobertopesca...@gmail.com> wrote:
> I've just started using Sphinx to document my first real Python
> project and am loving it so far.
>
> I'm having a problem withautodocthough: I haven't managed to getparametertypes to show up in theparameterlist of function/methods
> in HTML builds. I haven't found anything either in Sphinx'
> documentation nor the internet regarding this problem.
>
> From what I've read, with this:
>
> class data_source_local(data_source):
>     """
>     Extends :class:`data_source` to use a local CSV file.
>     """
>     def __init__(self, csv_path):
>         """
>         Uses local CSV file.
>
>         :param csv_path: Path to CSV file
>         :typecsv_path: string
>         """
>
> I should be getting this:
>
> class customreports.data_source_local(csv_path)¶
>
>     Extends data_source to use a local CSV file.
>
>     Uses local CSV file.
>     Parameters:
>         * csv_path – (string) Path to CSV file
>
> But what I get in theparameterlist is this (note the missing stringtype):
>
>         * csv_path – Path to CSV file
>
> Have I overlooked a configuration option?http://sphinx.pocoo.org/markup/desc.html#info-field-lists
> doesn't mention any, and this is the only page I found that refers to
> the issue.
>
> I just tried a manual attempt, and even copying the example
> 'format_exception' function from the previous link results in a
> typelessparameterlist.

I am also having this problem. Were you able to resolve it?

Doug

Doug

unread,
Jul 20, 2010, 3:08:59 PM7/20/10
to sphinx-dev
In my case at least I think the problem is in util/docfields.py where
the description of the type is "filtered" on line 225. The node type
I'm getting is "Text", which isn't derived from the Inline class used
in the filter.

I'll work on a patch.

Doug

Georg Brandl

unread,
Jul 21, 2010, 6:40:59 AM7/21/10
to sphin...@googlegroups.com
Am 20.07.2010 20:08, schrieb Doug:
>> I am also having this problem. Were you able to resolve it?
>
> In my case at least I think the problem is in util/docfields.py where
> the description of the type is "filtered" on line 225. The node type
> I'm getting is "Text", which isn't derived from the Inline class used
> in the filter.
>
> I'll work on a patch.

I've now pulled from your repo, thanks!

Georg

Reply all
Reply to author
Forward
0 new messages