TOC Generation¶
wap can generate TOC files for you addons. Generating TOC files:
- lets you support all desired flavors of WoW (Retail, Classic, Vanilla) simultaneously
 - has less error surface area than maintaining TOC files directly
 - keeps your project DRY by auto-providing some tags from other parts of the configuration
 - lets wap check that the TOC file is valid for the current project
 
TOC generation is enabled on a per-addon basis if you provide a
package[*].toc configuration section.
For example, if you have a configuration like this:
{
  "$schema": "https://raw.githubusercontent.com/t-mart/wap/master/src/wap/schema/wap.schema.json",
  "name": "MyAddon",
  "version": "0.0.1",
  "author": "tim",
  "wowVersions": {
    "mainline": "9.2.7",
    "classic": "4.4.0",
    "vanilla": "1.14.3"
  },
  "package": [
    {
      "path": "./MyAddon",
      "toc": {
        "tags": {
          "Title": "MyAddon",
          "Notes": "A cool addon"
        },
        "files": [
          "Main.lua"
        ]
      }
    }
  ]
}
The, wap will generate a TOC file for each flavor, including an "unflavored" fallback TOC, like this:
## Author: tim
## Interface: 90207
## Version: 0.0.1
## X-BuildDateTime: 2022-10-20T21:38:08.636618+00:00
## X-BuildTool: wap 0.9.0
## Title: MyAddon
## Notes: A cool addon
Main.lua
## Author: tim
## Interface: 40400
## Version: 0.0.1
## X-BuildDateTime: 2022-10-20T21:38:08.636618+00:00
## X-BuildTool: wap 0.9.0
## Title: MyAddon
## Notes: A cool addon
Main.lua
## Author: tim
## Interface: 11403
## Version: 0.0.1
## X-BuildDateTime: 2022-10-20T21:38:08.636618+00:00
## X-BuildTool: wap 0.9.0
## Title: MyAddon
## Notes: A cool addon
Main.lua
## Author: tim
## Interface: 90207
## Version: 0.0.1
## X-BuildDateTime: 2022-10-20T21:38:08.636618+00:00
## X-BuildTool: wap 0.9.0
## Title: MyAddon
## Notes: A cool addon
Main.lua
Note that they are all the same except for the interface number.
Default Tags¶
If you do not provide an explicit value for some tags in
package[*].toc.tags, then wap will provide defaults for you.
The table below lists the tags that wap provides and where they're sourced from.
| Tag | Source | 
|---|---|
Interface | 
The flavor's version from wowVersions setting (in interface form) | 
Version | 
version setting | 
Author | 
author setting | 
Title | 
name of directory of package[*].path setting | 
Notes | 
description setting | 
X-BuildDateTime | 
the UTC instant that the addon was built | 
X-BuildTool | 
wap and its current version |