docs(sidenav reorg): remove glossary and cheatsheet from REFERENCE. Move glossary to BASICS. Rename REFERENCE to API REFERENCE

This commit is contained in:
Eric Jimenez 2016-04-25 14:22:24 -04:00 committed by Naomi Black
parent 085e495c07
commit 8f158f2241
10 changed files with 88 additions and 50 deletions

View File

@ -3,7 +3,7 @@
- var dir = current.path[4] ? current.path[3] + '/' : ''; - var dir = current.path[4] ? current.path[3] + '/' : '';
- var cur = current.path[4] || current.path[3]; - var cur = current.path[4] || current.path[3];
- cur = cur === 'index' ? '' : cur + '.html'; - cur = cur === 'index' ? '' : cur + '.html';
- cur = base + dir + cur; - cur = base + dir + cur;
- var sections = function(dir, selector) { - var sections = function(dir, selector) {
- var secondaryPath = public.docs[current.path[1]][current.path[2]] - var secondaryPath = public.docs[current.path[1]][current.path[2]]
@ -31,7 +31,7 @@
- } - }
- return section; - return section;
- } - }
- var tutorial = sections('tutorial'); - var tutorial = sections('tutorial');
- var cookbook = sections('cookbook'); - var cookbook = sections('cookbook');
- var basics = sections('guide', function(item) { return item.basics; }); - var basics = sections('guide', function(item) { return item.basics; });
@ -42,11 +42,16 @@
- var selectedCount = items.filter(function(item) { return !!item.class; }).length; - var selectedCount = items.filter(function(item) { return !!item.class; }).length;
- return selectedCount > 0 ? 'is-nav-title-selected' : ''; - return selectedCount > 0 ? 'is-nav-title-selected' : '';
- } - }
- var isQuickstartSelected = function(_cur) { - var isQuickstartSelected = function() {
- var splitted = cur.split('/'); - var splitted = cur.split('/');
- var bit = splitted[splitted.length - 1].replace('.html', ''); - var bit = splitted[splitted.length - 1].replace('.html', '');
- return bit === 'quickstart' ? 'is-nav-title-selected' : ''; - return bit === 'quickstart' ? 'is-nav-title-selected' : '';
-} -}
- var isApiReferenceSelected = function() {
- var splitted = cur.split('/');
- var bit = splitted[splitted.length - 2];
- return bit === 'api' ? 'is-nav-title-selected' : '';
-}
- var isCollapsed = function(titleStyle) { - var isCollapsed = function(titleStyle) {
- return titleStyle === 'is-nav-title-selected' ? '' : 'is-hidden'; - return titleStyle === 'is-nav-title-selected' ? '' : 'is-hidden';
- } - }
@ -99,21 +104,15 @@ nav.side-nav.l-pinned-left.l-layer-4.l-offset-nav
li(class="nav-list-item #{item.class}"): a(href="#{item.href}" title="#{item.tooltip}") #{item.navTitle} li(class="nav-list-item #{item.class}"): a(href="#{item.href}" title="#{item.tooltip}") #{item.navTitle}
.nav-blocks .nav-blocks
a(class="nav-title #{anyItemSelected(reference)}" href="#{reference[0].href}" title="#{reference[0].tooltip}") Reference a(class="nav-title #{isApiReferenceSelected()}" href="#{reference[0].href}" title="#{reference[0].tooltip}") API Reference
img(class="inline-arrow-down-svg" src="/resources/images/icons/ic_keyboard_arrow_down_black_24px.svg")
.nav-unordered-lists(class="#{isCollapsed(anyItemSelected(reference))}")
ul
each item in reference
li(class="nav-list-item #{item.class}"): a(href="#{item.href}" title="#{item.tooltip}") #{item.navTitle}
script. script.
// Could put in appCtrl but only needed here and clear here // Could put in appCtrl but only needed here and clear here
(function scrollToSelectedLink() { (function scrollToSelectedLink() {
var sideNav = document.getElementsByClassName('side-nav')[0]; var sideNav = document.getElementsByClassName('side-nav')[0];
var link = sideNav.getElementsByClassName('is-selected')[0]; var link = sideNav.getElementsByClassName('is-selected')[0];
if(link && link.offsetTop > window.innerHeight){ if(link && link.offsetTop > window.innerHeight){
sideNav.scrollTop = link.offsetTop - (window.innerHeight/2); sideNav.scrollTop = link.offsetTop - (window.innerHeight/2);
//alert("offsetTop: " + link.offsetTop + " side-nav top is " + sideNav.scrollTop); //alert("offsetTop: " + link.offsetTop + " side-nav top is " + sideNav.scrollTop);
} }
})() })()

