schema.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <%- head_tpl({
  5. site_title = site_title,
  6. title = "Schema: " .. schema.attr.label,
  7. }) %>
  8. </head>
  9. <body>
  10. <main>
  11. <h1 class="title">Schema: <%= schema.attr.label %></h1>
  12. <section id="schema_attr">
  13. <h2>Attributes</h1>
  14. <dl class="schema_md">
  15. <% for k, v in pairs(schema.attr) do %>
  16. <dt><%= k %></dt>
  17. <dd><%= v %></dd>
  18. <% end %>
  19. </dl>
  20. </section>
  21. <section id="schema_prop">
  22. <h2>properties</h1>
  23. <dl class="schema_md">
  24. <% for _, prop in ipairs(schema.properties) do %>
  25. <% local k, def = table.unpack(prop) %>
  26. <dt><%= k %></dt>
  27. <dd>
  28. <dl>
  29. <% for def_n, def_v in pairs(def) do %>
  30. <dt><%= def_n %></dt>
  31. <% if type(def_v) == "table" then %>
  32. <% for def_kk in pairs(def_v) do %>
  33. <dd><%= def_kk %></dd>
  34. <% end %>
  35. <% for _, def_vv in ipairs(def_v) do %>
  36. <dd><%= def_vv %></dd>
  37. <% end %>
  38. <% else %>
  39. <dd><%= def_v %></dd>
  40. <%end %>
  41. <% end %>
  42. </dl>
  43. </dd>
  44. <% end %>
  45. </dl>
  46. </section>
  47. </main>
  48. <footer></footer>
  49. </body>
  50. </html>