gen_vimdoc.py: sort by name

This commit is contained in:
Justin M. Keyes 2019-12-28 03:27:25 -08:00
parent b81547ce6d
commit c24f8f46b4
3 changed files with 1188 additions and 1183 deletions

File diff suppressed because it is too large Load Diff

View File

@ -861,6 +861,9 @@ schedule_wrap({cb}) *vim.schedule_wrap()*
deep_equal({a}, {b}) *vim.deep_equal()*
TODO: Documentation
deepcopy({orig}) *vim.deepcopy()*
Returns a deep copy of the given object. Non-table objects are
copied as in a typical Lua assignment, whereas table objects
@ -889,6 +892,45 @@ gsplit({s}, {sep}, {plain}) *vim.gsplit()*
https://www.lua.org/pil/20.2.html
http://lua-users.org/wiki/StringLibraryTutorial
is_callable({f}) *vim.is_callable()*
Returns true if object `f` can be called as a function.
Parameters: ~
{f} Any object
Return: ~
true if `f` is callable, else false
list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()*
Extends a list-like table with the values of another list-like
table.
NOTE: This mutates dst!
Parameters: ~
{dst} list which will be modified and appended to.
{src} list from which values will be inserted.
{start} Start index on src. defaults to 1
{finish} Final index on src. defaults to #src
Return: ~
dst
See also: ~
|vim.tbl_extend()|
pesc({s}) *vim.pesc()*
Escapes magic chars in a Lua pattern string.
Parameters: ~
{s} String to escape
Return: ~
%-escaped pattern string
See also: ~
https://github.com/rxi/lume
split({s}, {sep}, {plain}) *vim.split()*
Splits a string at each instance of a separator.
@ -910,6 +952,62 @@ split({s}, {sep}, {plain}) *vim.split()*
See also: ~
|vim.gsplit()|
tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
Add the reverse lookup values to an existing table. For
example: `tbl_add_reverse_lookup { A = 1 } == { [1] = 'A', A =
1 }`
Parameters: ~
{o} table The table to add the reverse to.
tbl_contains({t}, {value}) *vim.tbl_contains()*
Checks if a list-like (vector) table contains `value` .
Parameters: ~
{t} Table to check
{value} Value to compare
Return: ~
true if `t` contains `value`
tbl_extend({behavior}, {...}) *vim.tbl_extend()*
Merges two or more map-like tables.
Parameters: ~
{behavior} Decides what to do if a key is found in more
than one map:
• "error": raise an error
• "keep": use value from the leftmost map
• "force": use value from the rightmost map
{...} Two or more map-like tables.
See also: ~
|extend()|
tbl_flatten({t}) *vim.tbl_flatten()*
Creates a copy of a list-like table such that any nested
tables are "unrolled" and appended to the result.
Parameters: ~
{t} List-like table
Return: ~
Flattened copy of the given list-like table.
See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_isempty({t}) *vim.tbl_isempty()*
See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua@paramt Table to check
tbl_islist({t}) *vim.tbl_islist()*
Table
Return: ~
true: A non-empty array, false: A non-empty table, nil: An
empty table
tbl_keys({t}) *vim.tbl_keys()*
Return a list of all keys used in a table. However, the order
of the return table of keys is not guaranteed.
@ -933,83 +1031,6 @@ tbl_values({t}) *vim.tbl_values()*
Return: ~
list of values
tbl_contains({t}, {value}) *vim.tbl_contains()*
Checks if a list-like (vector) table contains `value` .
Parameters: ~
{t} Table to check
{value} Value to compare
Return: ~
true if `t` contains `value`
tbl_isempty({t}) *vim.tbl_isempty()*
See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua@paramt Table to check
tbl_extend({behavior}, {...}) *vim.tbl_extend()*
Merges two or more map-like tables.
Parameters: ~
{behavior} Decides what to do if a key is found in more
than one map:
• "error": raise an error
• "keep": use value from the leftmost map
• "force": use value from the rightmost map
{...} Two or more map-like tables.
See also: ~
|extend()|
deep_equal({a}, {b}) *vim.deep_equal()*
TODO: Documentation
tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
Add the reverse lookup values to an existing table. For
example: `tbl_add_reverse_lookup { A = 1 } == { [1] = 'A', A =
1 }`
Parameters: ~
{o} table The table to add the reverse to.
list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()*
Extends a list-like table with the values of another list-like
table.
NOTE: This mutates dst!
Parameters: ~
{dst} list which will be modified and appended to.
{src} list from which values will be inserted.
{start} Start index on src. defaults to 1
{finish} Final index on src. defaults to #src
Return: ~
dst
See also: ~
|vim.tbl_extend()|
tbl_flatten({t}) *vim.tbl_flatten()*
Creates a copy of a list-like table such that any nested
tables are "unrolled" and appended to the result.
Parameters: ~
{t} List-like table
Return: ~
Flattened copy of the given list-like table.
See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_islist({t}) *vim.tbl_islist()*
Table
Return: ~
true: A non-empty array, false: A non-empty table, nil: An
empty table
trim({s}) *vim.trim()*
Trim whitespace (Lua pattern "%s") from both sides of a
string.
@ -1023,18 +1044,6 @@ trim({s}) *vim.trim()*
See also: ~
https://www.lua.org/pil/20.2.html
pesc({s}) *vim.pesc()*
Escapes magic chars in a Lua pattern string.
Parameters: ~
{s} String to escape
Return: ~
%-escaped pattern string
See also: ~
https://github.com/rxi/lume
validate({opt}) *vim.validate()*
Validates a parameter specification (types and values).
@ -1085,13 +1094,4 @@ validate({opt}) *vim.validate()*
• msg: (optional) error string if validation
fails
is_callable({f}) *vim.is_callable()*
Returns true if object `f` can be called as a function.
Parameters: ~
{f} Any object
Return: ~
true if `f` is callable, else false
vim:tw=78:ts=8:ft=help:norl:

