Skip to content

Commit 0c39352

Browse files
committed
add build guide; build tutorial index after MDtutorials build
1 parent 2d4158f commit 0c39352

File tree

2 files changed

+95
-10
lines changed

2 files changed

+95
-10
lines changed

.github/workflows/builddocsite.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,14 @@ jobs:
3737
run: |
3838
curl -L https://github.com/AdvancedPhotonSource/GSAS-II/raw/master/GSASII/tutorialIndex.py -o scripts/tutorialIndex.py
3939
40-
- name: build tutorials index
41-
run: |
42-
cd scripts
43-
python makeGitTutorial.py ..
44-
45-
- name: Push changes
46-
uses: ad-m/github-push-action@master
47-
4840
- name: convert tutorials
4941
run: |
5042
cd MDtutorials
5143
for path in ./*; do
5244
[ -d "${path}" ] || continue # skip if not a directory
5345
dirname="$(basename "${path}")"
5446
dest="../${dirname}"
55-
mkdir ${dest}
47+
mkdir -pv ${dest}
5648
[ ! -d "${path}/data" ] || cp -r "${path}/data" ${dest}/
5749
[ ! -d "${path}/imgs" ] || cp -r "${path}/imgs" ${dest}/
5850
cp tutorial.css ${dest}
@@ -64,6 +56,14 @@ jobs:
6456
done
6557
done
6658
59+
- name: build tutorials index
60+
run: |
61+
cd scripts
62+
python makeGitTutorial.py ..
63+
64+
# - name: Push changes
65+
# uses: ad-m/github-push-action@master
66+
6767
- name: Sphinx build
6868
run: |
6969
sphinx-build webdocs . # place output into root dir
@@ -78,7 +78,7 @@ jobs:
7878
mv _gsas2/GSASII/help ./help
7979
- name: Get rid of the rest of the GSAS-II files & other stuff not needed on web
8080
run: |
81-
rm -rf _gsas2 webdocs scripts
81+
rm -rf _gsas2 webdocs scripts MDtutorials
8282
8383
- name: Upload artifact # creates zip file with website contents
8484
uses: actions/upload-pages-artifact@v3

MDtutorials/TutorialGuide.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
=====================
2+
Quick notes on writing a tutorial
3+
=====================
4+
5+
New tutorials should be prepared in Markdown rather than HTML if possible.
6+
7+
* Create a new directory in MDtutorials (./MDtutorials/<newtutorial>) for the
8+
tutorial (or combine into an existing directory),
9+
10+
* Create file for the tutoral as ./MDtutorials/<newtutorial>/<tutorialfile>.md
11+
<newtutorial> and <tutorialfile> will commonly be the same, but need not be so.
12+
13+
The final tutorial will be placed in
14+
https://advancedphotonsource.github.io/GSAS-II-tutorials/<newtutorial>/<tutorialfile>.html
15+
16+
* Images for the tutorial should be placed in subdirectory imgs, ./MDtutorials/<newtutorial>/imgs
17+
18+
* data files needed for the tutorial should be placed in subdirectory ./MDtutorials/<newtutorial>/data
19+
20+
21+
The tutorial .md file should start with:
22+
23+
---
24+
title: "Tutorial: Changing the GSAS-II Font Size"
25+
---
26+
<!--- Don't change the HTML version of this file; edit the .md version -->
27+
28+
* Sections should be labeled with
29+
30+
## Intro
31+
32+
and, subsections with
33+
34+
### Subsection title
35+
36+
Sections and subsections will be numbered; subsubsections (etc.) will not be numbered.
37+
Place a blank line before and after the section label
38+
39+
40+
* For links, use: [displayed text](http://url)
41+
42+
* For figures, which will be sized at 400px max and will be placed at the right margin, use:
43+
44+
![caption text](imgs/<filename>.png)
45+
46+
Place a blank line before and after the figure
47+
48+
49+
* If needed, where a figure will be sized and placed manually, use HTML directly:
50+
51+
<img src="./imgs/nuc_struct.png" alt="nuclear structure" style="width:500px;">
52+
53+
54+
* Equations can be specified with MathJax:
55+
56+
Er${}_2$Ge${}_2$O${}_7$
57+
P$4_1 2_1 2$
58+
59+
* Tables can be created using pipe characters
60+
61+
| `FontSize_incr` | Example |
62+
| :---: | ------------------------------------- |
63+
| 0 | ![Example of GSAS-II GUI with the default font size (font=0)](imgs/font0.png) |
64+
| 3 | ![Example of GSAS-II GUI with the font increased by 3 units (font=3)](imgs/font3.png) |
65+
66+
See markdown docs for other mechanisms to create tables
67+
68+
* To provide a link to a location within the tutorial, define an anchor at the location to be referenced
69+
70+
<a name=myanchor></a>
71+
72+
then the link to to this will be
73+
74+
here is some text [with a link](#myanchor) provided
75+
76+
77+
* End the document with a table with the date and author(s):
78+
79+
----
80+
| |
81+
| ---: |
82+
| Brian Toby |
83+
| January 10, 2025 |
84+
85+
* When the tutorial is complete, update GSASII/tutorialIndex.py to include the new tutorial

0 commit comments

Comments
 (0)