From c2f2587a79aeb77aad66f081cf924a79348a698e Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 19 Jan 2011 15:42:11 -0800 Subject: fixed example rendering, add tests for it. --- docs/src/gen-docs.js | 2 +- docs/src/ngdoc.js | 5 +++-- docs/src/reader.js | 2 +- docs/src/templates/doc_widgets.css | 2 +- docs/src/templates/doc_widgets.js | 16 ++++++++-------- docs/src/templates/docs-scenario.html | 2 +- docs/src/templates/docs.js | 8 ++++---- docs/src/templates/syntaxhighlighter/shBrushJScript.js | 6 +++--- docs/src/templates/syntaxhighlighter/shBrushXml.js | 10 +++++----- docs/src/templates/syntaxhighlighter/shCore.css | 2 +- docs/src/templates/syntaxhighlighter/shCore.js | 2 +- docs/src/templates/syntaxhighlighter/shThemeDefault.css | 2 +- docs/src/writer.js | 12 ++++++------ 13 files changed, 36 insertions(+), 35 deletions(-) (limited to 'docs/src') diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 0dee586b..1c03a0f1 100644 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -38,7 +38,7 @@ var writes = callback.chain(function(){ writer.copy('jquery.min.js', writes.waitFor()); }); writes.onDone(function(){ - console.log('DONE. Generated ' + docs.length + ' pages in ' + + console.log('DONE. Generated ' + docs.length + ' pages in ' + (now()-start) + 'ms.' ); }); work.onDone(writes); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 8481f7dc..daa44fef 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -76,6 +76,7 @@ Doc.prototype = { this.description = markdown(this.description); this['this'] = markdown(this['this']); this.exampleDescription = markdown(this.exampleDescription || this.exampleDesc); + return this; function flush(){ if (atName) { @@ -144,13 +145,13 @@ Doc.prototype = { dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){ dom.html(method.description); method.html_usage_parameters(dom); - dom.example(method.example, false); + dom.example(method.exampleDescription, method.example, false); }); }); dom.h('Properties', self.properties, function(property){ dom.h(property.name, function(){ dom.text(property.description); - dom.example(property.example, false); + dom.example(property.exampleDescription, property.example, false); }); }); diff --git a/docs/src/reader.js b/docs/src/reader.js index 8f9f22c3..5a653cd6 100644 --- a/docs/src/reader.js +++ b/docs/src/reader.js @@ -88,4 +88,4 @@ function findNgDocInJsFile(file, callback) { -exports.collect = collect; \ No newline at end of file +exports.collect = collect; diff --git a/docs/src/templates/doc_widgets.css b/docs/src/templates/doc_widgets.css index 8361f105..9f007f0e 100644 --- a/docs/src/templates/doc_widgets.css +++ b/docs/src/templates/doc_widgets.css @@ -32,4 +32,4 @@ li.doc-example-live { div.syntaxhighlighter { padding-bottom: 1px !important; /* fix to remove unnecessary scrollbars http://is.gd/gSMgC */ -} \ No newline at end of file +} diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js index 18aeeacb..2d1ab8c6 100644 --- a/docs/src/templates/doc_widgets.js +++ b/docs/src/templates/doc_widgets.js @@ -1,5 +1,5 @@ (function(){ - + var angularJsUrl; var scripts = document.getElementsByTagName("script"); var filename = /(.*\/)angular([^\/]*)/; @@ -10,7 +10,7 @@ } } - + var HTML_TEMPLATE = '\n' + '\n' + @@ -32,15 +32,15 @@ var tabs = angular.element( '
' + + '
' + scenario.text() + '