diff --git a/.gitignore b/.gitignore index d72b0eb..b009728 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ scripts/pptx_extract_shapes.py scripts/test.py *.pyc *__pycache__ +includes/header.html +includes/navigation.html +includes/site_structure.html + diff --git a/README.md b/README.md index 8885b74..67fe453 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ In case of working from Windows it is useful setting up a Linux subsystem. 1. Import the powerpoint presentations in ```files/ppt_presentations``` 1. Tranform the presentations in modules. Run the script ```main.py``` to convert powerpoint presentations to markdown files, type ```python scripts/main.py```. The modules will be saved in presentations/modules 1. Apply tags to the modules running the script ```tags.py``` -1. Create lectures combining the modules imported using the scripts ```create_lecture.py``` +1. Create lectures combining the modules imported using the scripts ```create_lecture.py``` +1. Create course pages as a combination of lectures using the script ```create_course.py``` 1. You can preview the website locally at http://127.0.0.1:4000/teaching_kit/ typing ```jekyll serve``` (the first time use ```bundle exec jekyll serve```) ### Upload changes diff --git a/_config.yml b/_config.yml index a355377..c834166 100644 --- a/_config.yml +++ b/_config.yml @@ -43,8 +43,10 @@ exclude: collections: posts: output: false + permalink: /:categories/:title:output_ext + defaults: - scope: path: "" diff --git a/_includes/header.html b/_includes/header.html new file mode 100644 index 0000000..61e00fe --- /dev/null +++ b/_includes/header.html @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/_includes/navigation.html b/_includes/navigation.html new file mode 100644 index 0000000..bc3f645 --- /dev/null +++ b/_includes/navigation.html @@ -0,0 +1,41 @@ + + + + + + + + \ No newline at end of file diff --git a/_includes/site_structure.html b/_includes/site_structure.html new file mode 100644 index 0000000..e69de29 diff --git a/_posts/2020-04-20-Lecture_Clews.html b/_posts/2020-01-01-Lecture_Clews.html similarity index 84% rename from _posts/2020-04-20-Lecture_Clews.html rename to _posts/2020-01-01-Lecture_Clews.html index 59a5add..39a55be 100644 --- a/_posts/2020-04-20-Lecture_Clews.html +++ b/_posts/2020-01-01-Lecture_Clews.html @@ -1,18 +1,22 @@ --- +author: Lorenzo Sani categories: lecture +course: Introduction to CLEWS +date: 2020-04-20 layout: presentation -author: Lorenzo Sani title: Lecture Clews -date: 2020-04-20 --- + #Lecture Clews This is a short lecture focused on CLEWS Author: Lorenzo Sani +This lecture is part of: {{ page.course }} + Date: 2020-04-20 ---- + {% include_relative /modules/2020-01-01-climate.html %} {% include_relative /modules/2020-01-01-energy.html %} {% include_relative /modules/2020-01-01-land.html %} diff --git a/_posts/2020-04-20-Lecture_Water.html b/_posts/2020-01-01-Lecture_Water.html similarity index 80% rename from _posts/2020-04-20-Lecture_Water.html rename to _posts/2020-01-01-Lecture_Water.html index 33c3047..ffe91ad 100644 --- a/_posts/2020-04-20-Lecture_Water.html +++ b/_posts/2020-01-01-Lecture_Water.html @@ -1,18 +1,22 @@ --- +author: Lorenzo Sani categories: lecture +course: Introduction to CLEWS +date: 2020-04-20 layout: presentation -author: Lorenzo Sani title: Lecture Water -date: 2020-04-20 --- + #Lecture Water This is a lecture about water Author: Lorenzo Sani +This lecture is part of: {{ page.course }} + Date: 2020-04-20 ---- + {% include_relative /modules/2020-01-01-water.html %} {% include_relative /modules/2020-01-01-teaching_kit.html %} --- diff --git a/_posts/2020-01-01-Lecture_clews_demo.html b/_posts/2020-01-01-Lecture_clews_demo.html deleted file mode 100644 index b8b558f..0000000 --- a/_posts/2020-01-01-Lecture_clews_demo.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: presentation -author: Lorenzo -title: Lecture_clews_demo -categories: lecture -date: 15/04/20 -excerpt: In this lecture, we introduce the concept of CLEWs - climate, land, energy and water systems ---- - -{% include title_slide.html title=page.title authors=page.author data=page.date %} -{% include_relative modules/2020-01-01-teaching_kit.html %} -{% include_relative modules/2020-01-01-climate.html %} -{% include_relative modules/2020-01-01-land.html %} -{% include_relative modules/2020-01-01-energy.html %} -{% include_relative modules/2020-01-01-water.html %} diff --git a/_posts/2020-04-20-Lecture_demo.html b/_posts/2020-01-01-Lecture_demo.html similarity index 75% rename from _posts/2020-04-20-Lecture_demo.html rename to _posts/2020-01-01-Lecture_demo.html index 462d957..8cbcbfc 100644 --- a/_posts/2020-04-20-Lecture_demo.html +++ b/_posts/2020-01-01-Lecture_demo.html @@ -1,18 +1,23 @@ --- +author: Lorenzo Sani categories: lecture +course: First Demo Course +date: 2020-01-01 layout: presentation -author: Lorenzo Sani title: Lecture demo -date: 2020-04-20 --- + #Lecture demo This lecture contains some demo material extracted from PowerPoint presentations Author: Lorenzo Sani -Date: 2020-04-20 ---- +This lecture is part of: {{ page.course }} + +Date: 2020-01-01 + + {% include_relative /modules/2020-01-01-ppt_demo.html %} {% include_relative /modules/2020-01-01-teaching_kit.html %} --- diff --git a/_posts/2020-04-20-Lecture_demo_2.html b/_posts/2020-01-01-Lecture_demo_2.html similarity index 76% rename from _posts/2020-04-20-Lecture_demo_2.html rename to _posts/2020-01-01-Lecture_demo_2.html index 899db4a..ca6ee8b 100644 --- a/_posts/2020-04-20-Lecture_demo_2.html +++ b/_posts/2020-01-01-Lecture_demo_2.html @@ -1,18 +1,23 @@ --- +author: Lorenzo Sani categories: lecture +course: First Demo Course +date: 2020-01-01 layout: presentation -author: Lorenzo Sani title: Lecture demo 2 -date: 2020-04-20 --- + #Lecture demo 2 This lecture contains other demo material extracted from a PowerPoint presentation Author: Lorenzo Sani -Date: 2020-04-20 ---- +This lecture is part of: {{ page.course }} + +Date: 2020-01-01 + + {% include_relative /modules/2020-01-01-ppt_demo_2.html %} {% include_relative /modules/2020-01-01-teaching_kit.html %} --- diff --git a/_posts/modules/2020-01-01-climate.html b/_posts/modules/2020-01-01-climate.html index 631d424..5bd2fad 100644 --- a/_posts/modules/2020-01-01-climate.html +++ b/_posts/modules/2020-01-01-climate.html @@ -2,7 +2,9 @@ author: Will Usher categories: module exclude: true -tags: climate clews +tags: +- climate +- clews title: What is climate? --- diff --git a/_posts/modules/2020-01-01-energy.html b/_posts/modules/2020-01-01-energy.html index 821b9d3..227e3a9 100644 --- a/_posts/modules/2020-01-01-energy.html +++ b/_posts/modules/2020-01-01-energy.html @@ -2,7 +2,9 @@ author: Will Usher categories: module exclude: true -tags: energy clews +tags: +- energy +- clews title: What is energy? --- diff --git a/_posts/modules/2020-01-01-land.html b/_posts/modules/2020-01-01-land.html index 6a60927..4bad61b 100644 --- a/_posts/modules/2020-01-01-land.html +++ b/_posts/modules/2020-01-01-land.html @@ -2,7 +2,9 @@ author: Will Usher categories: module exclude: true -tags: land clews +tags: +- land +- clews title: What is land? --- diff --git a/_posts/modules/2020-01-01-ppt_demo_2.html b/_posts/modules/2020-01-01-ppt_demo_2.html index 1f1041a..2004e1b 100644 --- a/_posts/modules/2020-01-01-ppt_demo_2.html +++ b/_posts/modules/2020-01-01-ppt_demo_2.html @@ -3,8 +3,9 @@ categories: module exclude: true layout: presentation +tags: +- demo title: ppt_demo_2 -tags: demo --- #Introduction to linear optimisation and OSeMOSYS @@ -207,20 +208,23 @@ --- #Types of modelling tools -***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually +
Draw on macroeconomic relationships and cross-sectoral dependencies.

