use one layout, update logic, add prettify to api code tags

This commit is contained in:
Alex Wolfe 2015-05-03 20:28:21 -07:00
parent accefeb666
commit 4210541f24
5 changed files with 26 additions and 39 deletions

View File

@ -17,6 +17,4 @@ for page, slug in data
// SET CURRENT PAGE FLAG WHEN YOU PASS IT // SET CURRENT PAGE FLAG WHEN YOU PASS IT
if current.path[4] == slug if current.path[4] == slug
currentPage = true currentPage = true

View File

@ -9,8 +9,17 @@ html(lang="en" ng-app="angularIOApp")
!= partial("../_includes/_hero") != partial("../_includes/_hero")
!= partial("../_includes/_banner") != partial("../_includes/_banner")
article.l-content-small.grid-fluid.docs-content
!= yield if current.path[3] == 'api'
article(class="l-content-small grid-fluid docs-content" ng-non-bindable)
!= yield
else
article(class="l-content-small grid-fluid docs-content")
!= yield
if current.path[3] == 'guide' && current.path[4]
!= partial("../_includes/_next-item")
!= partial("../_includes/_footer") != partial("../_includes/_footer")
!= partial("../_includes/_scripts-include") != partial("../_includes/_scripts-include")

View File

@ -1,17 +0,0 @@
doctype
html(lang="en" ng-app="angularIOApp")
head
!= partial("../../../../_includes/_head-include")
body(class="l-offset-nav l-offset-side-nav" ng-controller="AppCtrl")
!= partial("../../../../_includes/_main-nav")
!= partial("../../../_includes/sidenav/_primary")
!= partial("../../../../_includes/_hero")
!= partial("../../../../_includes/_banner")
article.l-content-small.grid-fluid.docs-content(ng-non-bindable)
!= yield
!= partial("../../../../_includes/_next-item")
!= partial("../../../../_includes/_footer")
!= partial("../../../../_includes/_scripts-include")

View File

@ -1,17 +0,0 @@
doctype
html(lang="en" ng-app="angularIOApp")
head
!= partial("../../../../_includes/_head-include")
body(class="l-offset-nav l-offset-side-nav" ng-controller="AppCtrl")
!= partial("../../../../_includes/_main-nav")
!= partial("../../../_includes/sidenav/_primary")
!= partial("../../../../_includes/_hero")
!= partial("../../../../_includes/_banner")
article.l-content-small.grid-fluid.docs-content
!= yield
!= partial("../../../../_includes/_next-item")
!= partial("../../../../_includes/_footer")
!= partial("../../../../_includes/_scripts-include")

View File

@ -33,5 +33,19 @@ angularIO.controller('AppCtrl', ['$scope', '$mdDialog', '$timeout', function($sc
* Finish Rendereding code directives then prettify code * Finish Rendereding code directives then prettify code
*/ */
// GRAB ALL TAGS NOT USING DIRECTIVES
var preTags = angular.element(document.body).find('pre');
// LOOP THROUGH AND ADD PRETTIFY CLASS
_.each(preTags, function(element) {
var preTag = angular.element(element);
// IF NOT FORMATTED, ADD PRETTY PRINT
if(!preTag.hasClass('prettyprint')) {
preTag.addClass('prettyprint linums');
}
});
// TRIGGER PRETTYPRINT AFTER DIGEST LOOP COMPLETE
$timeout(prettyPrint, 1); $timeout(prettyPrint, 1);
}]); }]);