script to generate a json styled doc from input or file upload