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

Commit

Permalink
Bug 1222982 - Add stability levels to API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kraldav authored and petemoore committed Apr 1, 2016
1 parent d171e77 commit b1973e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Expand Up @@ -14,6 +14,7 @@
<link rel="stylesheet" href="/assets/style.css">
<link rel="stylesheet" href="/assets/highlight.css">
<link rel="stylesheet" href="/assets/markdown.css">
<link rel="stylesheet" href="/assets/docref/stability.css">

<!-- jQuery and Bootstrap Javascript-->
<script src="/assets/jquery.min.js"></script>
Expand Down
10 changes: 7 additions & 3 deletions assets/docref/reference.ejs
Expand Up @@ -54,9 +54,10 @@
}
}
var signature = entry.name + "(" + args.join(', ') + ") : " + retval;
var stabilityValue = entry.stability || "unknown";
%>
<tr>
<td><code><a
<td><code class = '<%= stabilityValue %>'><a
href='#<%= entry.name %>'
title='<%= entry.title%>'><%= signature %></a></code></td>
<td><%= entry.title %></td>
Expand Down Expand Up @@ -99,10 +100,11 @@

<% entries.filter(function(entry) {
return entry.type == 'function';
}).forEach(function(entry) { %>
}).forEach(function(entry) {
var stabilityValue = entry.stability || "unknown"; %>
<a name='<%= entry.name %>'></a>
<hr>
<h2><%= marked(entry.title) %></h2>
<h2 class = '<%= stabilityValue %>'><%= marked(entry.title) %></h2>
<dl class='dl-horizontal method-properties'>
<dt>Method</dt>
<dd><div class='label label-default'><%= entry.method %></div></dd>
Expand Down Expand Up @@ -155,6 +157,8 @@
var signature = entry.name + "(" + args.join(', ') + ") : " + retval;
%>
<dd><code><%= signature%></code></dd>
<dt>Stability</dt>
<dd><code class='<%= stabilityValue %>' ><%= stabilityValue %></code></dd>
</dl>
<%= marked(entry.description) %>
<% if (entry.input) { %>
Expand Down
18 changes: 18 additions & 0 deletions assets/docref/stability.css
@@ -0,0 +1,18 @@
code.experimental,h2.experimental>p{
color:rgb(32, 29, 29);
background-color:#FFE9D2;
}
code.stable,h2.stable>p{
color:rgb(32, 29, 29);
background-color:#E2F5BF;
}
code.deprecated,h2.deprecated>p,code.deprecated>a{
color:#C7254E;
background-color:#E1DBDB;
}
h2>p{
border-radius:4px;
padding:0.5%;
margin-bottom:0%;
display:inline;
}

0 comments on commit b1973e8

Please sign in to comment.