Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Add title to generated README and decrease level of headings
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed May 15, 2013
1 parent 7140bc1 commit 96ac02a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions lib/knife_cookbook_readme/readme_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def initialize(metadata, constraints=false)
@constraints = constraints
end

def title
"#{@metadata.name.capitalize} Cookbook"
end

def description
@metadata.description
end
Expand Down
18 changes: 9 additions & 9 deletions template/README.md.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Description
===========
<%= title %>
<%= '=' * title.length %>
<%= description %>

Requirements
============
------------

## Platform:
### Platform:

<% unless platforms.empty? %>
<% platforms.each do |platform| %>
Expand All @@ -16,7 +16,7 @@ Requirements
*No platforms defined*
<% end %>

## Cookbooks:
### Cookbooks:

<% unless dependencies.empty? %>
<% dependencies.each do |cookbook| %>
Expand All @@ -27,7 +27,7 @@ Requirements
<% end %>

Attributes
==========
----------

<% unless attributes.empty? %>
<table>
Expand All @@ -49,11 +49,11 @@ Attributes
<% end %>

Recipes
=======
-------

<% unless recipes.empty? %>
<% recipes.each do |recipe, description| %>
## <%= recipe %>
### <%= recipe %>
<%= description %>
Expand All @@ -63,7 +63,7 @@ Recipes
<% end %>

License and Author
==================
------------------

Author:: <%= author %> (<<%= author_email %>>)

Expand Down

0 comments on commit 96ac02a

Please sign in to comment.