# HG changeset patch # User Thierry Florac # Date 1523524275 -7200 # Node ID 918d3c9b53ee859beb2f1e374f522977bb30c26c # Parent 9379f4e44a5adcb71fd5b8baf9efdb0d2361c18e# Parent 915602c1fb3a073e5b2707bf91ff63c2faf64b7c Added function to automatically extract documentation from interface field properties diff -r 915602c1fb3a -r 918d3c9b53ee src/source/conf.py --- a/src/source/conf.py Mon Apr 09 17:40:10 2018 +0200 +++ b/src/source/conf.py Thu Apr 12 11:11:15 2018 +0200 @@ -221,3 +221,17 @@ epub_exclude_files = ['search.html'] +try: + from zope.schema.fieldproperty import FieldProperty +except ImportError: + raise +else: + def get_field_doc(self): + field = self._FieldProperty__field + if field.title and field.description: + return '{0}: {1}'.format(field.title, field.description) + elif field.title: + return field.title + else: + return super(self.__class__, self).__doc__ + FieldProperty.__doc__ = property(get_field_doc)