code: func (c Category) RenderHTML(buffer *bytes.Buffer, depth int, maxDepth int) {
  	// Check to see if this category is a leaf.
  	// A leaf category has no other categories as it's children.
  	isLeafCategory := true
  	for _, child := range c.children {
  		if _, ok := child.(*Category); ok {
  			isLeafCategory = false
  			break
  		}
  	}
  
  	if maxDepth > 0 {
  		must(fmt.Fprintf(buffer, `<div class="console-column" style="flex: %d">`, c.NumLeafNodes()))
  		must(fmt.Fprintf(buffer, `<div class="console-top-item">%s</div>`, template.HTMLEscapeString(c.Name)))
  		if isLeafCategory {
  			must(fmt.Fprintf(buffer, `<div class="console-top-row console-leaf-category">`))
  		} else {
  			must(fmt.Fprintf(buffer, `<div class="console-top-row">`))
  		}
  	}
  
  	for _, child := range c.children {
  		child.RenderHTML(buffer, depth+1, maxDepth)
  	}
  
  	if maxDepth > 0 {
  		must(buffer.WriteString(`</div></div>`))
  	}
  }
docs: // RenderHTML renders the Category struct and its children as HTML into a buffer.
  // If maxDepth is negative, skip the labels to render the HTML as flat rather than nested.