2016-02-23 13:34:40 +00:00
|
|
|
/// <reference path="./typings/main.d.ts" />
|
2016-01-30 05:19:44 +00:00
|
|
|
|
2016-02-23 14:40:18 +00:00
|
|
|
import plugins = require("./beautylog.plugins");
|
2016-02-23 13:34:40 +00:00
|
|
|
var codeFunction = function(codeString,options?){
|
|
|
|
var codeSnippet = {
|
|
|
|
source:codeString,
|
|
|
|
highlighted:"default"
|
|
|
|
};
|
|
|
|
if (typeof codeString != "string"){
|
|
|
|
console.log("beautylog.code() expects a string as first argument!");
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
if (typeof options != "undefined"){
|
2016-02-23 14:40:18 +00:00
|
|
|
codeSnippet.highlighted = plugins.hlight(codeSnippet.source,options.language);
|
2016-02-23 13:34:40 +00:00
|
|
|
//console.log(codeSnippet.highlighted)
|
2016-01-30 05:19:44 +00:00
|
|
|
}
|
2016-02-23 13:34:40 +00:00
|
|
|
};
|
|
|
|
export = codeFunction;
|