schema.html 1.8 KB

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