include ./mixins/sectionLink.jade
include ./mixins/diffGeneratedNotice.jade
extends layout

mixin toc(sections)
  ol
    each section in sections
      li
        if section.sections.length === 0
          +sectionLink(section)
        else
          | #{section.headingText}
          +toc(section.sections)

block content
  h1 Diff of HTMLs
  p Unofficial diff viewer for <a href="https://html.spec.whatwg.org/multipage/">WHATWG HTML Standard</a> and <a href="https://w3c.github.io/html/">W3C HTML</a>. The Diff of HTMLs provides side-by-side diff view of each section between the specifications. 

  h2 Table of contents (TOCs) of the HTML specifications

  +sectionLegends()

  p.note Note: This site modifies TOCs to reduce unnecessary diffs. The following TOCs are not equal to the specifications. <a href="/about/">More info</a>.

  +diffGeneratedNotice(time)

  div.toc
    +toc(index)

include ./mixins/sectionLink.jade
include ./mixins/diffGeneratedNotice.jade
extends layout

mixin toc(sections)
  ol
    each section in sections
      li
        - var childSections = section.sections || [];
        if childSections.length === 0
          +sectionLink(section)
        else
          | #{section.headingText}
          +toc(childSections)

block content
  h1 Diff of HTMLs
  p Unofficial diff viewer for <a href="https://html.spec.whatwg.org/multipage/">WHATWG HTML Standard</a> and <a href="https://w3c.github.io/html/">W3C HTML</a>. The Diff of HTMLs provides side-by-side diff view of each section between the specifications. 

  h2 Table of contents (TOCs) of the HTML specifications

  +sectionLegends()

  p.note Note: This site modifies TOCs to reduce unnecessary diffs. The following TOCs are not equal to the specifications. <a href="/about/">More info</a>.

  +diffGeneratedNotice(time)

  div.toc
    +toc(index)

Handle case where section.sections is undefined
Handle case where section.sections is undefined
