diff --git a/examples/documentation/oxdoc/js/example.js b/examples/documentation/oxdoc/js/example.js index d278054d..b0a2a80c 100644 --- a/examples/documentation/oxdoc/js/example.js +++ b/examples/documentation/oxdoc/js/example.js @@ -410,8 +410,8 @@ My.ExtendedBox = function(options, self) { //@ /* -And finally, this is how everything gets parsed and displayed, in 25 lines of -code. Note that it would be more efficient to parse the source once +And finally, this is how everything gets parsed and displayed, in less than 30 +lines of code. Note that it would be more efficient to parse the source once ``` var doc = Ox.doc(source); ``` @@ -432,7 +432,8 @@ Ox.DocPanel({ expanded: true, items: doc, getModule: function() { return 'My'; }, - path: path + path: path, + stripComments: true }); ``` — but the thing we want to demonstrate here is that we can just pass files to @@ -453,7 +454,8 @@ Ox.load('UI', function() { expanded: true, files: [file], getModule: function() { return 'My'; }, - path: path + path: path, + stripComments: true }); }, tabs: [ diff --git a/source/Ox.UI/js/Code/DocPage.js b/source/Ox.UI/js/Code/DocPage.js index 5d4a77c5..15f286eb 100644 --- a/source/Ox.UI/js/Code/DocPage.js +++ b/source/Ox.UI/js/Code/DocPage.js @@ -7,6 +7,7 @@ Ox.DocPage DocPage options Options object item doc item replace <[[]]|[]> See Ox.SyntaxHighlighter + stripComments If true, strip comments in source code self Shared private variable @*/ Ox.DocPage = function(options, self) { @@ -242,8 +243,9 @@ Ox.DocPage = function(options, self) { $elements.push( Ox.SyntaxHighlighter({ replace: self.options.replace, - showLineNumbers: true, + showLineNumbers: !self.options.stripComments, source: item.source, + stripComments: self.options.stripComments, offset: self.options.item.line }) .addClass(className) diff --git a/source/Ox.UI/js/Code/DocPanel.js b/source/Ox.UI/js/Code/DocPanel.js index 2122f1bd..e07c0056 100644 --- a/source/Ox.UI/js/Code/DocPanel.js +++ b/source/Ox.UI/js/Code/DocPanel.js @@ -26,6 +26,7 @@ Ox.DocPanel Documentation Panel showTests If true, show test results in list showTooltips If true, show test result tooltips in list size Default list size + stripComments If true, strip comments in source code self Shared private variable @*/ @@ -58,6 +59,7 @@ Ox.DocPanel = function(options, self) { showTests: false, showTooltips: false, size: 256, + stripComments: false }) .options(options || {}) .update({ @@ -332,7 +334,8 @@ Ox.DocPanel = function(options, self) { }); self.$page = Ox.DocPage({ item: item, - replace: self.options.replace + replace: self.options.replace, + stripComments: self.options.stripComments }) .bindEvent({ close: function() {