Add callback functionality to doc