4 <meta charset="UTF-8"/>
5 <meta name="viewport" content="width=device-width, initial-scale=1"/>
7 <title>Clippy lints documentation</title>
9 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"/>
11 [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
15 <div class="container" ng-app="clippy" ng-controller="docVersions">
16 <div class="page-header">
17 <h1>Clippy lints documentation</h1>
21 <div class="alert alert-info" role="alert" ng-if="loading">
24 <div class="alert alert-danger" role="alert" ng-if="error">
25 Error loading versions!<br/>
26 You can always try to get <a href="master/index.html">the master branch docs</a>.
29 <article class="panel panel-default" ng-show="data">
30 <div class="panel-heading">
31 <h3 class="panel-title">
36 <ul class="list-group">
37 <a class="list-group-item" ng-repeat="version in data | orderBy:versionOrder:true"
38 href="./{{version}}/index.html">
39 {{normalizeVersionDisplay(version)}}
46 <a href="https://github.com/rust-lang/rust-clippy">
47 <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"/>
51 <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js"></script>
53 angular.module('clippy', [])
54 .controller('docVersions', function ($scope, $http) {
55 $scope.loading = true;
57 $scope.normalizeVersionDisplay = function(v) {
58 return v.replace(/^v/, '');
61 $scope.normalizeVersion = function(v) {
62 return v.replace(/^v/, '').replace(/^rust-/, '');
65 $scope.versionOrder = function(v) {
66 if (v === 'master') { return Infinity; }
67 if (v === 'stable') { return Number.MAX_VALUE; }
68 if (v === 'beta') { return Number.MAX_VALUE - 1; }
70 return $scope.normalizeVersion(v)
73 .reduce(function(acc, val, index) {
74 return acc + (val * Math.pow(100, index));
78 $http.get('./versions.json')
79 .success(function (data) {
81 $scope.loading = false;
83 .error(function (data) {
85 $scope.loading = false;