gitbook-plugin-jazer
Advanced tools
| .question{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -5,0 +4,0 @@ //width: 300px; |
| .question{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -28,3 +27,3 @@ //width: 300px; | ||
| border-radius: 3px; | ||
| width: 80%; | ||
| width: 90%; | ||
| height: 100px; | ||
@@ -46,3 +45,3 @@ } | ||
| background-color: rgb(19, 143, 72); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -55,3 +54,3 @@ border:none; | ||
| background-color: rgb(16, 115, 147); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -64,3 +63,3 @@ border:none; | ||
| background-color: rgb(47, 161, 96); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -72,3 +71,3 @@ } | ||
| background-color: rgb(34, 138, 172); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -80,3 +79,3 @@ } | ||
| background-color: rgb(14, 108, 54); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -88,3 +87,3 @@ } | ||
| background-color: rgb(9, 91, 117); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -91,0 +90,0 @@ } |
@@ -6,3 +6,3 @@ <div class="question" style="<% if (config.width){ print("width: "+ config.width +";"); }%> <% if (config.height){ print("height: "+ config.height +";"); }%> <% if (config.color){ print("border: medium solid "+ config.color +";"); }%>"> | ||
| </div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" data-language="<%= codes.language %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%>><%= codes.editor %></div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" data-language="<%= codes.language %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%>style="<% if (config.editorHeight){ print("height: "+ config.editorHeight +";"); }%> <% if (config.editorAutoHeight === "true" && !config.editorHeight){ print("height: "+ codes.solution.split(/\r\n|\r|\n/).length * 20 +"px;"); }%>"><%= codes.editor %></div> | ||
| <div class= "correct"> Correct </div> | ||
@@ -9,0 +9,0 @@ <div class= "fail" >Match Failed</div> |
| .questionjs{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -5,0 +4,0 @@ //width: 300px; |
| .questionjs{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -28,3 +27,3 @@ //width: 300px; | ||
| border-radius: 3px; | ||
| width: 80%; | ||
| width: 90%; | ||
| height: 100px; | ||
@@ -46,3 +45,3 @@ } | ||
| background-color: rgb(19, 143, 72); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -55,3 +54,3 @@ border:none; | ||
| background-color: rgb(16, 115, 147); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -64,3 +63,3 @@ border:none; | ||
| background-color: rgb(47, 161, 96); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -72,3 +71,3 @@ } | ||
| background-color: rgb(34, 138, 172); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -80,3 +79,3 @@ } | ||
| background-color: rgb(14, 108, 54); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -88,3 +87,3 @@ } | ||
| background-color: rgb(9, 91, 117); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -91,0 +90,0 @@ } |
@@ -6,3 +6,3 @@ <div class="questionjs" style="<% if (config.width){ print("width: "+ config.width +";"); }%> <% if (config.height){ print("height: "+ config.height +";"); }%> <% if (config.color){ print("border: medium solid "+ config.color +";"); }%>"> | ||
| </div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%>><%= codes.editor %></div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%> style="<% if (config.editorHeight){ print("height: "+ config.editorHeight +";"); }%> <% if (config.editorAutoHeight === "true" && !config.editorHeight){ print("height: "+ codes.solution.split(/\r\n|\r|\n/).length * 20 +"px;"); }%>"><%= codes.editor %></div> | ||
| <div class= "correct"> Correct </div> | ||
@@ -9,0 +9,0 @@ <div class= "fail" >Match Failed</div> |
| .regexp{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -5,0 +4,0 @@ //width: 300px; |
| .regexp{ | ||
| margin:20px; | ||
| border: medium solid rgb(223, 64, 4); | ||
@@ -28,4 +27,4 @@ //width: 300px; | ||
| border-radius: 3px; | ||
| width: 80%; | ||
| height: 100px; | ||
| width: 90%; | ||
| height: 200px; | ||
| } | ||
@@ -46,3 +45,3 @@ | ||
| background-color: rgb(19, 143, 72); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -55,3 +54,3 @@ border:none; | ||
| background-color: rgb(16, 115, 147); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -64,3 +63,3 @@ border:none; | ||
| background-color: rgb(47, 161, 96); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -72,3 +71,3 @@ } | ||
| background-color: rgb(34, 138, 172); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -80,3 +79,3 @@ } | ||
| background-color: rgb(14, 108, 54); | ||
| width:30%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -88,3 +87,3 @@ } | ||
| background-color: rgb(9, 91, 117); | ||
| width:50%; | ||
| width: 40%; | ||
| color:white; | ||
@@ -91,0 +90,0 @@ } |
@@ -6,3 +6,3 @@ <div class="regexp" style="<% if (config.width){ print("width: "+ config.width +";"); }%> <% if (config.height){ print("height: "+ config.height +";"); }%> <% if (config.color){ print("border: medium solid "+ config.color +";"); }%>"> | ||
| </div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%>><%= codes.editor %></div> | ||
| <div class ="editor" data-solution="<%= codes.solution %>" data-validation="<%= codes.validation %>" <% if (config.gutter !== undefined){ print("data-gutter='"+ config.gutter.trim() +"'"); }%>style="<% if (config.editorHeight){ print("height: "+ config.editorHeight +";"); }%> <% if (config.editorAutoHeight === "true" && !config.editorHeight){ print("height: "+ codes.solution.split(/\r\n|\r|\n/).length * 20 +"px;"); }%>"><%= codes.editor %></div> | ||
| <div class= "correct"> Correct </div> | ||
@@ -9,0 +9,0 @@ <div class= "fail" >Match Failed</div> |
+26
-6
| var _ = require('lodash'); | ||
| var fs = require("fs"); | ||
| var path = require("path"); | ||
| var marked = require("marked"); | ||
@@ -66,6 +67,12 @@ var REGEXP_WEBSITE_TEMPLATE = _.template(fs.readFileSync(path.resolve(__dirname, "./assets/regexp/regexp_website.html"))); | ||
| if(blk.kwargs.editorAutoHeight === "true"){ | ||
| config.editorHeight = null; | ||
| } | ||
| _.assignIn(config, blk.kwargs); | ||
| _.each(blk.blocks, function(_blk) { | ||
| codes[_blk.name] = _blk.body.trim(); | ||
| codes[_blk.name] = _blk.body.trim().replace(/"/g, """); | ||
| }); | ||
@@ -77,3 +84,3 @@ | ||
| return tpl({ | ||
| message: blk.body, | ||
| message: marked(blk.body), | ||
| codes: codes, | ||
@@ -97,6 +104,12 @@ config: config | ||
| if(blk.kwargs.editorAutoHeight === "true"){ | ||
| config.editorHeight = null; | ||
| } | ||
| _.assignIn(config, blk.kwargs); | ||
| _.each(blk.blocks, function(_blk) { | ||
| codes[_blk.name] = _blk.body.trim(); | ||
| codes[_blk.name] = _blk.body.trim().replace(/"/g, """); | ||
| }); | ||
@@ -108,3 +121,3 @@ | ||
| return tpl({ | ||
| message: blk.body, | ||
| message: marked(blk.body), | ||
| codes: codes, | ||
@@ -130,6 +143,13 @@ config: config | ||
| if(blk.kwargs.editorAutoHeight === "true"){ | ||
| config.editorHeight = null; | ||
| } | ||
| _.assignIn(config, blk.kwargs); | ||
| _.each(blk.blocks, function(_blk) { | ||
| codes[_blk.name] = _blk.body.trim(); | ||
| codes[_blk.name] = _blk.body.trim().replace(/"/g, """); | ||
| }); | ||
@@ -141,3 +161,3 @@ | ||
| return tpl({ | ||
| message: blk.body, | ||
| message: marked(blk.body), | ||
| codes: codes, | ||
@@ -144,0 +164,0 @@ config: config |
+1
-1
| { | ||
| "name": "gitbook-plugin-jazer", | ||
| "version": "1.0.47", | ||
| "version": "1.0.48", | ||
| "description": "Gitbook exercises validated through a XRegExp and Javascript (work in progress)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+38
-4
@@ -80,5 +80,33 @@ # Gitbook-Plugin-Jazer - REGEXP | ||
| ## Exercises accept markdown. | ||
| ```javascript | ||
| {% regexp width="100%", height="10%", color="#0b3136" , gutter="true", editorAutoHeight="true" %} | ||
| Escriba en la ventana de edición el código de las pruebas con chai, | ||
| incluyendo las partes que faltan en esta sugerencia. | ||
| ### Javascript | ||
| | Tables | Are | Cool | | ||
| | ------------- |:-------------:| -----:| | ||
| | col 3 is | right-aligned | $1600 | | ||
| | col 2 is | centered | $12 | | ||
| | zebra stripes | are neat | $1 | | ||
| {% editor %} | ||
| something | ||
| {% solution %} | ||
| something | ||
| {% validation %} | ||
| / | ||
| something | ||
| /ix | ||
| {% endregexp %} | ||
| ``` | ||
| ## Parameters | ||
| For each exercise you can specify four parameters: `width`, `height`, `color` and `gutter` | ||
| For each exercise you can specify six parameters: `width`, `height`, `color`, `gutter`, `editorHeight` , `editorAutoHeight` | ||
@@ -92,4 +120,6 @@ ``` | ||
| * `gutter` must be `true` or `false` (whether to show or not the `gutter`). | ||
| * `editorHeight` must be on pixels ("200px"). | ||
| * `editorAutoHeight` "true" or "false" and let the plugin or not calculate the editor height based on solution length. | ||
| You can specify the same parameters globally for all exercises with the book.json file | ||
| You can specify the same parameters globally for all exercises with the book.json file. | ||
@@ -107,3 +137,5 @@ ``` | ||
| "gutter": "false" | ||
| "support": ["https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js","https://ajax.googleapis.com/ajax/libs/mootools/1.6.0/mootools.min.js"] | ||
| "support": ["https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js","https://ajax.googleapis.com/ajax/libs/mootools/1.6.0/mootools.min.js"], | ||
| "editorHeight": "100px" //or editorAutoHeight: "true" | ||
| } | ||
@@ -116,7 +148,9 @@ } | ||
| Book.json has a fifth parameters and allow you to load support librarys for questionjs blocks | ||
| Book.json has one additional parameter and allow you to load support librarys for questionjs blocks with `support` and passing an array of cdn´s. | ||
| Block parameters has priority over book.json parameters. | ||
| If `editorHeight` is specified then has priority over `editorAutoHeight`, but `editorAutoHeight` specified on block still having priority over `editorHeight` book.json parameter. | ||
| ## Errors | ||
@@ -123,0 +157,0 @@ |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
7139290
0.03%7090
0.06%181
23.13%