The handling of rendering input files and directories is kind of awkward with all the logic in render.go
It could be better to parse all the input files beforehand according to the mode (generate a list of all input files to parse regardless of the flag. This way the directory walking can be done in this stage and not in the render stage).
Then the render can be simplified to maybe be one function that renders a reader to a writer, or something similar.