Do you use any tool for writing tutorial style, or cookbook style documentation? How do you keep it up to date (e.g. changes in output, changes in signatures, changes in command line parameters,.. )? Right now I do everything manually, and it's a pain.
I know the tools for producing reference docs, like Sandcastle and NDoc. That's not what I'm looking for.
To clarify, my dream tool would allow me to write an actual .cs or .fs file like:
//>tutorialtext The PrintCakeReady function allows you to check whether your cake is ready. For example:
//>startcodesnippet
var cake = new ChocolateCake();
cake.PrintCakeReady();
//>endcodesnippet
//>tutorialtext Which produces:
//>outputprevioussnippet
This .cs or .fs file should be compilable - I can include it in my project so that it remains up to date. On the other hand I should be able to produce documentation from it, i.e. to html, which would include the code fragments in some distinctive style, execute them (like in Snippet Compiler, or Linqpad) and include the results in the appropriate place.
The benefits would be huge: I'd detect many incompatibilities in the documentation, it could be refactored, and if I change the output of some function, the documentation would auto-update.
But maybe there's a far simpler approach that gets me 90% there. How do you do it?
EDIT I've found this paper which elaborates on this idea. However, the associated tools are old (2002) and not updated.