View File

@ -145,7 +145,7 @@ def debug_this(cond, o):
except Exception:
pass
if ((callable(cond) and cond())
or (not callable(cond) and cond == True)
or (not callable(cond) and cond)
or (not callable(cond) and cond in o)):
raise RuntimeError('xxx: {}\n{}'.format(name, o))
@ -312,8 +312,8 @@ def update_params_map(parent, ret_map, width=62):
desc = ''
desc_node = get_child(node, 'parameterdescription')
if desc_node:
desc = fmt_node_as_vimhelp(desc_node, width=width,
indent=(' ' * max_name_len))
desc = fmt_node_as_vimhelp(
desc_node, width=width, indent=(' ' * max_name_len))
ret_map[name] = desc
return ret_map
@ -321,8 +321,10 @@ def update_params_map(parent, ret_map, width=62):
def render_node(n, text, prefix='', indent='', width=62):
"""Renders a node as Vim help text, recursively traversing all descendants."""
global fmt_vimhelp
def ind(s):
return s if fmt_vimhelp else ''
text = ''
# space_preceding = (len(text) > 0 and ' ' == text[-1][-1])
# text += (int(not space_preceding) * ' ')
@ -666,6 +668,8 @@ def extract_from_xml(filename, mode, width):
xrefs.clear()
fns = collections.OrderedDict(sorted(fns.items()))
deprecated_fns = collections.OrderedDict(sorted(deprecated_fns.items()))
return (fns, deprecated_fns)
@ -864,6 +868,7 @@ def main(config):
with open(doc_file, 'ab') as fp:
fp.write(docs.encode('utf8'))
fn_map_full = collections.OrderedDict(sorted(fn_map_full.items()))
with open(mpack_file, 'wb') as fp:
fp.write(msgpack.packb(fn_map_full, use_bin_type=True))