mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
feat(ngdocs): support for HTML table generation from docs code
This commit is contained in:
parent
b0233a33a1
commit
cf38d8c55b
5 changed files with 12 additions and 1306 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* All parsing/transformation code goes here. All code here should be sync to ease testing.
|
||||
*/
|
||||
|
||||
var Showdown = require('../../lib/showdown').Showdown;
|
||||
var Showdown = require('showdown');
|
||||
var DOM = require('./dom.js').DOM;
|
||||
var htmlEscape = require('./dom.js').htmlEscape;
|
||||
var Example = require('./example.js').Example;
|
||||
|
|
@ -174,7 +174,7 @@ Doc.prototype = {
|
|||
});
|
||||
});
|
||||
text = parts.join('');
|
||||
text = new Showdown.converter().makeHtml(text);
|
||||
text = new Showdown.converter({ extensions : ['table'] }).makeHtml(text);
|
||||
text = text.replace(/(?:<p>)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) {
|
||||
return placeholderMap[id];
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
var fs = require('fs');
|
||||
var vm = require('vm');
|
||||
|
||||
var filename = __dirname + '/showdown-0.9.js';
|
||||
var src = fs.readFileSync(filename);
|
||||
var Showdown = vm.runInThisContext(src + '\nShowdown;', filename);
|
||||
exports.Showdown = Showdown;
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -13,7 +13,8 @@
|
|||
"qq": "0.3.5",
|
||||
"shelljs": "0.1.2",
|
||||
"karma": "0.8.4",
|
||||
"yaml-js": "0.0.5"
|
||||
"yaml-js": "0.0.5",
|
||||
"showdown": "0.3.1"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
|
|
|
|||
8
src/bootstrap/bootstrap.js
vendored
8
src/bootstrap/bootstrap.js
vendored
|
|
@ -143,6 +143,14 @@ directive.tabbable = function() {
|
|||
};
|
||||
};
|
||||
|
||||
directive.table = function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function(scope, element, attrs) {
|
||||
element[0].className = 'table table-bordered table-striped code-table';
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
directive.tabPane = function() {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in a new issue