<% local sorted_headers = {} %> <% for name,_ in pairs(headers) do %> <% table.insert(sorted_headers, name) %> <% end %> <% table.sort(sorted_headers) %> <% for _,header in pairs(sorted_headers) do %> <% local sections = headers[header] %>

<%- header %>

<% local sorted_sections = {} %> <% local section_map = {} %> <% for _,section in pairs(sections) do %> <% table.insert(sorted_sections, section.name) %> <% section_map[section.name] = section %> <% end %> <% table.sort(sorted_sections) %> <% print("sections:",sorted_sections) %>
    <% for _,sectionname in ipairs(sorted_sections) do %> <% local section = section_map[sectionname] %>
  1. <%- section.name %>
  2. <% end %>
<% end %>