-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotemplate.sthlp
244 lines (182 loc) · 8.29 KB
/
dotemplate.sthlp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{smcl}
{* *! version 1.0 18 Dec 2013}{...}
{vieweralsosee "" "--"}{...}
{viewerjumpto "Syntax" "dotemplate##syntax"}{...}
{viewerjumpto "Description" "dotemplate##description"}{...}
{viewerjumpto "Options" "dotemplate##options"}{...}
{viewerjumpto "Remarks" "dotemplate##remarks"}{...}
{viewerjumpto "Examples" "dotemplate##examples"}{...}
{hline}
help for {cmd:dotemplate}{right:R.Andrés Castañeda}
{hline}
{phang}
{bf:dotemplate} {hline 2} Creates an organized template for do-files
{marker syntax}{...}
{title:Syntax}
{phang}
Using dialog box
{p 8 17 2}{cmdab:dotemplate}{p_end}
{phang}
Using Stata regular syntax
{p 8 17 2}
{cmdab:dotemplate}
{cmd:,} {it:file(string)} [
{it:options}]
{phang}
{err:Note}: I highly recommend using the dialog box syntax rather than the regular
Stata syntax. Just type {cmd:dotemplate} in Stata and fill up the fields. The only
mandatory options if {it:file(string)} to provide the name of the file.
{marker sections}{...}
{title:Sections}
{pstd}
Help is presented under the following headings:
{help dotemplate##description:Description}
{help dotemplate##options:Options}
{help dotemplate##examples:Examples}
{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:main}
{synopt:{opt pro:ject(string)}}objective of the do-file{p_end}
{synopt:{opt f:ile(string)}}name of the do-file{p_end}
{synopt:{opt aut:hor(string)}}author name{p_end}
{synopt:{opt p:ath(string)}}directory path where do-file will be placed{p_end}
{synopt:{opt ty:pe(string)}}type of template. {it:basic} or {it:complete}{p_end}
{synopt:{opt dep:end(string)}}institutions/s working for in the project{p_end}
{synopt:{opt out:put(string)}}list of files produced with the do-file{p_end}
{synopt:{opt sec:tions(#)}}number of sections in do-file.default is 3.{p_end}
{synopt:{opt step:s(#)}}number of steps with sections.{p_end}
{synopt:{opt log}}produced log file with the same name as the do-file{p_end}
{synopt:{opt replace}}replace{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{marker description}{...}
{title:Description}
{pstd}
{cmd:dotemplate} Creates template for do-files. Two different type of template are provided.
{cmd:dotemplate} is useful for being organized as programmer and standardize do-files among a
team or group of programmers. If any of the options above is not specified, {cmd:dotemplate}
will request for them. The user could press {it:Enter} from the keyboard if no information
is desired to be prompted, or type in the Stata commands window the specific information.
{marker options}{...}
{title:Options}
{dlgtab:Main}
{phang}
{opt pro:ject(string)} Name of the project or objective of the do-files
{phang}
{opt aut:hor(string)} Name of author. Default is the name stored in macro c(username)
{phang}
{opt f:ile(string)} Name of do-file to create
{phang}
{opt p:ath(string)} Directory path in which the do-file template will be created. Default is current
directory
{phang}
{opt ty:pe(string)} Select between basic or complete type of template. default is complete
{phang}
{opt dep:end(string)} Dependencies for which the project of the do-file is done.. if any.
{phang}
{opt out:put(string)} Expected output from the do-file
{phang}
{opt sec:tions(#)} Estimated number of sections that do-file will have. If the number of sections is
greater or smaller than expected the user just have to add or erase as she needs. Default value is 3
{phang}
{opt steps(#)} Estimated number of steps or sub-sections in each sections. This option might be seldom
used but in some cases it will be useful in case the user needs a guide to organize her do-files.
{phang}
{opt log} In case user likes to work with log-file, {cmd:dotemplate} will create above the header and
just before the end the corresponding lines to create the log file. The name of the log-file will be
the same than the name of the do-file in text format.
{col 30}{help dotemplate##sections:Back to Sections}
{marker examples}{...}
{title:Examples}
{dlgtab:Basic}
{phang}
Create a basic template with only one sections and no specification of log-file. {help dotemplate##basic:Example}
{col 5}{cmd:dotemplate}, project("Program to create Templates for do-file") ///
{col 10}file(detemplate) ///
{col 10}author(Andres Castaneda) ///
{col 10}path("C:\data\personal") ///
{col 10}type(basic)
{dlgtab:complete}
{phang}
Create a complete template for do-file with four sections and 3 sub-sections. Lines for log-file are
specified. type(complete) is not necessary since it is the default option. {help dotemplate##complete:Example}
{col 5}{cmd:dotemplate}, project("Program to create Templates for do-file") ///
{col 10}file(detemplate) ///
{col 10}author(Andres Castaneda) ///
{col 10}path("C:\data\personal") ///
{col 10}depend(The World Bank-LCSPP) ///
{col 10}output(dotemplate.ado) ///
{col 10}sections(2) ///
{col 10}steps(2) ///
{col 10}log
{title:Author}
{p 6 6 4}{cmd:R.Andrés Castañeda}{p_end}
{p 6 6 4}Development Economics, Data Group |
{browse "http://iresearch.worldbank.org/PovcalNet/home.aspx":PovcalNet Team}{p_end}
{p 6 6 4}The World Bank|1818 H St. N.W., Washington, D.C. 20433{p_end}
{p 6 6 4}Email: {browse "acastanedaa@worldbank.org": acastanedaa@worldbank.org}{p_end}
{p 6 6 4}GitHub:{browse "https://github.com/randrescastaneda": randrescastaneda }{p_end}
{p 6 6 4}Website:{browse "https://randrescastaneda.rbind.io/": randrescastaneda.rbind.io }{p_end}
{title:Source}
{phang}
you may find the source code in the Github repository
{browse "https://github.com/randrescastaneda/dotemplate":/randrescastaneda/dotemplate }
{hline}
{marker basic}{...}
{title:Example of basic template}
/*===========================================================================
project: Program to create Templates for do-file
Author: Andres Castaneda
Program Name: detemplate.do
---------------------------------------------------------------------------
Creation Date: December 20, 2013
===========================================================================*/
/*=========================================================================
0: Program Setup
===========================================================================*/
exit
------------------------------------------------------------------
{col 30}{help dotemplate##sections:Back to Sections}
{marker complete}{...}
{title:Example of complete template}
capture log close
log using "C:\data\personal/detemplate.txt", replace text
/*===========================================================================
project: Program to create Templates for do-file
Author: Andres Castaneda
Program Name: detemplate.do
Dependencies: The World Bank-LCSPP
---------------------------------------------------------------------------
Creation Date: December 20, 2013
Modification Date:
version:
References:
Output: dotemplate.ado
===========================================================================*/
/*=========================================================================
0: Program Setup
===========================================================================*/
* Program Setup
version 12.1
drop _all
/*=========================================================================
1: <Describe>
===========================================================================*/
*------------------------ 1.1: <Describe> ----------------------------------
*------------------------ 1.2: <Describe> ----------------------------------
/*=========================================================================
2: <Describe>
===========================================================================*/
*------------------------ 2.1: <Describe> ----------------------------------
*------------------------ 2.2: <Describe> ----------------------------------
log close
exit
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
Notes:
1.
2.
3.
Version Control:
{col 30}{help dotemplate##sections:Back to Sections}