Skip to content

Commit

Permalink
Better stmd2dyn Help
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Hemken authored and Douglas Hemken committed Sep 30, 2019
1 parent 306d033 commit 0e50aaf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 34 deletions.
19 changes: 15 additions & 4 deletions stmd.ado
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
*! version 1.7
*! version 1.7.1
*! Doug Hemken
*! 28 Sep 2019
*! 30 Sep 2019

// ISSUES
// ======
// revise dialogs
// revise Help files

// capture program drop stmd
program define stmd, rclass
Expand All @@ -25,7 +24,19 @@ program define stmd, rclass

version 15


* version checks
if (c(stata_version) < 16) {
if ("`docx'"=="docx" | "`flexdocx'"=="flexdocx" | "`pdf'"=="pdf") {
display in error "option {cmd:`docx' `flexdocx' `pdf'} requires Stata 16"
display "try {cmd:dynpandoc} if installed"
exit 9
}
else if ("`embedimage'"=="embedimage") {
display in error "option {cmd:embedimage} requires Stata 16"
display "option ignored"
local embedimage ""
}
}

gettoken infile opargs : anything

Expand Down
5 changes: 3 additions & 2 deletions stmd.sthlp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
{* *! Doug Hemken}{...}
{vieweralsosee "" "--"}{...}
{vieweralsosee "stmd2dyn" "help stmd2dyn"}{...}
{vieweralsosee "markdown" "help markdown"}{...}
{vieweralsosee "dyndoc" "help dyndoc"}{...}
{vieweralsosee "dyntext" "help dyntext"}{...}
{vieweralsosee "dynamic tags" "help dynamic tags"}{...}
{vieweralsosee "markdown" "help markdown"}{...}
{vieweralsosee "docx2pdf" "help docx2pdf"}{...}
{viewerjumpto "Syntax" "stmd##syntax"}{...}
{viewerjumpto "Description" "stmd##description"}{...}
{viewerjumpto "Options" "stmd##options"}{...}
Expand Down Expand Up @@ -82,7 +83,7 @@ rather than link them{p_end}
{dlgtab:Main}

{phang}
{opt saving} {it: targetfile} to specify the final document's file
{opth saving:(filename:targetfile)} to specify the final document's file
name. If not specified this defaults to
{it:srcfile} with the appropriate file extension.{p_end}

Expand Down
4 changes: 2 additions & 2 deletions stmd2dyn.ado
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// better, more extensive preamble, e.g. linesize, other options?
// NOGRaph option

capture program drop stmd2dyn
capture mata: mata clear
// capture program drop stmd2dyn
// capture mata: mata clear
program define stmd2dyn, rclass
syntax anything(name=infile), [ ///
SAVing(string) replace ///
Expand Down
39 changes: 13 additions & 26 deletions stmd2dyn.sthlp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{vieweralsosee "" "--"}{...}
{smcl}
{* *! version 1.7 29sep2019}{...}
{* *! version 1.7 30sep2019}{...}
{* *! Doug Hemken}{...}
{vieweralsosee "" "--"}{...}
{vieweralsosee "stmd" "help stmd"}{...}
Expand All @@ -25,9 +24,17 @@ dynamic document format.{p_end}
{p 8 17 2}
{cmd:stmd2dyn}
{it:srcfile}
[{it:arguments}]
[{cmd:,} {it:options}]

{phang}
{it:srcfile} is a plain text file containing text
and code blocks in standard dynamic Markdown format.{p_end}

{phang}
Enclose filenames in double quotes
if they contain blanks or other special characters.{p_end}


{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
Expand All @@ -36,11 +43,7 @@ dynamic document format.{p_end}
{synopt:{opt replace}}replace {it:targetfile} if it already exists{p_end}

{syntab:Other}
{synopt :{opt hardwrap}}replace hard wraps (actual line breaks) with
the HTML tag {cmd:<br>}{p_end}
{synopt :{opt nomsg}}suppress message of a link to {it:targetfile}{p_end}
{synopt :{opt noremove}}suppress {cmd:<<dd_remove>> processing{p_end}
{synopt :{opt nostop}}do not stop when an error occurs{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
Expand All @@ -50,7 +53,7 @@ the HTML tag {cmd:<br>}{p_end}
{title:Description}

{pstd}
{cmd:stmd2dyn} Takes a Markdown document using conventional markdown
{cmd:stmd2dyn} takes a Markdown document which uses standard markdown
specification and converts it to Stata's dialect using {cmd: dyndoc}
dynamic tags.

Expand All @@ -61,40 +64,24 @@ the HTML tag {cmd:<br>}{p_end}
{dlgtab:Main}

{phang}
{opt saving} {it: targetfile} to save the {cmd: dyndoc}, which can
{opth saving:(filename:targetfile)} to save the {cmd: dyndoc}, which can
then be processed by Stata.{p_end}

{phang}
{opt replace} replace {it:targetfile} if it already exists{p_end}

{dlgtab:More}

{phang}
Additional options which may be passed to {cmd:dydndoc}
are {cmd:hardwrap}, {cmd:nomsg}, {cmd:noremove}, and {cmd:nostop}{p_end}

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

{phang}
{opt nomsg} suppresses the message that contains a link to the target file.

{phang}
{opt noremove} specifies that {cmd:<<dd_remove>>} and {cmd:<</dd_remove>>}
tags should not be processed.

{phang}
{opt nostop} allows the document to continue being processed even if an error
occurs.


{marker remarks}{...}
{title:Remarks}

{pstd}
If {it: targetfile} is not specified, then {it: srcfile} with an
.dyn file extension is tried.
.dyn file extension is used.

{pstd}
For more on how to format documents, see {cmd: help stmd}.
Expand Down

0 comments on commit 0e50aaf

Please sign in to comment.