Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added deprecated / removed paragraph to entries

  • Loading branch information...
commit 1e4cd5783c6fcc92e815f5b7766ed072b5d06ea3 1 parent df36e51
@IlanFrumer IlanFrumer authored
View
15 app/assets/javascripts/templates.js.coffee
@@ -21,13 +21,26 @@ class jqapi.Templates
"""
entry: (entry) ->
+
+ dep = []
+
+ if entry and entry.deprecated
+ dep.push "version deprecated: <a href='//api.jquery.com/category/version/#{entry.deprecated}/'>#{entry.deprecated}</a>"
+
+ if entry and entry.removed
+ dep.push "removed: <a href='//api.jquery.com/category/version/#{entry.removed}/'>#{entry.removed}</a>"
+
+ unless dep is []
+ dep = "<p>#{dep.join ' | '}</p>"
+
"""
<div id='entry-wrapper'>
<div id='entry-header'>
<h1>#{entry.title}</h1>
<p>#{entry.desc}</p>
+ #{dep}
<ul id='categories'></ul>
- <a href='http://api.jquery.com/#{entry.slug}'>Original: api.jquery.com/#{entry.slug}</a>
+ <a class="origin" href='http://api.jquery.com/#{entry.slug}'>Original: api.jquery.com/#{entry.slug}</a>
</div>
<ul id='entries'></ul>
</div>
View
7 app/assets/stylesheets/entry.css.sass
@@ -24,8 +24,11 @@
color: #777
padding-right: 50px
line-height: 20px
-
a
+ text-decoration: none
+ color: red
+
+ a.origin
position: absolute
top: -10px
right: 0
@@ -253,7 +256,7 @@
&.name
width: 200px
-
+
code
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace
padding: 1px 2px
View
8 tasks/documentation.thor
@@ -114,6 +114,8 @@ class Docs < Thor
:name => entry['name'],
:type => entry['type'],
:title => entry['title'],
+ :deprecated => entry['deprecated'],
+ :removed => entry['removed'],
:desc => entry['desc'], # from first entry or from wrapper
:categories => [], # normalize categories as array
:entries => [] # all variatons of the method
@@ -255,8 +257,10 @@ class Docs < Thor
entryObj = { # build a new stripped entry obj
:title => entry[:title],
:desc => desc,
- :slug => entry[:slug] || entry[:name] # use slug if exist
- }
+ :slug => entry[:slug] || entry[:name], # use slug if exist
+ :deprecated => entry[:deprecated],
+ :removed => entry[:removed]
+ }
if sub_cat # entry is stored in a sub category
cat[:subcats].each do |subcat| # find the slug in the subcats
Please sign in to comment.
Something went wrong with that request. Please try again.