-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Douglas Hemken
authored and
Douglas Hemken
committed
Jul 24, 2018
1 parent
b31e54a
commit c0b5a31
Showing
8 changed files
with
196 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<h1><a href="#an-example-file" id="an-example-file">An Example File</a></h1> | ||
<p>Some preliminary text.</p> | ||
<p>A code block, evaluted:</p> | ||
<pre><code class="language-stata">. sysuse auto | ||
(1978 Automobile Data) | ||
|
||
. summarize weight | ||
|
||
Variable | Obs Mean Std. Dev. Min Max | ||
-------------+--------------------------------------------------------- | ||
weight | 74 3019.459 777.1936 1760 4840 | ||
|
||
</code></pre> | ||
<p>In-line text: the mean weight is 3019.5 pounds.</p> | ||
<p>A list:</p> | ||
<ul> | ||
<li>N = 74</li> | ||
<li>mean = 3019.5</li> | ||
<li>sd = 777.19</li> | ||
</ul> | ||
<p>A graph:</p> | ||
<pre><code class="language-stata">. histogram weight | ||
(bin=8, start=1760, width=385) | ||
|
||
</code></pre> | ||
<img src="Graph.svg" > | ||
<p>More text.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
*! dyndoc dialog version 1.0.0, 24 July 2018, Doug Hemken, [email protected] | ||
*! for dyndoc version 1.0.0, 17 May 2017, Hua Peng, StataCorp | ||
|
||
Stata Markdown | ||
-------------- | ||
|
||
dyndoc filename [ , saving(filename2) replace hardwrap noremove nomsg nostop ] | ||
|
||
Note: does not allow option arguments, does not allow pegdown option | ||
|
||
To install in User Statistics menu via Stata commands: | ||
|
||
. window menu append submenu "stUser" "Documents" | ||
. window menu append item "Documents" "DYN to HTML (dyndoc)" "db dyndoc" | ||
|
||
. window menu refresh | ||
|
||
To permanently install, place these commands in your -profile.do- file. | ||
*/ | ||
|
||
VERSION 15 | ||
|
||
POSITION . . 410 250 | ||
|
||
DIALOG main, label("dyndoc - Translate Dyndoc format to HTML") 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_hardwrap 15 +25 . ., label("hardwrap - line breaks preserved") | ||
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 dyndoc") | ||
RESET res1 | ||
COPY copy1 | ||
|
||
PROGRAM command | ||
BEGIN | ||
put "dyndoc " | ||
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_hardwrap { | ||
put "hardwarp" | ||
} | ||
if main.cb_nostop { | ||
put "nostop" | ||
} | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
window menu clear | ||
window menu append submenu "stUser" "Documents" | ||
window menu append item "Documents" "Stata Markdown to HTML (&stmd)" "db stmd" | ||
window menu append item "Documents" "Stata Markdown to DYN (stmd2dyn)" "db stmd2dyn" | ||
window menu append separator "Documents" | ||
window menu append item "Documents" "DYN to HTML (dyndoc)" "db dyndoc" | ||
window menu append item "Documents" "DYN to MD (dyntext)" "db dyntext" | ||
window menu append item "Documents" "MD to HTML (markdown)" "db markdown" | ||
window menu refresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
/* | ||
*! stmd dialog version 1.0.0, 24 July 2018, Doug Hemken, [email protected] | ||
*! for stmd version 1.3, 18 June 2018 | ||
|
||
Stata Markdown | ||
-------------- | ||
|
||
stmd filename [ , saving(filename2) replace hardwrap noremove nomsg nostop ] | ||
|
||
To install in User Statistics menu via Stata commands: | ||
|
||
. window menu append submenu "stUser" "Documents" | ||
. window menu append item "Documents" "Stata Markdown to HTML (&stmd)" "db stmd" | ||
|
||
. window menu refresh | ||
|
||
To permanently install, place these commands in your -profile.do- file. | ||
*/ | ||
|
||
VERSION 15 | ||
|
||
POSITION . . 410 250 | ||
|
@@ -28,7 +47,9 @@ BEGIN | |
require main.file_source | ||
put `"""' main.file_source `"""' " " | ||
put ", " | ||
put "saving(" `"""' main.file_target `"""' ") " | ||
if main.file_target.isneq("") { | ||
put "saving(" `"""' main.file_target `"""' ") " | ||
} | ||
if main.cb_replace { | ||
put "replace" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
*! stmd2dyn dialog version 1.0.0, 24 July 2018, Doug Hemken, [email protected] | ||
*! for stmd2dyn version 1.5.9, 3 July 2018 | ||
|
||
Stata Markdown | ||
-------------- | ||
|
||
stmd2dyn filename [ , saving(filename2) replace hardwrap noremove nomsg nostop ] | ||
|
||
To install in User Statistics menu via Stata commands: | ||
|
||
. window menu append submenu "stUser" "Documents" | ||
. window menu append item "Documents" "Stata Markdown to DYN (&stmd2dyn)" "db stmd2dyn" | ||
|
||
. window menu refresh | ||
|
||
To permanently install, place these commands in your -profile.do- file. | ||
*/ | ||
|
||
VERSION 15 | ||
|
||
POSITION . . 410 250 | ||
|
||
DIALOG main, label("stmd2dyn - Translate Stata Markdown to DYN") 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_hardwrap 15 +25 . ., label("hardwrap - line breaks preserved") | ||
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 stmd2dyn") | ||
RESET res1 | ||
COPY copy1 | ||
|
||
PROGRAM command | ||
BEGIN | ||
put "stmd2dyn " | ||
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_hardwrap { | ||
put "hardwarp" | ||
} | ||
if main.cb_nostop { | ||
put "nostop" | ||
} | ||
END |