-***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'