haghish / markdoc

A literate programming package for Stata which develops dynamic documents, slides, and help files in various formats
http://haghish.com/markdoc
87 stars 30 forks source link

Add options to include comments in the generated report #30

Open mronkko opened 3 years ago

mronkko commented 3 years ago

I am using markdoc on my course where we learn statistical research methods using Stata. As a part of the course, the students produce a do-file that answers a research question that I give the students. Then the students export the log of the analysis file to a word document and write their interpretation.

I just realized that markdoc does not include the comments in the do file in the output. I understand that this is useful when the purpose is to generate reports. However, for my use case it would be useful to add an option that would print the comments just as they appear in Stata into the word document. This would allow me to check not also how the students interpreted the results by writing in Word, but how they documented that Stata do-file itself. I am not looking for any fancy formatting, but just printing the comments as if they were Stata commands that did not produce any output. I hope that this comment makes sense.

haghish commented 3 years ago

Hi Mikko,

Actually there are other programs you can use for that purpose, which basically run a do file and preserve the comments.

MarkDoc's engine is written to basically ignore regular comments. It is possible to change it and make that behavior optional, but I am afraid it will take a lot of time to ensure no bug is occurring again as the current version seems to be quite stable.

mronkko commented 3 years ago

Interesting. When I was choosing a report generation software a few years ago, MarkDoc seemed to be the only one. What other software are there? I would need to get the Stata log including commands, comments, and output and all the figures that are produced as a word document. MarkDoc is nearly perfect solution for this task.

haghish commented 3 years ago

I was about to say log2html but actually, I am not certain if that program preserves the comments...