chiark / gitweb /
documentation/python: um, why don't I use a function here?
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jul 2019 17:30:10 +0000 (19:30 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jul 2019 17:30:10 +0000 (19:30 +0200)
documentation/python.py

index e9e4a78aeadc6f42f43f4826e3b733a1336a8843..6d7987c19c596f8e86a0d48f6fc3016d3daf5a3e 100755 (executable)
@@ -1290,7 +1290,7 @@ def extract_data_doc(state: State, parent, entry: Empty):
     out.name = entry.path[-1]
     out.id = state.config['ID_FORMATTER'](EntryType.DATA, entry.path[-1:])
     # Welp. https://stackoverflow.com/questions/8820276/docstring-for-variable
-    out.summary = ''
+    out.summary = extract_summary(state, state.data_docs, entry.path, '')
     out.has_details = False
 
     # First try to get fully dereferenced type hints (with strings converted to
@@ -1307,13 +1307,6 @@ def extract_data_doc(state: State, parent, entry: Empty):
 
     out.value = format_value(state, entry.path, entry.object)
 
-    # External data summary, if provided
-    path_str = '.'.join(entry.path)
-    if path_str in state.data_docs:
-        # TODO: use also the contents
-        out.summary = render_inline_rst(state, state.data_docs[path_str]['summary'])
-        del state.data_docs[path_str]
-
     if not state.config['SEARCH_DISABLED']:
         result = Empty()
         result.flags = ResultFlag.from_type(ResultFlag.NONE, EntryType.DATA)