-***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually +
Provide a more detailed technological representation of the system.

Resource – to –use representation.

-***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually +
@@ -668,7 +672,8 @@

-***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually + --- #OSeMOSYS @@ -777,7 +782,8 @@
--- -#OSeMOSYS Structure – Blocks of functionality +#OSeMOSYS Structure – Blocks of functionality +
@@ -847,7 +853,8 @@
--- -#OSeMOSYS – Key terms +#OSeMOSYS – Key terms +
@@ -1070,7 +1077,8 @@
Hydro and CCGT most competitive

-***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually +
@@ -1111,7 +1119,8 @@
What happens in a climate ‘water scarcity’ scenario?

-***MISSING OBJECT*** insert manually +***MISSING OBJECT*** insert manually +
diff --git a/courses/Course_Demo.md b/courses/First_Demo_Course.md similarity index 86% rename from courses/Course_Demo.md rename to courses/First_Demo_Course.md index 8106a96..fc41186 100644 --- a/courses/Course_Demo.md +++ b/courses/First_Demo_Course.md @@ -2,14 +2,13 @@ categories: course layout: page author: Lorenzo Sani -title: Course Demo +title: First Demo Course --- +

{{ page.title }}

-# Course Demo +Authors: {{page.author}} This course contains the lectures showing our capabilities of transforming PowerPoint presentations to markdown presentations -Author: Lorenzo Sani - 1. [Lecture demo]({{base.url}}/teaching_kit/lecture/Lecture_demo.html) 1. [Lecture demo 2]({{base.url}}/teaching_kit/lecture/Lecture_demo_2.html) diff --git a/courses/Introduction_to_CLEWS.md b/courses/Introduction_to_CLEWS.md index f2ad965..da2d9d4 100644 --- a/courses/Introduction_to_CLEWS.md +++ b/courses/Introduction_to_CLEWS.md @@ -4,12 +4,11 @@ layout: page author: Lorenzo Sani title: Introduction to CLEWS --- +

