]> git.lizzy.rs Git - rust.git/blob - util/gh-pages/index.html
Merge pull request #2661 from devonhollowood/ptr-ptr-casts
[rust.git] / util / gh-pages / index.html
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
15         .form-inline .checkbox { margin-right: 0.6em }
16
17         .panel-title { display: flex; }
18         .panel-title .label { display: inline-block; }
19
20         .panel-title-name { flex: 1; }
21         .panel-title-name span { vertical-align: bottom; }
22
23         .panel .panel-title-name .anchor { display: none; }
24         .panel:hover .panel-title-name .anchor { display: inline; color: #fff; }
25     </style>
26 </head>
27 <body>
28     <div class="container" ng-app="clippy" ng-controller="lintList">
29         <div class="page-header">
30             <h1>ALL the Clippy Lints</h1>
31         </div>
32
33         <noscript>
34             <div class="alert alert-danger" role="alert">
35                 Sorry, this site only works with JavaScript! :(
36             </div>
37         </noscript>
38
39         <div ng-cloak>
40
41             <div class="alert alert-info" role="alert" ng-if="loading">
42                 Loading&#x2026;
43             </div>
44             <div class="alert alert-danger" role="alert" ng-if="error">
45                 Error loading lints!
46             </div>
47
48             <div class="panel panel-default" ng-show="data">
49                 <div class="panel-body row">
50                     <div class="col-md-6 form-inline">
51                         <div class="form-group form-group-lg">
52                             <p class="h4">Lint levels</p>
53                             <div class="checkbox" ng-repeat="(level, enabled) in levels">
54                                 <label>
55                                     <input type="checkbox" ng-model="levels[level]" />
56                                     {{level}}
57                                 </label>
58                             </div>
59                         </div>
60                     </div>
61                     <div class="col-md-6 form-inline">
62                         <div class="form-group form-group-lg">
63                             <p class="h4">Lint groups</p>
64                             <div class="checkbox" ng-repeat="(group, enabled) in groups">
65                                 <label class="text-capitalize">
66                                     <input type="checkbox" ng-model="groups[group]" />
67                                     {{group}}
68                                 </label>
69                             </div>
70                         </div>
71                     </div>
72                 </div>
73                 <div class="panel-body row">
74                     <div class="col-md-12 form-horizontal">
75                         <div class="input-group">
76                             <span class="input-group-addon" id="filter-label">Filter:</span>
77                             <input type="text" class="form-control" placeholder="Keywords or search string" aria-describedby="filter-label" ng-model="search" />
78                             <span class="input-group-btn">
79                                 <button class="btn btn-default" type="button" ng-click="search = ''">
80                                     Clear
81                                 </button>
82                             </span>
83                         </div>
84                     </div>
85                 </div>
86             </div>
87
88             <article class="panel panel-default" id="{{lint.id}}"
89                 ng-repeat="lint in data | filter:byLevels | filter:byGroups | filter:search | orderBy:'id' track by lint.id" on-finish-render="ngRepeatFinished">
90                 <header class="panel-heading" ng-click="open[lint.id] = !open[lint.id]">
91                     <h2 class="panel-title">
92                         <div class="panel-title-name">
93                             <span>{{lint.id}}</span>
94                             <a href="#{{lint.id}}" class="anchor label label-default" ng-click="open[lint.id] = true; $event.stopPropagation()">&para;</a>
95                         </div>
96
97                         <div class="panel-title-addons">
98                             <span class="label label-default text-capitalize">{{lint.group}}</span>
99
100                             <span ng-if="lint.level == 'Allow'" class="label label-success">Allow</span>
101                             <span ng-if="lint.level == 'Warn'" class="label label-warning">Warn</span>
102                             <span ng-if="lint.level == 'Deny'" class="label label-danger">Deny</span>
103                             <span ng-if="lint.level == 'Deprecated'" class="label label-default">Deprecated</span>
104
105                             <button class="btn btn-default btn-xs">
106                                 <span ng-show="open[lint.id]">&minus;</span>
107                                 <span ng-hide="open[lint.id]">&plus;</span>
108                             </button>
109                         </div>
110                     </h2>
111                 </header>
112
113                 <ul class="list-group lint-docs" ng-if="lint.docs" ng-class="{collapse: true, in: open[lint.id]}">
114                     <li class="list-group-item" ng-repeat="(title, text) in lint.docs">
115                         <h4 class="list-group-item-heading">
116                             {{title}}
117                         </h4>
118                         <div class="list-group-item-text" ng-bind-html="text | markdown"></div>
119                     </li>
120                 </ul>
121             </article>
122         </div>
123     </div>
124
125     <a href="https://github.com/rust-lang-nursery/rust-clippy">
126         <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on Github"/>
127     </a>
128
129     <script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/7.0.0/markdown-it.min.js"></script>
130     <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js"></script>
131     <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/rust.min.js"></script>
132     <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js"></script>
133     <script>
134     (function () {
135         var md = window.markdownit({
136             html: true,
137             linkify: true,
138             typographer: true,
139             highlight: function (str, lang) {
140                 if (lang && hljs.getLanguage(lang)) {
141                     try {
142                         return '<pre class="hljs"><code>' +
143                             hljs.highlight(lang, str, true).value +
144                             '</code></pre>';
145                     } catch (__) {}
146                 }
147
148                 return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
149             }
150         });
151
152         function scrollToLint(lintId) {
153             var target = document.getElementById(lintId);
154             if (!target) {
155                 return;
156             }
157             target.scrollIntoView();
158         }
159
160         function scrollToLintByURL($scope) {
161             var removeListener = $scope.$on('ngRepeatFinished', function(ngRepeatFinishedEvent) {
162                 scrollToLint(window.location.hash.slice(1));
163                 removeListener();
164             });
165         }
166
167         angular.module("clippy", [])
168         .filter('markdown', function ($sce) {
169             return function (text) {
170                 return $sce.trustAsHtml(
171                     md.render(text || '')
172                     // Oh deer, what a hack :O
173                     .replace('<table', '<table class="table"')
174                 );
175             };
176         })
177         .directive('onFinishRender', function ($timeout) {
178             return {
179                 restrict: 'A',
180                 link: function (scope, element, attr) {
181                     if (scope.$last === true) {
182                         $timeout(function () {
183                             scope.$emit(attr.onFinishRender);
184                         });
185                     }
186                 }
187             };
188         })
189         .controller("lintList", function ($scope, $http, $timeout) {
190             // Level filter
191             var LEVEL_FILTERS_DEFAULT = {Allow: true, Warn: true, Deny: true, Deprecated: true};
192             $scope.levels = LEVEL_FILTERS_DEFAULT;
193             $scope.byLevels = function (lint) {
194                 return $scope.levels[lint.level];
195             };
196
197             $scope.groups = {};
198             $scope.byGroups = function (lint) {
199                 return $scope.groups[lint.group];
200             };
201
202             // Get data
203             $scope.open = {};
204             $scope.loading = true;
205
206             if (window.location.hash.length > 1) {
207                 $scope.search = window.location.hash.slice(1);
208                 $scope.open[window.location.hash.slice(1)] = true;
209                 scrollToLintByURL($scope);
210             }
211
212             $http.get('./lints.json')
213             .success(function (data) {
214                 $scope.data = data;
215                 $scope.loading = false;
216
217                 // Initialize lint groups (the same structure is also used to enable filtering)
218                 $scope.groups = data.reduce(function (result, val) {
219                     result[val.group] = true;
220                     return result;
221                 }, {});
222
223                 scrollToLintByURL($scope);
224             })
225             .error(function (data) {
226                 $scope.error = data;
227                 $scope.loading = false;
228             });
229
230             window.addEventListener('hashchange', function () {
231                 // trigger re-render
232                 $timeout(function () {
233                     $scope.levels = LEVEL_FILTERS_DEFAULT;
234                     $scope.search = window.location.hash.slice(1);
235                     $scope.open[window.location.hash.slice(1)] = true;
236
237                     scrollToLintByURL($scope);
238                 });
239                 return true;
240             }, false);
241         });
242     })();
243     </script>
244 </body>
245 </html>