View File

@ -39,13 +39,13 @@
"cheatsheet": { "cheatsheet": {
"title": "Angular Cheat Sheet", "title": "Angular Cheat Sheet",
"intro": "A quick guide to Angular syntax.", "intro": "A quick guide to Angular syntax.",
"reference": true "reference": false
}, },
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"reference": true "reference": false
}, },
"resources": { "resources": {

View File

@ -1,14 +1,33 @@
include _util-fns include _util-fns
+includeShared('{ts}', 'intro') // From ts/glossary.jade, the folder ts/latest/_fragments is generated which contains a bunch of partial files.
+includeShared('{ts}', 'a2') // These partials comprise the glossary,a subset of these partials should be used to generate the glossary for
+includeShared('{ts}', 'b-c') // __dart__ under BASICS.
+includeShared('{ts}', 'd1') !=partial('../../ts/latest/_fragments/glossary-intro')
+includeShared('{ts}', 'd2') !=partial('../../ts/latest/_fragments/glossary-a-2')
+includeShared('{ts}', 'e1') !=partial('../../ts/latest/_fragments/glossary-b-c')
+includeShared('{ts}', 'e2') !=partial('../../ts/latest/_fragments/glossary-d1')
+includeShared('{ts}', 'f-l') !=partial('../../ts/latest/_fragments/glossary-d2')
+includeShared('{ts}', 'm1') !=partial('../../ts/latest/_fragments/glossary-e1')
+includeShared('{ts}', 'n-s') !=partial('../../ts/latest/_fragments/glossary-e2')
+includeShared('{ts}', 't1') !=partial('../../ts/latest/_fragments/glossary-f-l')
!=partial('../../ts/latest/_fragments/glossary-m1')
//!=partial('../../ts/latest/_fragments/glossary-m2') not needed in dart
!=partial('../../ts/latest/_fragments/glossary-n-s')
!=partial('../../ts/latest/_fragments/glossary-t1')
//!=partial('../../ts/latest/_fragments/glossary-t2') notneeded in dart
!=partial('../../ts/latest/_fragments/glossary-u-z')
+includeShared('{ts}', 'u-z') // NOTE: (ericjim): I am almost certain these lines are doing nothing,
// so instead I use `!=partial` to include the glossary fragments.
//+includeShared('{ts}', 'intro')
//+includeShared('{ts}', 'a2')
//+includeShared('{ts}', 'b-c')
//+includeShared('{ts}', 'd1')
//+includeShared('{ts}', 'd2')
//+includeShared('{ts}', 'e1')
//+includeShared('{ts}', 'e2')
//+includeShared('{ts}', 'f-l')
//+includeShared('{ts}', 'm1')
//+includeShared('{ts}', 'n-s')
//+includeShared('{ts}', 't1')
//+includeShared('{ts}', 'u-z')

View File

@ -131,6 +131,6 @@
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"hide": true "basics": true
} }
} }

View File

