code: func makeContext() ctx {
  	c := ctx{
  		DemoTypes:   []ctxType{},
  		PacketTypes: []ctxType{},
  	}
  
  	demoIds := []int{}
  	demoMap := map[int]ctxType{}
  	packetIds := []int{}
  	packetMap := map[int]ctxType{}
  
  	for _, t := range messageTypes {
  		for vs, n := range t.enumValues {
  			// Find an enum type for the enum value
  			if ts, ok := t.enumToType(vs); ok {
  				// Find a struct type for the enum type
  				if messageTypeNames[ts] {
  					cs, ok := t.enumToCallback(vs)
  					if !ok {
  						cs = ts
  					}
  					if t.isPacket {
  						packetIds = append(packetIds, n)
  						packetMap[n] = ctxType{
  							Id:       n,
  							Callback: cs,
  							EnumName: vs,
  							TypeName: ts,
  						}
  					} else {
  						demoIds = append(demoIds, n)
  						demoMap[n] = ctxType{
  							Id:       n,
  							Callback: cs,
  							EnumName: vs,
  							TypeName: ts,
  						}
  					}
  				} else {
  					fmt.Printf("warning: no matching type %s for enum: type %s %s = %d\n", ts, vs, t.enumName, n)
  				}
  			} else {
  				fmt.Printf("notice: skipped manually excluded enum: type %s %s = %d\n", vs, t.enumName, n)
  			}
  		}
  	}
  
  	sort.Ints(demoIds)
  	sort.Ints(packetIds)
  
  	for _, id := range demoIds {
  		c.DemoTypes = append(c.DemoTypes, demoMap[id])
  	}
  	for _, id := range packetIds {
  		c.PacketTypes = append(c.PacketTypes, packetMap[id])
  	}
  
  	return c
  }
docs: // makeContext transforms messageTypes information into template context