You could possibly use sage -sws2rst for partial automation. It creates a ReST document that should have Sage input/output blocks in it as a text file. You'd still have to extract those, or possibly just put triple quotes around all the text.