document generator script