Creating HTML or Markdown documents from within Stata


webdoc is a Stata command for creating HTML or Markdown documents from within Stata. The command provides a way to embed HTML or Markdown code directly in a do-file and to automate the integration of results from Stata in the final document.

The webdoc command can be used, for example, to create a webpage documenting your data analysis, including all Stata output and graphs. More generally, the command is useful if you want to create and maintain a website that contains results computed by Stata.


To install webdoc on your system, run command

ssc install webdoc, replace

in Stata. Thereafter, type

help webdoc

to view the help file. To check for updates, type

adoupdate webdoc

Alternatively, you can download webdoc from the SSC Archive and add the files to your system manually (see file readme.txt within webdoc.zip for installation instructions). Note that webdoc requires Stata 10.1 or newer.

Also see

A working paper on webdoc is available from here. For general information on Stata, see www.stata.com. A good source for detailed information on HTML and CSS is www.w3schools.com. For Markdown, see daringfireball.net/projects/markdown.

Source of this website

This website is based on the Bootstrap framework (version 3.3.7) and has been generated by webdoc (or, to be precise, by a renamed copy of webdoc, since webdoc cannot document itself). The Stata do-files of this website can be downloaded from here.


webdoc has been written by Ben Jann.

Thanks for citing webdoc in your work in one of the following ways: