diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-12-19 17:48:40 -0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-12-21 20:36:00 -0800 |
commit | f968dad3bff5dd4e0d8d797b561fcb2c76553a1c (patch) | |
tree | d58712199d71accc6da1f6159b4f65f4be75277e /scripts/gen_vimdoc.py | |
parent | 62e365f5776cfe8e460fdd29a1d7fa89a5c9c0bc (diff) | |
download | rneovim-f968dad3bff5dd4e0d8d797b561fcb2c76553a1c.tar.gz rneovim-f968dad3bff5dd4e0d8d797b561fcb2c76553a1c.tar.bz2 rneovim-f968dad3bff5dd4e0d8d797b561fcb2c76553a1c.zip |
gen_vimdoc.py: fix "seealso", "xrefs"
- Also fix xrefs ("Deprecated" section)
- Fix "Deprecated" rendering by a weird hack (see comment).
- Eliminate unnecessary use of render_para()
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-x | scripts/gen_vimdoc.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 2ca121c299..676e6b5be9 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -435,9 +435,11 @@ def para_as_map(parent, indent='', width=62): chunks['seealso'].append(render_node( child, '', indent=indent, width=width)) for child in groups['xrefs']: - title = get_text(get_child(child, 'xreftitle')) + # XXX: Add a space (or any char) to `title` here, otherwise xrefs + # ("Deprecated" section) acts very weird... + title = get_text(get_child(child, 'xreftitle')) + ' ' xrefs.add(title) - xrefdesc = render_para(get_child(child, 'xrefdescription'), width=width) + xrefdesc = get_text(get_child(child, 'xrefdescription')) chunks['xrefs'].append(doc_wrap(xrefdesc, prefix='{}: '.format(title), width=width) + '\n') @@ -496,7 +498,7 @@ def extract_from_xml(filename, mode, fmt_vimhelp): fmt_doxygen_xml_as_vimhelp(). (TODO: ugly :) """ global xrefs - xrefs = set() + xrefs.clear() functions = {} # Map of func_name:docstring. deprecated_functions = {} # Map of func_name:docstring. @@ -623,8 +625,8 @@ def extract_from_xml(filename, mode, fmt_vimhelp): fn['parameters_doc'].update(m['params']) if 'return' in m and len(m['return']) > 0: fn['return'] += m['return'] - if 'seealso' in m and len(m['xrefs']) > 0: - fn['seealso'].append(str(m['xrefs'])) + if 'seealso' in m and len(m['seealso']) > 0: + fn['seealso'] += m['seealso'] if INCLUDE_C_DECL: fn['c_decl'] = c_decl |