*! version 2.0.1

Title

mkproject, create -- Create new templates for the mkproject command.

Description

To create a new template you are going to create a text file telling
mkproject what actions it should take, and then type in Stata
mkproject, create(that_text_file). Based on that text file
mkproject will create the template, and the corresponding help file.

This template is going to be used at three times when mkproject makes a
project folder:

First, mkproject creates the project folder, and any sub-folders specified
in the template. It changes the current working directory to the project folder.

Second, mkproject creates any files specified in the template, using
boilerplate.

Third, mkproject executes any commands specified in the template.

So a template should tell mkproject what subdirectories it needs to create,
what files it needs to create, and what commands it needs to execute. On top of
that you can add various meta-data in the header.

Lets look at an example. Below is the template for course.
You can look at the source code for any template by typing mkproject, query,
click on any template you are interested in, that opens a help-file, and at the
bottom there is a link that will show the source code for that template in the
viewer.

--------------- begin template -------------------
<header>
<mkproject> project
<version> 2.0.0
<label> Small research project as part of a course
<reqs> dirtree
<description>
{pstd}
This template is for a small research project that takes place over a
short period of time that does not require snapshots. A typical example
would be a project someone has to do for a course.
</description>
</header>

<dir> docu
<dir> data
<dir> ana
<dir> txt

<file> rlogc docu/research_log.md
<file> main ana/<abbrev>_main.do
<file> dta_c ana/<abbrev>_dta01.do
<file> ana ana/<abbrev>_ana01.do

<cmd> dirtree
-------------- end template --------------------

Lines between <header> and </header> contain
meta-information, like the label for that template.

Lines starting with <dir> tell you what sub-directories that template will
create

Lines starting with <file> have two elements, the first "word" is the name
of the template that boilerplate will use to create a file, and the second
"word" is the filename. This filename can contain the tag <abbrev> which
mkproject will replace with the proj_abbrev you will specify when using
mkproject to create a project folder.

Lines starting with <cmd> tell you what commands mkproject will run
after creating those directories and files

Within the header you can add five types of meta data:

<mkproject> Indicates that this is a template, and the word after it can
be either project or boilerplate, to indicate whether this is a
mkproject or boilerplate template. You can specify it in your text
file or if you don't specify it, mkproject, create() will add it for you.

<version> Indicates which version of mkproject is used to create this
template. mkproject uses that information to ensure backwards compatability;
if a new version of mkproject becomes available, you can install that
without fearing that it will break your older templates. You can specify it
yourself, or if you don't specify it, mkproject, create() will set it to
the current version of mkproject

<label> gives the short description of your template, that will be shown
with mkproject, query

<reqs> specifies a community contributed package that is required for this
template. If any of the boilerplate templates used in the <file>
tag have a requirement, then that will be automatically copied here by
mkproject, create().

The lines between <description> and </description> give a longer
description of the template as it will appear in the help-fearing. It may contain
smcl tags.

In practice, the easiest way to create a new template is usually to look for a
template that is close to what you want, and copy and adapt the source of that
template.