{%
math.randomseed(os.time())
local baseUrl = ldoc.css:gsub("ldoc.css", "")
local repo = "https://github.com/evilfactory/LuaCsForBarotrauma"
local pageTitle = mod and (ldoc.display_name(mod) .. " - " .. ldoc.title) or ldoc.title
local oldmarkup = ldoc.markup
function ldoc.markup(text, item)
return oldmarkup(text, item, ldoc.plain)
end
function ldoc.url(path)
return baseUrl .. path
end
function ldoc.asset_url(path)
local uuid = string.gsub("xxxxxxx", "x", function(c)
return string.format("%x", math.random(0, 0xf))
end)
return baseUrl .. path .. "?v=" .. uuid
end
function ldoc.realm_icon(realm)
assert(
realm == "server" or realm == "client" or realm == "shared",
string.format("WARNING: invalid realm '%s'", realm))
return ""
end
function ldoc.realm_icon_from_item(item)
local realm = item.tags.realm
assert(type(realm) == "table" and #realm > 0, "missing @realm tag")
return ldoc.realm_icon(realm[1])
end
function ldoc.sidebar_item(item, module)
local text = ""
text = text .. ldoc.realm_icon_from_item(item)
text = text .. ""
local deprecated = item.tags.deprecated
if deprecated then
text = text .. ""
else
text = text .. ""
end
if ldoc.is_kind_classmethod(module.kind) then
text = text .. item.name:gsub(".+:", "")
else
text = text .. item.name:gsub(module.name .. ".", "")
end
text = text
.. ""
.. ""
return text
end
function ldoc.item_header(item)
local text = ""
text = text .. ""
local deprecated = item.tags.deprecated
if deprecated then
text = text .. ""
else
text = text .. "
"
return text
end
function ldoc.is_kind_classmethod(kind)
return kind ~= "libraries"
end
function ldoc.repo_reference(item)
return repo .. "tree/master" .. item.file.filename:gsub(item.file.base, "/gamemode") .. "#L" .. item.lineno
end
local function moduleDescription(mod)
if (mod.type == "topic") then
return mod.body:gsub(mod.display_name, ""):gsub("#", ""):sub(1, 256) .. "..."
end
return mod.summary
end
%}
"
end
text = text
.. ldoc.realm_icon_from_item(item)
.. ldoc.display_name(item)
.. "
"
.. "