Skip to content

Commit

Permalink
Make timestamping optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobie committed May 18, 2010
1 parent f72bd3c commit 79e544e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/pdoc/generators/html/website.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def variables
:version => @options[:version],
:footer => footer,
:index_header => index_header,
:header => header
:header => header,
:timestamp => timestamp
}
end

Expand All @@ -171,6 +172,10 @@ def footer
@footer ||= @options[:footer] ? htmlize(@options[:footer]) : ''
end

def timestamp
@timestamp ||= @options[:timestamp] == false ? nil : Time.now.utc
end

def json_api?
!!options[:json_api]
end
Expand Down
8 changes: 7 additions & 1 deletion templates/html/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@

<div id="footer">
<p><a href="<%= @home_url %>"><%= @name %></a> v<%= @version %> API documentation.</p>
<p>Last updated on <%= Time.now.utc.strftime('%B %d, %Y at %H:%M UTC') %>. Generated by <a href="http://pdoc.org">PDoc</a>. Uses <a href="http://famfamfam.com/lab/icons/silk/" title="famfamfam.com: Silk Icons">Silk Icons</a> and portions of <a href="http://github.com/280north/aristo/tree/master" title="280north's aristo at master - GitHub">Aristo</a>.</p>
<p>
<% if @timestamp %>
Last updated on <%= @timestamp.strftime('%B %d, %Y at %H:%M UTC') %>.
<% end %>
Generated by <a href="http://pdoc.org">PDoc</a>.
Uses <a href="http://famfamfam.com/lab/icons/silk/" title="famfamfam.com: Silk Icons">Silk Icons</a> and portions of <a href="http://github.com/280north/aristo/tree/master" title="280north's aristo at master - GitHub">Aristo</a>.
</p>
<%= @footer %>
</div> <!-- #footer -->

Expand Down

0 comments on commit 79e544e

Please sign in to comment.