You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MDtutorials/README.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
This directory contains files used to generate new GSAS-II tutorials. (The older tutorials were created using Microsoft Word to produce `.html` files directly.)
2
2
The tutorials are placed on the web at
3
-
https://advancedphotonsource.github.io/GSAS-II-tutorials/<subdir> using two commands:
3
+
https://advancedphotonsource.github.io/GSAS-II-tutorials/<subdir> using two commands to build the HTML:
sed -i "s/<figure>/<BR clear=all><figure>/g" ${outfile}
7
7
8
-
Note that on MacOS the sed command must be `sed -i "" "s/...`. The tutorial.css file is found in the MDtutorials directory and is copied to the same location as `$outfile`.
8
+
Note that on MacOS the sed command must be `sed -i "" "s/...`. The [`tutorial.css` file](https://github.com/AdvancedPhotonSource/GSAS-II-tutorials/blob/main/MDtutorials/tutorial.css) is found in the `MDtutorials` directory and is copied to the same location as `$outfile`.
9
9
10
10
# Steps in creating a new tutorial
11
11
@@ -14,7 +14,9 @@ Note that on MacOS the sed command must be `sed -i "" "s/...`. The tutorial.css
14
14
15
15
1. Create a new directory in the current location. Make sure not to use a name already in use for an existing tutorial (in the main directory, (https://github.com/AdvancedPhotonSource/GSAS-II-tutorials/tree/main).
16
16
17
-
1. Create a <filename>.md file in the new directory. Name is arbitrary, but repeating the directory name is not a bad idea. Look at file `template.md` as an outline for formatting the tutorial. Start the file with content like this:
17
+
1. Create a <filename>.md file in the new directory. Name is arbitrary, but repeating the directory name is not a bad idea, as `.../new-tutorial/new-tutorial.md`. Look at file `template.md` as an outline for formatting the tutorial ([formatted version is here](https://advancedphotonsource.github.io/GSAS-II-tutorials/tutorial_template/tutorial.html))
18
+
19
+
Start the new tutorial file with content like this:
18
20
19
21
---
20
22
title: "Tutorial: ...anything you want to put here"
@@ -27,14 +29,19 @@ Note that on MacOS the sed command must be `sed -i "" "s/...`. The tutorial.css
27
29
28
30
## Intro
29
31
30
-
omit the "Exercise files..." line if no exercise files are in use. Note that the `.../data/index.html` file is generated automatically.
32
+
omit the "Exercise files..." line if no exercise files are in use. Note that the `.../data/index.html` file is generated automatically.
31
33
32
34
1. Create a directory named `imgs` inside the new directory. Any images used in the tutorial go here.
33
35
34
36
1. (Optional) Create a directory named `data` inside the new directory. Any data files used in the tutorial go here.
35
37
36
38
1. Edit the file `tutorialIndex.py` (in the main GSAS-II repo) to include the new tutorial. Note that the first item in the list will be the directory name chosen in the first step, above. The second item will be the name of the generated `.html` file which will be based on the name of the `.md` file chosen in the second step. The remaining entries are the title of the tutorial and a synopsis.
37
39
40
+
41
+
Editing of MarkDown can be done with any text editor, but it is sometimes nice to see the final result before committing the file. One can use the `pandoc` command above to see the result, or use VS Code, which has a MarkDown viewer. There are also lots of programs that can be used as MarkDown editors: https://github.com/mundimark/awesome-markdown-editors/blob/master/README.md
42
+
but I have not tried any of them.
43
+
44
+
38
45
TODO: someday, I'd like to have keywords associated with tutorials and a search mechanism to make it easier to find some of the "little things" (for example constraint definition) that are shown in them.
0 commit comments