Knowledge Base - Sault College

Mental Health and Addictions Certificate

OEL1235 - Addictions and Mental Health

Convert Slides to html

1. Create directory structure in Dropbox/tmp/.

cd Dropbox/tmp/00__sault_college/oel1235__addictions_and_mental_health/ week=week09 mkdir -pv $week/quick_links $week/text~{0..1} cp -v commands.sed $week/ && cp -v mkphpfiles.sh $week/

2. In Impress, export slide presentation to html.

3. a) Go to Dropbox Sault College folder for Addictions and Mental Health.

cd Dropbox/00__personal/00__education/00__sault_college/addictions_and_mental_health_studies_certificate/courses/addictions_and_mental_health/

3. b) Go to folder for the week in question.

3. c) Delete unnecessary files.

rm -v img* && rm -v thumb*

3. d) Copy html files to Dropbox tmp folder (text~0/).

mv -v *html /home/dave/Dropbox/tmp/00__sault_college/oel1235__addictions_and_mental_health/$week/text~0/

4. a) Go to tmp folder.

cd /home/dave/Dropbox/tmp/00__sault_college/oel1235__addictions_and_mental_health/$week/

4. b) Back-up html files in $week/text~0/ to $week/text~1/.

cp -v text~0/* text~1/

4. c) Update week and end range number in mkphpfiles.sh and then run it to 'sanitize' html files in text~1/:

./mkphpfiles.sh

4. d) Concatenate 'sanitized' html files in $week/text~1/ (make sure to update/set correct end range number).

cat text{0..22}.html > $week.html

4. e) add contents of text~1/$week.html to $week.php on Digital Ocean Droplet

Quick Links

1. Copy section_1_lecture_4.html file from text~0 to quick_links folder, renaming it links~0.html.

2. Delete anything that isn't a table of content link.

3. 'Sanitize' the links.

sed 's/<div.*html">\(.*\)<\/a><\/div>/<a href="#slide">Slide<\/a> \1<br>/' links~0.html > links.html

4. Number the links (make sure to update/set correct end range number).

for i in {1..23}; do sed -n "$i s/slide\">Slide/slide$i\">Slide $i/ p" links.html; done

5. Copy output from above into $week.php on Digital Ocean Droplet

6. Replace #slide with mhac/html/oel1235/week08.php#slide (make sure to update/set correct week number).

NULL