Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b3a62b2

Browse files
matskoIgorMinar
authored andcommittedApr 29, 2013
feat(ngdocs): support for HTML table generation from docs code
1 parent 400f936 commit b3a62b2

File tree

6 files changed

+19
-1311
lines changed

6 files changed

+19
-1311
lines changed
 

‎docs/src/ngdoc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* All parsing/transformation code goes here. All code here should be sync to ease testing.
33
*/
44

5-
var Showdown = require('../../lib/showdown').Showdown;
5+
var Showdown = require('showdown');
66
var DOM = require('./dom.js').DOM;
77
var htmlEscape = require('./dom.js').htmlEscape;
88
var Example = require('./example.js').Example;
@@ -216,7 +216,7 @@ Doc.prototype = {
216216
});
217217
});
218218
text = parts.join('');
219-
text = new Showdown.converter().makeHtml(text);
219+
text = new Showdown.converter({ extensions : ['table'] }).makeHtml(text);
220220
text = text.replace(/(?:<p>)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) {
221221
return placeholderMap[id];
222222
});

‎lib/showdown/index.js

-7
This file was deleted.

‎lib/showdown/showdown-0.9.js

-1,296
This file was deleted.

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"qq": "0.3.5",
1414
"shelljs": "0.1.2",
1515
"karma": "0.8.4",
16-
"yaml-js": "0.0.5"
16+
"yaml-js": "0.0.5",
17+
"showdown": "0.3.1"
1718
},
1819
"licenses": [
1920
{

‎src/bootstrap/bootstrap.js

+8
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ directive.tabbable = function() {
143143
};
144144
};
145145

146+
directive.table = function() {
147+
return {
148+
restrict: 'E',
149+
link: function(scope, element, attrs) {
150+
element[0].className = 'table table-bordered table-striped code-table';
151+
}
152+
};
153+
};
146154

147155
directive.tabPane = function() {
148156
return {

‎src/ng/animator.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
*
1616
* Below is a more detailed breakdown of the supported callback events provided by pre-exisitng ng directives:
1717
*
18-
* * {@link ng.directive:ngRepeat#animations ngRepeat} — enter, leave and move
19-
* * {@link ng.directive:ngView#animations ngView} — enter and leave
20-
* * {@link ng.directive:ngInclude#animations ngInclude} — enter and leave
21-
* * {@link ng.directive:ngSwitch#animations ngSwitch} — enter and leave
22-
* * {@link ng.directive:ngShow#animations ngShow & ngHide} - show and hide respectively
18+
* | Directive | Supported Animations |
19+
* |========================================================== |====================================================|
20+
* | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |
21+
* | {@link ng.directive:ngView#animations ngView} | enter and leave |
22+
* | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |
23+
* | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |
24+
* | {@link ng.directive:ngShow#animations ngShow & ngHide} | show and hide |
2325
*
2426
* You can find out more information about animations upon visiting each directive page.
2527
*

0 commit comments

Comments
 (0)
This repository has been archived.