Issue #150: 'info' section ordering is now consistent

This commit is contained in:
steve donovan 2014-01-07 17:48:50 +02:00
parent a8c4d9fa1e
commit d367390c68
2 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@ local path = require 'pl.path'
local stringx = require 'pl.stringx'
local template = require 'pl.template'
local tablex = require 'pl.tablex'
local OrderedMap = require 'pl.orderedMap'
local tools = require 'ldoc.tools'
local markup = require 'ldoc.markup'
local prettify = require 'ldoc.prettify'
@ -39,16 +40,16 @@ local function cleanup_whitespaces(text)
end
local function get_module_info(m)
local info = {}
local info = OrderedMap()
for tag in doc.module_info_tags() do
local val = m.tags[tag]
if type(val)=='table' then
val = table.concat(val,',')
end
tag = stringx.title(tag)
info[tag] = val
info:set(tag,val)
end
if next(info) then
if #info:keys() > 0 then
return info
end
end

View File

@ -99,7 +99,7 @@ return [==[
# if module.info then
<h3>Info:</h3>
<ul>
# for tag, value in ldoc.pairs(module.info) do
# for tag, value in module.info:iter() do
<li><strong>$(tag)</strong>: $(M(value,module))</li>
# end
</ul>