@ -39,13 +39,13 @@
"cheatsheet": { "cheatsheet": {
"title": "Angular Cheat Sheet", "title": "Angular Cheat Sheet",
"intro": "A quick guide to Angular syntax.", "intro": "A quick guide to Angular syntax.",
"reference": true "reference": false
}, },
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"reference": true "reference": false
}, },
"resources": { "resources": {

View File

@ -1,14 +1,35 @@
include _util-fns include _util-fns
+includeShared('{ts}', 'intro') // From ts/glossary.jade, the folder ts/latest/_fragments is generated which contains a bunch of partial files.
+includeShared('{ts}', 'a2') // These partials comprise the glossary,a subset of these partials should be used to generate the glossary for
+includeShared('{ts}', 'b-c') // __javascript__ under BASICS.
+includeShared('{ts}', 'd1') !=partial('../../ts/latest/_fragments/glossary-intro')
+includeShared('{ts}', 'd2') //!=partial('../../ts/latest/_fragments/glossary-a-1') not needed in javascript
+includeShared('{ts}', 'e1') !=partial('../../ts/latest/_fragments/glossary-a-2')
+includeShared('{ts}', 'e2') !=partial('../../ts/latest/_fragments/glossary-b-c')
+includeShared('{ts}', 'f-l') !=partial('../../ts/latest/_fragments/glossary-d1')
+includeShared('{ts}', 'm1') !=partial('../../ts/latest/_fragments/glossary-d2')
+includeShared('{ts}', 'n-s') !=partial('../../ts/latest/_fragments/glossary-e1')
+includeShared('{ts}', 't1') !=partial('../../ts/latest/_fragments/glossary-e2')
+includeShared('{ts}', 't2') !=partial('../../ts/latest/_fragments/glossary-f-l')
+includeShared('{ts}', 'u-z') !=partial('../../ts/latest/_fragments/glossary-m1')
!=partial('../../ts/latest/_fragments/glossary-m2')
!=partial('../../ts/latest/_fragments/glossary-n-s')
!=partial('../../ts/latest/_fragments/glossary-t1')
!=partial('../../ts/latest/_fragments/glossary-t2')
!=partial('../../ts/latest/_fragments/glossary-u-z')
// NOTE: (ericjim): I am almost certain these lines are doing nothing,
// so instead I use `!=partial` to include the glossary fragments.
//+includeShared('{ts}', 'intro')
//+includeShared('{ts}', 'a2')
//+includeShared('{ts}', 'b-c')
//+includeShared('{ts}', 'd1')
//+includeShared('{ts}', 'd2')
//+includeShared('{ts}', 'e1')
//+includeShared('{ts}', 'e2')
//+includeShared('{ts}', 'f-l')
//+includeShared('{ts}', 'm1')
//+includeShared('{ts}', 'n-s')
//+includeShared('{ts}', 't1')
//+includeShared('{ts}', 't2')
//+includeShared('{ts}', 'u-z')

View File

@ -126,10 +126,9 @@
"intro": "Angular 1 applications can be incrementally upgraded to Angular 2." "intro": "Angular 1 applications can be incrementally upgraded to Angular 2."
}, },
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"hide": true "basics": true
} }
} }

View File

@ -39,13 +39,13 @@
"cheatsheet": { "cheatsheet": {
"title": "Angular Cheat Sheet", "title": "Angular Cheat Sheet",
"intro": "A quick guide to Angular syntax.", "intro": "A quick guide to Angular syntax.",
"reference": true "reference": false
}, },
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"reference": true "reference": false
}, },
"resources": { "resources": {

View File

@ -127,6 +127,6 @@
"glossary": { "glossary": {
"title": "Glossary", "title": "Glossary",
"intro": "Brief definitions of the most important words in the Angular 2 vocabulary", "intro": "Brief definitions of the most important words in the Angular 2 vocabulary",
"hide": true "basics": true
} }
} }

View File

@ -148,7 +148,7 @@ include {$ relativePath(doc.path, '_util-fns') $}
.div(layout="row" layout-xs="column" class="instance-members" class="row-margin") .div(layout="row" layout-xs="column" class="instance-members" class="row-margin")
div(flex="20" flex-xs="100") div(flex="20" flex-xs="100")
h2(class="h2-api-docs") Class Details h2(class="h2-api-docs") Class Details
div(flex="80" flex-xs="100") div(class="code-links" flex="80" flex-xs="100")
{% for member in doc.members %}{% if not member.internal %} {% for member in doc.members %}{% if not member.internal %}
a(name="{$ member.name $}-anchor" class="anchor-offset") a(name="{$ member.name $}-anchor" class="anchor-offset")
pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }")