diff --git a/lib/generate/template.js b/lib/generate/template.js index 27fdde77d..808217a64 100644 --- a/lib/generate/template.js +++ b/lib/generate/template.js @@ -9,6 +9,7 @@ var fs = require('./fs'); // return a templeter for page var initTemplate = function(options) { var tpl = swig.compileFile(path.resolve(__dirname, '../../templates/page.html')); + var nExercise = 1; options = _.defaults(options || {}, { // Base folder for input @@ -33,19 +34,7 @@ var initTemplate = function(options) { // Parse sections .then(function(markdown) { - return parse.page(markdown) - .concat([ - { - id: 1, - type: "exercise", - content: "test", - codes: { - base: "var a = 1;", - solution: "var a = 1; var b = 1;", - validation: "assert(a == b);" - } - } - ]); + return parse.page(markdown); }) //Calcul template diff --git a/templates/includes/book/exercise.html b/templates/includes/book/exercise.html index b94e39e9e..8b1fd1f6f 100644 --- a/templates/includes/book/exercise.html +++ b/templates/includes/book/exercise.html @@ -1,37 +1,24 @@
{{ section.codes.solution }}
-{{ section.codes.validation }}
+{{ section.code.solution }}
+{{ section.code.validation }}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/templates/page.html b/templates/page.html
index 3c2eb89a0..d7a23ac04 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -22,4 +22,30 @@
+
+
{% endblock %}
\ No newline at end of file