/* *! stmd dialog version 1.1.0, 2 October 2019, Doug Hemken, dehemken@wisc.edu *! for stmd version 1.7.1, 30 September 2019 Stata Markdown -------------- stmd srcfile [ , saving(targetfile) replace hardwrap noremove nomsg nostop docx pdf embedimage] To install in User Statistics menu via Stata commands: . window menu append submenu "stUser" "Documents" . window menu append item "Documents" "Stata Markdown to HTML, docx, PDF (&stmd)" "db stmd" . window menu refresh To permanently install, place these commands in your -profile.do- file. */ VERSION 16 POSITION . . 410 250 DIALOG main, label("stmd - Translate a document to HTML, docx, or PDF") tabtitle("Main") BEGIN TEXT tx_source 10 10 . ., label("Source document:") FILE file_source 10 +20 390 ., error("Source document") /// label("Browse") TEXT tx_target 10 +25 . ., label("Target document:") FILE file_target 10 +20 390 ., error("Target document") /// label("Browse") CHECKBOX cb_replace 15 +25 . ., label("replace target document") CHECKBOX cb_docx 15 +25 . ., label("convert to Word (docx)") CHECKBOX cb_pdf 15 +25 . ., label("convert to PDF") CHECKBOX cb_image 15 +25 . ., label("embedimage (in HTML)") CHECKBOX cb_hardwrap 15 +25 . ., label("hardwrap - line breaks preserved") CHECKBOX cb_nomsg 15 +25 . ., label("nomsg - no output file note") CHECKBOX cb_nostop 15 +25 . ., label("nostop - ignore errors") END OK ok1, label("OK") CANCEL can1, label("Cancel") SUBMIT sub1, label("Submit") HELP hlp1, view("help stmd") RESET res1 COPY copy1 PROGRAM command BEGIN put "stmd " require main.file_source put `"""' main.file_source `"""' " " put ", " if main.file_target.isneq("") { put "saving(" `"""' main.file_target `"""' ") " } if main.cb_replace { put "replace " } if main.cb_docx { put "docx " } if main.cb_pdf { put "pdf " } if main.cb_image { put "embedimage " } if main.cb_hardwrap { put "hardwrap " } if main.cb_nomsg { put "nomsg " } if main.cb_nostop { put "nostop " } END