From 77c715d7caedf9dd56b07b451dc47480cac5aaff Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Tue, 9 Jul 2013 18:08:23 -0400 Subject: chore(ngdoc): wrap all pages inside of a container tag for easy styling --- docs/src/ngdoc.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'docs/src/ngdoc.js') diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index dc75d5cb..f5f22ee8 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -240,7 +240,25 @@ Doc.prototype = { }); }); text = parts.join(''); - text = markdown.makeHtml(text); + + function prepareClassName(text) { + return text.toLowerCase().replace(/[_\W]+/g, '-'); + }; + + var pageClassName, suffix = '-page'; + if(this.name) { + var split = this.name.match(/^\s*(.+?)\s*:\s*(.+)/); + if(split && split.length > 1) { + var before = prepareClassName(split[1]); + var after = prepareClassName(split[2]); + pageClassName = before + suffix + ' ' + before + '-' + after + suffix; + } + } + pageClassName = pageClassName || prepareClassName(this.name || 'docs') + suffix; + + text = '
)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) { return placeholderMap[id]; }); -- cgit v1.2.3