From 2c1c37fb12b7bfbfa37e67f235fe14fd29ed3a55 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 13 Dec 2021 11:04:32 -0800 Subject: [PATCH] doc: Merge the Inherited/Deprecated/Readonly tag style. They are on the right like Inherited, but use the "chip" style of ReadOnly. --- docs/config.ld | 25 ++++++++++++------------- docs/ldoc.css | 10 +++++++--- docs/ldoc.ltp | 17 ++++++++++------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/docs/config.ld b/docs/config.ld index dffe3ecf2..49619d95e 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -591,12 +591,14 @@ local named_args = { -- Sections which are hidden by default, but visible when clicked. local summarize = { - emits = {index = 1, title = "signal" , count = true }, - propemits = {index = 2, title = "signal" , count = true }, - usebeautiful = {index = 3, title = "theme variable" , count = true }, - propbeautiful = {index = 4, title = "theme variable" , count = true }, - request = {index = 5, title = "permission" , count = true }, - classsignal = {index = 6, title = "Class level only", count = false}, + is_deprecated = {index = 1, title = "deprecated" , count = false}, + emits = {index = 2, title = "signal" , count = true }, + propemits = {index = 3, title = "signal" , count = true }, + usebeautiful = {index = 4, title = "theme variable" , count = true }, + propbeautiful = {index = 5, title = "theme variable" , count = true }, + request = {index = 6, title = "permission" , count = true }, + classsignal = {index = 7, title = "Class level only", count = false}, + readonly = {index = 8, title = "read only" , count = false}, } local delimiter_for_tag = { @@ -645,9 +647,6 @@ local function generate_summary(item) has_show_more = v.showcount or has_show_more end end - if item.tags.readonly then - ret[#ret+1] = {title = "read only"} - end item.extra_summary = #ret > 0 and ret or nil item.has_show_more = has_show_more @@ -939,6 +938,10 @@ local is_deprecated = { } custom_display_name_handler = function(item, default_handler) + if is_deprecated[item.type] then + item.tags.is_deprecated = {true} + end + init_custom_types(item) local ret = default_handler(item) @@ -984,10 +987,6 @@ custom_display_name_handler = function(item, default_handler) ret = render_methods(item) end - if is_deprecated[item.type] then - return ret .. " [deprecated]" - end - -- Get rid of the "module:" in front of method names. It is either wrong or -- just redundant. ret = ret:gsub("([^:]*)(:[^:])","%2") diff --git a/docs/ldoc.css b/docs/ldoc.css index 9857bcfb2..d9ea58596 100644 --- a/docs/ldoc.css +++ b/docs/ldoc.css @@ -346,14 +346,18 @@ span.inheritance { text-align: right; } -span.chips--readonly { +span.chips { border: 1px solid #9db9f3; border-radius: 25px; - padding: 1px 3px; - font-size: 70%; + padding-left: 5pt; + padding-right: 5pt; + padding-top: 1pt; + padding-bottom: 1pt; + font-size: 85%; color: #9db9f3; background-color: #FFF; margin-left: 10px; + vertical-align: middle; } table.function_list .function_args /*.function_modname*/ { diff --git a/docs/ldoc.ltp b/docs/ldoc.ltp index 2c518e306..58a2a1e32 100644 --- a/docs/ldoc.ltp +++ b/docs/ldoc.ltp @@ -292,17 +292,20 @@ # end # end - + $(M(item.summary,item)) -# if item.tags.readonly then - read only -# end -# if inherited then - Inherited from $(item.baseclass) - +# if item.tags.is_deprecated then + Deprecated # end +# if item.tags.readonly then + Read only +# end +# if inherited then + Inherited from $(item.baseclass) +# end + # end end -- for items # last_kind = kind