Freeze playbook after playbookBuilt event
Currently, the playbook object is frozen immediately after it's validated, prior to the generator firing the playbookBuilt event. The decision for the timing of this operation predated the Antora extension facility. Unfortunately, it makes customizing the playbook in an extension very tedious because the object has to be recreated to be changed. When that happens, the object goes back into the context unfrozen, defeating the whole point of freezing it in the first place. Freezing the playbook should be deferred until after the playbookBuilt
event is fired.
The reason for freezing (and subsequently locking) the playbook is to encourage extensions not to make changes to the playbook while the generator is running. It acts as a guard rail to keep the extension developer on the right track. We'd like to discourage the addition of unknown keys too, but that's currently not possible.