-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ld
84 lines (61 loc) · 2.08 KB
/
config.ld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
project = 'SWVR'
title = 'Star Wars Vehicles: Slave I'
description = 'The famous Slave I craft.'
merge = true
not_luadoc = true
no_space_before_args = true
format = 'discount'
dir = 'docs'
local exclude = {
}
file = { 'lua', exclude = exclude }
style = true
readme = './README.md'
kind_names = { topic = 'Manual', module = 'Libraries' }
custom_tags = {
{ 'shared', hidden = true },
{ 'client', hidden = true },
{ 'server', hidden = true },
{ 'internal', hidden = true },
{ 'future', hidden = true },
{ 'deprecated', hidden = true },
{ 'bug', hidden = true }
}
local display_handlers = {}
local registered = false
local function register_handler(name, display_handler)
display_handlers[name] = display_handler
end
-- Prepend an HTML tag to a string
local function prepend_html(str, tag, options)
local html = '<' .. tag .. ' ' .. options .. '>' .. '</' .. tag .. '>'
return html .. str
end
local function append_html(str, tag, options)
local html = '<' .. tag .. ' ' .. options .. '>' .. '</' .. tag .. '>'
return str .. html
end
local function register_handlers()
for _, tag in ipairs({'shared', 'client', 'server'}) do
register_handler(tag, function(name) return prepend_html(name, 'span', 'class="realm ' .. tag .. '" ' .. 'title="' .. tag:sub(1,1):upper() .. tag:sub(2) .. '"') end)
end
for _, tag in ipairs({'internal', 'deprecated', 'future', 'bug'}) do
register_handler(tag, function(name) return append_html(name, 'div', 'class="notice ' .. tag .. '" ' .. 'title="' .. tag:sub(1,1):upper() .. tag:sub(2) .. '"') end)
end
registered = true
end
custom_display_name_handler = function(item, default_handler)
if not registered then register_handlers() end
local name = item.type ~= 'function' and item.name or item.name .. item.args
for tag, handler in pairs(display_handlers) do
if item.tags[tag] then
name = handler(name)
end
end
if name ~= item.name then return name end
return default_handler(item)
end
tparam_alias('entity', 'entity')
tparam_alias('player', 'player')
tparam_alias('vector', 'vector')
tparam_alias('angle', 'angle')