I don’t think this is as simple as you suggest (because I’ve tried things like it). First, you have to keep track of which documents need the same header/footer (unless all are exactly the same). Second, you have to extract the title from the content somehow. There are a bunch of little steps like these that make it more complex (in my mind) than just writing HTML directly.