ingenta-lens
Version:
A novel way of seeing content.
58 lines (43 loc) • 1.08 kB
JavaScript
;
var Text = require("../text").Model;
var Codeblock = function(node, document) {
Text.call(this, node, document);
};
// Type definition
// --------
Codeblock.type = {
"id": "codeblock",
"parent": "content",
"properties": {
"source_id": "string",
"content": "string"
}
};
Codeblock.config = {
"zoomable": true
};
// This is used for the auto-generated docs
// -----------------
//
Codeblock.description = {
"name": "Codeblock",
"remarks": [
"Text in a codeblock is displayed in a fixed-width font, and it preserves both spaces and line breaks"
],
"properties": {
"content": "Content",
}
};
// Example Formula
// -----------------
//
Codeblock.example = {
"type": "codeblock",
"id": "codeblock_1",
"content": "var text = \"Sun\";\nvar op1 = null;\ntext = op2.apply(op1.apply(text));\nconsole.log(text);",
};
Codeblock.Prototype = function() {};
Codeblock.Prototype.prototype = Text.prototype;
Codeblock.prototype = new Codeblock.Prototype();
Codeblock.prototype.constructor = Codeblock;
module.exports = Codeblock;