refactoring scripts
refactoring the gen_rst_script to fit to the inasage-doc repository part1