diff options
| author | Misko Hevery | 2011-01-25 21:55:11 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-26 23:31:15 -0800 |
| commit | bd33f60276a0fa37acffbad7a0cdcff92db594c8 (patch) | |
| tree | 7cd957c19182ddc430a6320b77b2f03cb1bd223d /docs/src/templates | |
| parent | 8682befc7284a3c0b35cd5d85d4f42b1484ec71a (diff) | |
| download | angular.js-bd33f60276a0fa37acffbad7a0cdcff92db594c8.tar.bz2 | |
Added part of guide documentation and supporting changes to doc generator
Diffstat (limited to 'docs/src/templates')
| -rw-r--r-- | docs/src/templates/doc_widgets.js | 15 | ||||
| -rw-r--r-- | docs/src/templates/docs.css | 18 | ||||
| -rw-r--r-- | docs/src/templates/docs.js | 10 | ||||
| -rw-r--r-- | docs/src/templates/index.html | 2 |
4 files changed, 35 insertions, 10 deletions
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js index 2d1ab8c6..39b9ff48 100644 --- a/docs/src/templates/doc_widgets.js +++ b/docs/src/templates/doc_widgets.js @@ -58,11 +58,22 @@ function indent(text) { var lines = text.split(/\n/); var lineNo = []; + // remove any leading blank lines while (lines[0].match(/^\s*$/)) lines.shift(); + // remove any trailing blank lines while (lines[lines.length - 1].match(/^\s*$/)) lines.pop(); + var minIndent = 999; for ( var i = 0; i < lines.length; i++) { - lines[i] = ' ' + lines[i]; - lineNo.push(6 + i); + var line = lines[0]; + var indent = line.match(/^\s*/)[0]; + if (indent !== line && indent.length < minIndent) { + minIndent = indent.length; + } + } + + for ( var i = 0; i < lines.length; i++) { + lines[i] = ' ' + lines[i].substring(minIndent); + lineNo.push(5 + i); } return {html: lines.join('\n'), hilite: lineNo.join(',') }; }; diff --git a/docs/src/templates/docs.css b/docs/src/templates/docs.css index a687ce87..a7566e79 100644 --- a/docs/src/templates/docs.css +++ b/docs/src/templates/docs.css @@ -181,11 +181,16 @@ a { } #sidebar ul li.level-0 { + margin-top: 0.5em; margin-left: 0em; font-weight: bold; font-size: 1.2em; } +#sidebar ul li.level-0:first-child { + margin-top: 0; +} + #sidebar ul li.level-1.level-angular { font-family: monospace; font-weight: normal; @@ -211,6 +216,11 @@ a { font-family: monospace; } +#sidebar ul li.level-4 { + margin-left: 4em; + font-family: monospace; +} + /* Warning and Info Banners */ @@ -282,3 +292,11 @@ a { #main::-webkit-scrollbar { background-color:#fff; } + +/* Content */ +img.right { + float: right; +} +h1, h2, h3, h4, h5 { + clear: both; +} diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index f1cfc3e7..aaea8c9d 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -4,7 +4,7 @@ function DocsController($location, $browser, $window) { window.$root = this.$root; this.getUrl = function(page){ - return '#!' + page.name; + return '#!' + page.id; }; this.getCurrentPartial = function(){ @@ -13,14 +13,14 @@ function DocsController($location, $browser, $window) { this.getTitle = function(){ var hashPath = $location.hashPath || '!angular'; - if (hashPath.match(/^!angular/)) { + if (hashPath.match(/^!/)) { this.partialTitle = hashPath.substring(1); } return this.partialTitle; }; this.getClass = function(page) { - var depth = page.name.split(/\./).length - 1, + var depth = page.depth, cssClass = 'level-' + depth + (page.name == this.getTitle() ? ' selected' : ''); if (depth == 1 && page.type !== 'overview') cssClass += ' level-angular'; @@ -40,8 +40,4 @@ function DocsController($location, $browser, $window) { } -angular.filter('short', function(name){ - return (name||'').split(/\./).pop(); -}); - SyntaxHighlighter['defaults'].toolbar = false; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index bb80a4ba..538be297 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -34,7 +34,7 @@ tabindex="1" accesskey="s"/> <ul id="api-list"> <li ng:repeat="page in pages.$filter(search)" ng:class="getClass(page)"> - <a href="{{getUrl(page)}}" ng:click="" tabindex="2">{{page.name | short}}</a> + <a href="{{getUrl(page)}}" ng:click="" tabindex="2">{{page.shortName}}</a> </li> </ul> </div> |
