Add @deprecated tag to lua docs
This commit is contained in:
@@ -34,6 +34,7 @@ pretty_topic_names = true -- strips extension from manual filenames, this does n
|
||||
|
||||
custom_tags = {
|
||||
{"realm", hidden = true},
|
||||
{"deprecated", hidden = true},
|
||||
{"internal", hidden = true}
|
||||
}
|
||||
|
||||
|
||||
@@ -537,3 +537,7 @@ a.type {
|
||||
background-color: inherit;
|
||||
padding: 0 8px 0 8px;
|
||||
}
|
||||
|
||||
.strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
50
docs/templates/ldoc.ltp
vendored
50
docs/templates/ldoc.ltp
vendored
@@ -14,7 +14,55 @@ function ldoc.url(path)
|
||||
end
|
||||
|
||||
function ldoc.realm_icon(realm)
|
||||
return "<span class=\"realm " .. (realm or "") .. "\"></span>";
|
||||
return "<span class=\"realm " .. (realm or "") .. "\"></span>"
|
||||
end
|
||||
|
||||
function ldoc.sidebar_item(item, module)
|
||||
local text = ""
|
||||
|
||||
local deprecated = item.tags.deprecated
|
||||
if deprecated then
|
||||
text = text .. "<span class=\"strikethrough\">"
|
||||
else
|
||||
text = text .. "<span>"
|
||||
end
|
||||
|
||||
text = text .. ldoc.realm_icon(item.tags.realm[1])
|
||||
text = text .. "<a href=\""
|
||||
.. ldoc.ref_to_module(module) .. "#" .. item.name
|
||||
.. "\">"
|
||||
|
||||
if ldoc.is_kind_classmethod(module.kind) then
|
||||
text = text .. item.name:gsub(".+:", "")
|
||||
else
|
||||
text = text .. item.name:gsub(module.name .. ".", "")
|
||||
end
|
||||
|
||||
text = text
|
||||
.. "</a>"
|
||||
.. "</span>"
|
||||
return text
|
||||
end
|
||||
|
||||
function ldoc.item_header(item)
|
||||
local text = ""
|
||||
|
||||
text = text .. "<a class=\"anchor\">"
|
||||
|
||||
local deprecated = item.tags.deprecated
|
||||
if deprecated then
|
||||
text = text .. "<h1 class=\"strikethrough\">"
|
||||
else
|
||||
text = text .. "<h1>"
|
||||
end
|
||||
|
||||
text = text
|
||||
.. ldoc.realm_icon(item.tags.realm[1])
|
||||
.. ldoc.display_name(item)
|
||||
.. "</h1>"
|
||||
.. "</a>"
|
||||
|
||||
return text
|
||||
end
|
||||
|
||||
function ldoc.is_kind_classmethod(kind)
|
||||
|
||||
11
docs/templates/module.ltp
vendored
11
docs/templates/module.ltp
vendored
@@ -40,9 +40,14 @@
|
||||
{% for item, _ in pairs(items) do %}
|
||||
<section class="method" id="{{item.name}}">
|
||||
<header>
|
||||
<a class="anchor">
|
||||
<h1>{* ldoc.realm_icon(item.tags.realm[1]) *}</span>{{ldoc.display_name(item)}}</h1>
|
||||
</a>
|
||||
{* ldoc.item_header(item) *}
|
||||
|
||||
{% if item.tags.deprecated then %}
|
||||
<div class="notice warning">
|
||||
<div class="title">Deprecated</div>
|
||||
<p>This API is deprecated and shouldn't be used anymore.</p>
|
||||
</div>
|
||||
{% end %}
|
||||
|
||||
{% if (item.tags.internal) then %}
|
||||
<div class="notice error">
|
||||
|
||||
18
docs/templates/sidebar.ltp
vendored
18
docs/templates/sidebar.ltp
vendored
@@ -59,14 +59,7 @@ end
|
||||
{% for k, v in pairs(currentMod.items) do %}
|
||||
{% if (v.kind == "functions") then %}
|
||||
<li>
|
||||
{* ldoc.realm_icon(v.tags.realm[1]) *}
|
||||
<a href="{* ldoc.ref_to_module(currentMod) *}#{{v.name}}">
|
||||
{% if (ldoc.is_kind_classmethod(currentMod.kind)) then
|
||||
echo((v.name:gsub(".+:", "")))
|
||||
else
|
||||
echo((v.name:gsub(currentMod.name .. ".", "")))
|
||||
end %}
|
||||
</a>
|
||||
{* ldoc.sidebar_item(v, currentMod) *}
|
||||
</li>
|
||||
{% end %}
|
||||
{% end %}
|
||||
@@ -90,14 +83,7 @@ end
|
||||
{% for k, v in pairs(currentMod.items) do %}
|
||||
{% if (v.kind == "fields" or v.kind == "tables") then %}
|
||||
<li>
|
||||
{* ldoc.realm_icon(v.tags.realm[1]) *}
|
||||
<a href="{* ldoc.ref_to_module(currentMod) *}#{{v.name}}">
|
||||
{% if (ldoc.is_kind_classmethod(currentMod.kind)) then
|
||||
echo((v.name:gsub(".+:", "")))
|
||||
else
|
||||
echo((v.name:gsub(currentMod.name .. ".", "")))
|
||||
end %}
|
||||
</a>
|
||||
{* ldoc.sidebar_item(v, currentMod) *}
|
||||
</li>
|
||||
{% end %}
|
||||
{% end %}
|
||||
|
||||
Reference in New Issue
Block a user