Skip to content

Commit

Permalink
added deprecated / removed paragraph to entries
Browse files Browse the repository at this point in the history
  • Loading branch information
IlanFrumer committed Mar 20, 2013
1 parent df36e51 commit 1e4cd57
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
15 changes: 14 additions & 1 deletion app/assets/javascripts/templates.js.coffee
Expand Up @@ -21,13 +21,26 @@ class jqapi.Templates
""" """


entry: (entry) -> 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-wrapper'>
<div id='entry-header'> <div id='entry-header'>
<h1>#{entry.title}</h1> <h1>#{entry.title}</h1>
<p>#{entry.desc}</p> <p>#{entry.desc}</p>
#{dep}
<ul id='categories'></ul> <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> </div>
<ul id='entries'></ul> <ul id='entries'></ul>
</div> </div>
Expand Down
7 changes: 5 additions & 2 deletions app/assets/stylesheets/entry.css.sass
Expand Up @@ -24,8 +24,11 @@
color: #777 color: #777
padding-right: 50px padding-right: 50px
line-height: 20px line-height: 20px

a a
text-decoration: none
color: red

a.origin
position: absolute position: absolute
top: -10px top: -10px
right: 0 right: 0
Expand Down Expand Up @@ -253,7 +256,7 @@


&.name &.name
width: 200px width: 200px

code code
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace
padding: 1px 2px padding: 1px 2px
Expand Down
8 changes: 6 additions & 2 deletions tasks/documentation.thor
Expand Up @@ -114,6 +114,8 @@ class Docs < Thor
:name => entry['name'], :name => entry['name'],
:type => entry['type'], :type => entry['type'],
:title => entry['title'], :title => entry['title'],
:deprecated => entry['deprecated'],
:removed => entry['removed'],
:desc => entry['desc'], # from first entry or from wrapper :desc => entry['desc'], # from first entry or from wrapper
:categories => [], # normalize categories as array :categories => [], # normalize categories as array
:entries => [] # all variatons of the method :entries => [] # all variatons of the method
Expand Down Expand Up @@ -255,8 +257,10 @@ class Docs < Thor
entryObj = { # build a new stripped entry obj entryObj = { # build a new stripped entry obj
:title => entry[:title], :title => entry[:title],
:desc => desc, :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 if sub_cat # entry is stored in a sub category
cat[:subcats].each do |subcat| # find the slug in the subcats cat[:subcats].each do |subcat| # find the slug in the subcats
Expand Down

0 comments on commit 1e4cd57

Please sign in to comment.