*! version 1.4 17jul2018

*! Doug Hemken

Title

stmd Convert dynamic Markdown to HTML format, using Stata dyndoc

Syntax

stmd
filename
[, options]

Main
saving(filename2) save HTML file as filename2

replace replace filename2 if it already exists

Other
hardwrap replace hard wraps (actual line breaks) with
the HTML tag <br>

nomsg suppress message of a link to targetfile

noremove suppress {cmd:<<dd_remove>> processing

nostop do not stop when an error occurs

Description

stmd Takes a dynamic Markdown document using conventional markdown
specification and converts it to HTML via Stata's dyndoc
command. stmd is just a wrapper for stmd2dyn followed by
dyndoc.

Options

Main

saving filename2 to specify the final HTML file name.

replace replace filename2 if it already exists

Other

Additional options which may be passed to dydndoc
are hardwrap, nomsg, noremove, and nostop

hardwrap specifies that hard wraps (actual line breaks) in the
Markdown document be replaced with the HTML line break tag <br>.

nomsg suppresses the message that contains a link to the target file.

noremove specifies that <<dd_remove>> and <</dd_remove>>
tags should not be processed.

nostop allows the document to continue being processed even if an error
occurs.

Remarks

If filename2 is not specified, then filename with an
.html file extension is tried.

The conventional style for dynamic Markdown files is for the dynamic
content to be specified in fenced code blocks with an
information tag. For example

```stata

sysuse auto

```

would be a dynamic code block that loaded the auto data set. To
accomodate some existing Stata markdown usage, this may be written as three
or more backticks or tildes, curly braces around "stata" may be added,
and "stata" may be abbreviated simply "s".

In addition to marking a fenced code block for dynamic execution, various
options may be included in the information tag that control whether a
block is executed, and what resulting text may be included in the document.

This takes the general form

```stata, option(s)

-- stata commands --

```

NO COMMANDS: To prevent the code from being echoed in your
document use the nocommands option. Alternatively, this
may be specified as echo=FALSE, or a forward
slash immediately after "stata".

NO PROMPT: To prevent the typical period prefixing echoed commands,
use the option noprompt.

NO OUTPUT: To prevent the output from appearing in your document
(but to still see the commands and have them execute),
use the option nooutput. Alternatively, use
results=FALSE or results="hide".

NO COMMANDS OR OUTPUT: To prevent ANY output from appearing in your document
(but to still have your code execute),
use the option quietly.

NO EVALUATION: To prevent code evaluation, simply don't include an
information tag. Alternatively, include the eval=FALSE option
(from R).

For example, this would show your regression results, but not the
code that produced them:

```stata, nocommands

sysuse auto

regress price weight

```

For further information on writing Markdown documents, see
help markdown

Examples

. stmd example.stmd, replace

Author

Doug Hemken

Social Science Computing Cooperative

Univ of Wisc-Madison

dehemken@wisc.edu

https://www.ssc.wisc.edu/~hemken/Stataworkshops

https://github.com/Hemken/stmd