diff --git a/libs/pipboy/jswrap_font_monofonto_120.c b/libs/pipboy/jswrap_font_monofonto_120.c index 0f301e181..4a9bc10d9 100644 --- a/libs/pipboy/jswrap_font_monofonto_120.c +++ b/libs/pipboy/jswrap_font_monofonto_120.c @@ -16,7 +16,7 @@ #include "jswrap_font_monofonto_120.h" #include "jswrap_graphics.h" - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ // Monofonto (digits and colon only, for clock display) at 2bpp. Nominal height: 145px, cap height: 120px, total height = 120px // Fixed width: 73px diff --git a/libs/pipboy/jswrap_font_monofonto_16.c b/libs/pipboy/jswrap_font_monofonto_16.c index 90ac7dd4e..f8783965b 100644 --- a/libs/pipboy/jswrap_font_monofonto_16.c +++ b/libs/pipboy/jswrap_font_monofonto_16.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_16.h" #include "jswrap_graphics.h" diff --git a/libs/pipboy/jswrap_font_monofonto_18.c b/libs/pipboy/jswrap_font_monofonto_18.c index f926b75df..6996e2697 100644 --- a/libs/pipboy/jswrap_font_monofonto_18.c +++ b/libs/pipboy/jswrap_font_monofonto_18.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_18.h" #include "jswrap_graphics.h" diff --git a/libs/pipboy/jswrap_font_monofonto_23.c b/libs/pipboy/jswrap_font_monofonto_23.c index b65857f28..686e8d889 100644 --- a/libs/pipboy/jswrap_font_monofonto_23.c +++ b/libs/pipboy/jswrap_font_monofonto_23.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_23.h" #include "jswrap_graphics.h" diff --git a/libs/pipboy/jswrap_font_monofonto_28.c b/libs/pipboy/jswrap_font_monofonto_28.c index 8af817cd6..d57783326 100644 --- a/libs/pipboy/jswrap_font_monofonto_28.c +++ b/libs/pipboy/jswrap_font_monofonto_28.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_28.h" #include "jswrap_graphics.h" diff --git a/libs/pipboy/jswrap_font_monofonto_36.c b/libs/pipboy/jswrap_font_monofonto_36.c index bf37c3f8c..4822d2a56 100644 --- a/libs/pipboy/jswrap_font_monofonto_36.c +++ b/libs/pipboy/jswrap_font_monofonto_36.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_36.h" #include "jswrap_graphics.h" diff --git a/libs/pipboy/jswrap_font_monofonto_96.c b/libs/pipboy/jswrap_font_monofonto_96.c index 1eabf1032..1d51704ae 100644 --- a/libs/pipboy/jswrap_font_monofonto_96.c +++ b/libs/pipboy/jswrap_font_monofonto_96.c @@ -13,7 +13,7 @@ * Contains Custom Fonts * ---------------------------------------------------------------------------- */ - +/* DO_NOT_INCLUDE_IN_DOCS - this is a special token for common.py */ #include "jswrap_font_monofonto_96.h" #include "jswrap_graphics.h" diff --git a/scripts/common.js b/scripts/common.js index b948cfdc1..c8e51ccbd 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -29,7 +29,7 @@ Builtin.prototype.getURL = function() { anchor = this.class; else if ("class" in this) anchor = "l_"+this.class+"_"+this.name; - else + else anchor = "l__global_"+this.name; return "http://www.espruino.com/Reference#"+anchor; }; @@ -44,12 +44,12 @@ function getBasicTernType(t) { } /// Get full Tern type - for tern.js json format -Builtin.prototype.getTernType = function() { +Builtin.prototype.getTernType = function() { if (["class","library"].indexOf(this.type)>=0) { return "fn()"; } else if (["function","method","staticmethod","constructor"].indexOf(this.type)>=0) { // it's a function - var args = []; + var args = []; if ("params" in this) args = this.params.map(function (p) { if (p[0]=="pin" && p[1]=="JsVar") @@ -59,8 +59,8 @@ Builtin.prototype.getTernType = function() { var ret = ""; if ("return_object" in this) ret = " -> +"+this.return_object - else if ("return" in this) - ret = " -> "+getBasicTernType(this.return[0]); + else if ("return" in this) + ret = " -> "+getBasicTernType(this.return[0]); return "fn("+args.join("\, ")+")"+ret; } else { return getBasicTernType(this.return[0]); @@ -78,6 +78,9 @@ exports.getWrapperFiles = function (callback) { /// Extract the /*JSON ... */ comments from a file and parse them exports.readWrapperFile = function(filename) { var contents = fs.readFileSync(filename).toString(); + if (contents.includes("DO_NOT_INCLUDE_IN_DOCS")) { + return [[],[]]; // don't include jswrap files with the no-docs marker in them + } var builtins = []; var types = []; var comments = contents.match( /\/\*JSON(?:(?!\*\/).|[\n\r])*\*\//g );