Merge pull request #2940 from Aire-One/doc_propemit_improvement

Fix some quirks on documentation for the `@propemit` tag.
This commit is contained in:
Emmanuel Lepage Vallée 2019-12-05 23:27:37 -05:00 committed by GitHub
commit 7f6a90830b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -168,9 +168,9 @@ local function default_format_callback(self, params, _, md)
end end
if params.type then if params.type then
ret = ret .. '<span class="parameter">('.. ret = ret .. '<span class="types">'..
md("`"..params.type.value.."`").. md("`"..params.type.value.."`")..
")</span>" "</span>"
end end
return ret.." "..md(params.description) return ret.." "..md(params.description)
@ -250,7 +250,7 @@ add_custom_tag {
-- @propemits true/false true/false description[...] -- @propemits true/false true/false description[...]
add_custom_tag { add_custom_tag {
name = "propemits", name = "propemits",
title = "Emit signals:", title = "Emit signals",
hidden = false, hidden = false,
params = {{name = "new_value"}, {name = "old_value"}}, params = {{name = "new_value"}, {name = "old_value"}},
format = function(self, params, item, md) format = function(self, params, item, md)
@ -271,18 +271,18 @@ add_custom_tag {
-- Most signals also have the new value. -- Most signals also have the new value.
if new_value then if new_value then
local type = item.params[1] or "unknown" local type = item.params[1] or "unknown"
subs[2] = type.." ".."v The new value." subs[2] = type.." ".."new_value The new value affected to the property."
end end
-- Some also have the old value. -- Some also have the old value.
if old_value then if old_value then
local type = item.params[1] or "unknown" local type = item.params[1] or "unknown"
subs[3] = type.." ".."v The new value." subs[3] = type.." ".."old_value The property's old value."
end end
local new_params = { local new_params = {
name = { name = name, value = "property::"..item.name }, name = { name = item.name, value = "property::"..item.name },
description = params.description description = description
} }
return default_format_callback(self, new_params, item, md) return default_format_callback(self, new_params, item, md)