Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #196 from neatshell/master
Browse files Browse the repository at this point in the history
feat(docs): visualize @deprecated in sizebar
  • Loading branch information
Martin authored Jun 30, 2017
2 parents 847e1ce + ebb1d6e commit 580c525
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ function scenarios(docs){


//////////////////////////////////////////////////////////
function metadata(docs){
function metadata(docs) {
var pages = [];
docs.forEach(function(doc){
var path = (doc.name || '').split(/(\:\s*)/);
Expand All @@ -1125,6 +1125,11 @@ function metadata(docs){
shortName = 'input [' + shortName + ']';
}

doc.isDeprecated = false;
if (doc.deprecated !== undefined) {
doc.isDeprecated = true;
}

pages.push({
section: doc.section,
id: doc.id,
Expand All @@ -1133,7 +1138,8 @@ function metadata(docs){
type: doc.ngdoc,
moduleName: doc.moduleName,
shortDescription: doc.shortDescription(),
keywords: doc.keywords()
keywords: doc.keywords(),
isDeprecated: doc.isDeprecated
});
});
pages.sort(sidebarSort);
Expand Down
4 changes: 4 additions & 0 deletions src/templates/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ img.AngularJS-small {
padding-bottom: 6px;
}

.form-search > ul.nav > li.deprecate {
text-decoration: line-through;
}

.form-search .well {
border-color: #d3d3d3;
padding: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/templates/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ docsApp.controller.DocsController = function($scope, $location, $window, section
last: this.$last,
active: page1 && this.currentPage == page1 || page2 && this.currentPage == page2,
match: this.focused && this.currentPage != page1 &&
this.bestMatch.rank > 0 && this.bestMatch.page == page1

this.bestMatch.rank > 0 && this.bestMatch.page == page1,
deprecate: page1.isDeprecated
};
};

Expand Down

0 comments on commit 580c525

Please sign in to comment.