Added callbacks that can be used when writing a document to allow filtering or changing "pretty" values