diff --git a/community/www/courses/topic.html b/community/www/courses/topic.html index 040b5a1c..0f3280cc 100644 --- a/community/www/courses/topic.html +++ b/community/www/courses/topic.html @@ -1,4 +1,5 @@ {% extends "templates/base.html" %} +{% from "www/macros/livecode.html" import LiveCodeEditor %} {% block title %}{{topic.title}} ({{course.title}}){% endblock %} {% block head_include %} @@ -43,7 +44,7 @@ {% if s.type == "text" %} {{ render_section_text(s) }} {% elif s.type == "code" %} - {{ render_section_code(s) }} + {{ LiveCodeEditor(s.name, s.code) }} {% else %}
Unknown section type: {{s.type}}
{% endif %} @@ -53,28 +54,6 @@ {{ s.contents | markdown }} {% endmacro %} -{% macro render_section_code(s) %} -
-
-
- -

Editor

-
- -
-
-
-

Output

-
-
- Dashed box -

-    
- -
-
-{% endmacro %} - {%- block script %} {{ super() }} diff --git a/community/www/macros/livecode.html b/community/www/macros/livecode.html new file mode 100644 index 00000000..8d6b99d3 --- /dev/null +++ b/community/www/macros/livecode.html @@ -0,0 +1,22 @@ + +{% macro LiveCodeEditor(name, code) %} +
+
+
+ +

Editor

+
+ +
+
+
+

Output

+
+
+ +

+    
+ +
+
+{% endmacro %}