New pages on the website are made by creating new markdown files. Jekyll will automatically convert them into HTML pages for you.
Note: in order to publish any files, you will need to be granted permission to do so by one of the project owners.
Navigate to the folder on your computer which contains the website files. If you want to create a new markdown file with Stata examples, make a new .domd
file in the /stata_modules/stata_dyndocuments
directory. If you do not need to run any Stata commands, you can just make a .md
file in the /stata_modules
folder.
Your file must begin with the following lines:
---
title: "My example title"
author: Joe Smith
layout: home
---
You can add any other header information you desire, but you must include the `layout: home** line if you want the page to be formatted correctly.
N.B. Capitalizing the keywords in the header will prevent things from working properly. In other words, DO NOT write Title: My title
.
Write your document with typical markdown syntax. Remember to surround your <<dd_do>>
tags with markdown ‘verbatim’ ticks or tildes (~
). They should look like this:
```stata
<<dd_do>>
sysuse example.dta
<</dd_do>>
```
~~~stata
<<dd_do>>
sysuse example.dta
<</dd_do>>
~~~
.domd
filesOnce you have written the file, use Stata to transform the .domd
file into a markdown file. To do this, run:
dyntext my_input_file.domd, saving(../my_output_file.md)
The ../
part of the saving()
command is really important. This tells Stata to save the output file in the /stata_modules
folder, which will cause Jekyll to automatically update its dropdown menus and table of contents.
cmd
or PowerShell
. You will probably need to install Git
. You can download the program and find lots of instructions here.git
project by using the cd
command.
cd
stands for “Change Directory.” If you are in a folder titled “folder-1” and there is a folder within it called “folder-1-a” you can switch to it by typing cd folder-1-a
. If you need to go “up” a folder level, type cd ..
(two periods).ls
at any point to see what is in the directory/folder you are currently in.git status
to see which files you have changed.git add stata_modules/myfile.md
to add just one file to the staging area, or type git add .
to add all changed files to the staging area.git status
to see which files have been staged.git commit
and hit enter.
When you do this, the text editor Vi
will ask you to type in a message. The first line will be the title, and anything after that will be optional information. To type, press i
or a
to be able to type in text. A message might look like this:
Added a new lesson about macros
Here is an additional note.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# new file: information_for_authors.md
#
When you have finished your message, hit esc
(escape) and then type :wq
to write and quit. Hit enter.
git push origin master
. Enter your GitHub information, and if you have access to the project, your pages will automatically be published!