{{ page.title }}

-# Introduction to CLEWS +Authors: {{page.author}} This course is an introduction to CLEWS -Author: Lorenzo Sani - 1. [Lecture Clews]({{base.url}}/teaching_kit/lecture/Lecture_Clews.html) 1. [Lecture Water]({{base.url}}/teaching_kit/lecture/Lecture_Water.html) diff --git a/scripts/create_course.py b/scripts/create_course.py index b1d2f0c..b437bd7 100644 --- a/scripts/create_course.py +++ b/scripts/create_course.py @@ -8,12 +8,17 @@ course_text=[] course_text.append("---\ncategories: course\nlayout: page\nauthor: "+course_author+"\ntitle: "+course_title+"\n---\n") -course_text.append("\n# "+course_title+"\n\n"+course_description+"\n\nAuthor: "+course_author+"\n\n") +course_text.append("

{{ page.title }}

\n\nAuthors: {{page.author}}\n\n"+course_description+"\n\n") + +#course_text.append("\n# "+course_title+"\n\n"+course_description+"\n\nAuthor: "+course_author+"\n\n") + # Makes a list of all the lectures path = '_posts/' folder = os.fsencode(path) lect_list =[] +lect_list_long = [] + for file in os.listdir(folder): filename = os.fsdecode(file) title, file_extension = os.path.splitext(filename) @@ -22,6 +27,8 @@ if prs['categories'] == 'lecture': b=prs['title'].split('-') lect_list.append(b[-1]) + lect_list_long.append(filename) + else: continue @@ -47,11 +54,38 @@ l = input("choose one lecture: ") if l in lect_list: print("you selected: "+l) - course_text.append("1. ["+l+"]({{base.url}}/teaching_kit/_posts/"+l+".html)\n") + l_url = l.replace(' ','_') + course_text.append("1. ["+l+"]({{base.url}}/teaching_kit/lecture/"+l_url+".html)\n") + + + # obtain full name of lecture + i = lect_list.index(l) + lect_fullname = lect_list_long[i] + # Load lecture and apply new value to "course" + lect=frontmatter.load(path+lect_fullname) + try: + a = lect["course"] + lect["course"]= a +", "+course_title + except: + lect["course"]=course_title + # save lecture + with open(path+lect_fullname,"w") as lecture_file: + lecture_file.writelines(frontmatter.dumps(lect)) + + break else: print("wrong entry") +#course_text.append('\n***Lectures contained in this course:***\n') +#course_text.append('
    \n') +#course_text.append('{% assign lectures = site.posts | where: "categories","lecture" %}\n') +#course_text.append('{% for lecture in lectures %}\n') +#course_text.append('{% if lecture.course contains page.title%}\n') +#course_text.append('

    {{ lecture.title | escape }}

    \n') +#course_text.append('{% endif %}{% endfor %}
') + + course_title_f = course_title.replace(' ','_') with open("courses/"+course_title_f+".md","w") as file: file.writelines(course_text) diff --git a/scripts/create_lecture.py b/scripts/create_lecture.py index 4ad6644..c8cc2a0 100644 --- a/scripts/create_lecture.py +++ b/scripts/create_lecture.py @@ -3,12 +3,15 @@ print("Build a lecture connecting the modules available") lect_title = input("title: ") lect_author = input("author: ") -lect_date = input("date (YYYY-MM-DD): ") +#lect_date = input("date (YYYY-MM-DD): ") +lect_date = '2020-01-01' + lect_description = input("Write a short description: ") lect_text = ['---','\n','categories: lecture','\n','layout: presentation','\n','author: ', lect_author,'\n','title: ',lect_title,'\n','date: ',str(lect_date), '\n---'] # First Slide -lect_text.append("\n#"+lect_title+"\n\n"+lect_description+"\n\nAuthor: "+lect_author+"\n\nDate: "+lect_date+"\n---\n") +lect_text.append("\n#"+lect_title+"\n\n"+lect_description+"\n\nAuthor: "+lect_author+"\n\nThis lecture is part of: {{ page.course }} \n\nDate: "+lect_date+"\n\n") + # Makes a list of all the tags path = '_posts/modules'