1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 "/>
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 "/>
6
+
7
+ < title > Clippy</ title >
8
+
9
+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css "/>
10
+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/github.min.css "/>
11
+ < style >
12
+ blockquote { font-size : 1em ; }
13
+ [ng \:cloak], [ng-cloak ], [data-ng-cloak ], [x-ng-cloak ], .ng-cloak , .x-ng-cloak { display : none !important ; }
14
+ .panel .anchor { display : none; }
15
+ .panel : hover .anchor { display : inline; color : # fff ; }
16
+ </ style >
17
+ </ head >
18
+ < body >
19
+ < div class ="container " ng-app ="clippy " ng-controller ="lintList ">
20
+ < div class ="page-header ">
21
+ < h1 > ALL the Clippy Lints</ h1 >
22
+ </ div >
23
+
24
+ < noscript >
25
+ < div class ="alert alert-danger " role ="alert ">
26
+ Sorry, this site only works with JavaScript!
27
+ </ div >
28
+ </ noscript >
29
+
30
+ < div ng-cloak >
31
+
32
+ < div class ="alert alert-info " role ="alert " ng-if ="loading ">
33
+ Loading…
34
+ </ div >
35
+ < div class ="alert alert-danger " role ="alert " ng-if ="error ">
36
+ Error loading lints!
37
+ </ div >
38
+
39
+ < div class ="panel panel-default " ng-show ="data ">
40
+ < div class ="panel-body row ">
41
+ < div class ="col-md-6 form-inline ">
42
+ < div class ="form-group form-group-lg ">
43
+ < div class ="checkbox " ng-repeat ="(level, enabled) in levels " style ="margin-right: 0.6em ">
44
+ < label >
45
+ < input type ="checkbox " ng-model ="levels[level] " />
46
+ {{level}}
47
+ </ label >
48
+ </ div >
49
+ </ div >
50
+ </ div >
51
+ < div class ="col-md-6 ">
52
+ < div class ="input-group ">
53
+ < span class ="input-group-addon " id ="filter-label "> Filter:</ span >
54
+ < input type ="text " class ="form-control " placeholder ="Keywords or search string " aria-describedby ="filter-label " ng-model ="search " />
55
+ < span class ="input-group-btn ">
56
+ < button class ="btn btn-default " type ="button " ng-click ="search = '' ">
57
+ Clear
58
+ </ button >
59
+ </ span >
60
+ </ div >
61
+ </ div >
62
+ </ div >
63
+ </ div >
64
+
65
+ < article class ="panel panel-default " id ="{{lint.id}} " ng-repeat ="lint in data | filter:byLevels | filter:search | orderBy:'id' track by lint.id ">
66
+ < header class ="panel-heading " ng-click ="open[lint.id] = !open[lint.id] ">
67
+ < button class ="btn btn-default btn-sm pull-right " style ="margin-top: -6px; ">
68
+ < span ng-show ="open[lint.id] "> −</ span >
69
+ < span ng-hide ="open[lint.id] "> +</ span >
70
+ </ button >
71
+
72
+ < h2 class ="panel-title ">
73
+ {{lint.id}}
74
+
75
+ < span ng-if ="lint.level == 'Allow' " class ="label label-info "> Allow</ span >
76
+ < span ng-if ="lint.level == 'Warn' " class ="label label-warning "> Warn</ span >
77
+ < span ng-if ="lint.level == 'Deny' " class ="label label-danger "> Deny</ span >
78
+ < span ng-if ="lint.level == 'Deprecated' " class ="label label-default "> Deprecated</ span >
79
+
80
+ < a href ="#{{lint.id}} " class ="anchor label label-default "> ¶</ a >
81
+ </ h2 >
82
+ </ header >
83
+
84
+ < ul class ="list-group " ng-if ="lint.docs " ng-class ="{collapse: true, in: open[lint.id]} ">
85
+ < li class ="list-group-item " ng-repeat ="(title, text) in lint.docs ">
86
+ < h4 class ="list-group-item-heading ">
87
+ {{title}}
88
+ </ h4 >
89
+ < div class ="list-group-item-text " ng-bind-html ="text | markdown "> </ div >
90
+ </ li >
91
+ </ ul >
92
+ </ article >
93
+ </ div >
94
+ </ div >
95
+
96
+ < a href ="https://github.com/Manishearth/rust-clippy ">
97
+ < img style ="position: absolute; top: 0; right: 0; border: 0; " src ="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png "/>
98
+ </ a >
99
+
100
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/7.0.0/markdown-it.min.js "> </ script >
101
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js "> </ script >
102
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/rust.min.js "> </ script >
103
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js "> </ script >
104
+ < script >
105
+ ( function ( ) {
106
+ var md = window . markdownit ( {
107
+ html : true ,
108
+ linkify : true ,
109
+ typographer : true ,
110
+ highlight : function ( str , lang ) {
111
+ if ( lang && hljs . getLanguage ( lang ) ) {
112
+ try {
113
+ return '<pre class="hljs"><code>' +
114
+ hljs . highlight ( lang , str , true ) . value +
115
+ '</code></pre>' ;
116
+ } catch ( __ ) { }
117
+ }
118
+
119
+ return '<pre class="hljs"><code>' + md . utils . escapeHtml ( str ) + '</code></pre>' ;
120
+ }
121
+ } ) ;
122
+
123
+ angular . module ( "clippy" , [ ] )
124
+ . filter ( 'markdown' , function ( $sce ) {
125
+ return function ( text ) {
126
+ return $sce . trustAsHtml (
127
+ md . render ( text || '' )
128
+ // Oh deer, what a hack :O
129
+ . replace ( '<table' , '<table class="table"' )
130
+ ) ;
131
+ } ;
132
+ } )
133
+ . controller ( "lintList" , function ( $scope , $http ) {
134
+ // Level filter
135
+ $scope . levels = { Allow : true , Warn : true , Deny : true , Deprecated : true } ;
136
+ $scope . byLevels = function ( lint ) {
137
+ return $scope . levels [ lint . level ] ;
138
+ } ;
139
+
140
+ // Get data
141
+ $scope . open = { } ;
142
+ $scope . loading = true ;
143
+
144
+ $http . get ( './lints.json' )
145
+ . success ( function ( data ) {
146
+ $scope . data = data ;
147
+ $scope . loading = false ;
148
+ } )
149
+ . error ( function ( data ) {
150
+ $scope . error = data ;
151
+ $scope . loading = false ;
152
+ } ) ;
153
+ } )
154
+ } ) ( ) ;
155
+ </ script >
156
+ </ body >
157
+ </ html >
0 commit comments