Extract write method from process
Optional `base` argument

For correct relative urls in generated file in case output file
is in different directory
ver++