I think I have found a bug in Sphinx, but wanted to run it past you
guys. I am working on a custom domain. I have an ObjectDesc subclass
called "class", used like this:

.. class:: <file-stream>

   :superclass: <object>
   :keyword: filename

   This class is for files.

The subclass declares doc_field_types like so:

    doc_field_types = [
        GroupedField('superclass', label="Superclasses",
            names=('superclass', 'super')),
        GroupedField('keyword', label="Init-Keywords",
            names=('keyword', 'init-keyword'))
    ]

Sphinx did not seem to be recognizing these doc fields, so I added a
print to sphinx/util/docfields.py line 222:

            # sort out unknown fields
            if typedesc is None or typedesc.has_arg != bool(fieldarg):
                # either the field name is unknown, or the argument
doesn't
                # match the spec; capitalize field name and be done
with it
                print "Unknown fieldname '{}' from
{}".format(fieldname, typemap.keys()) ##**
                new_fieldname = fieldtype.capitalize() + ' ' +
fieldarg
                fieldname[0] = nodes.Text(new_fieldname)
                entries.append(field)
                continue

Sure enough, it hits that case. Here is the output:

Unknown fieldname '<field_name>superclass</field_name>' from ['init-
keyword', 'super', 'superclass', 'keyword']
Unknown fieldname '<field_name>keyword</field_name>' from ['init-
keyword', 'super', 'superclass', 'keyword']

The field names it is looking for are wrapped by that tag! Anyone know
what's up with that? Bug, right?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to