Skip to content

Commit

Permalink
README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksey-hariton committed Dec 1, 2015
1 parent 48dd131 commit 4103980
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,39 @@ Keyword `:kind_of` will be used as for type column and `:default` as default val
To have better documentation of our resources, please describe each action separately with keyword `actions` and comment above it.
Actions will be also described in providers, so use this description as short summary for action.

If you want to see list of providers for your resource, please use YARD tag `@resource` in your providers (check **Providers** section)

### Providers

In providers will be described only actions, there you can place more detailed description of action and example of usage.

Example:

```ruby
# Create filesystem on specified device
# @resource sys_volume

#
# Example:
# Create filesystem on specified device
#
# @example Create EXT4 partition on `/dev/vdc`
# sys_volume 'HOME' do
# device '/dev/vdc'
# device 'ext4'
# action :enable
# end
#
# @note *WARNING!* Please use this action carefully
action :mkfs do
...
end
```

If you add tag `@resource` in the beginning of your provider you will see this provider in providers list of resource.

Tag `@example` used for code examples, text after tag will be used as title for code example. Please not that code example should have two spaces indent in each line.

Tag `@note` used for warning or additional info highlight.

### Attributes

To document your attributes exists two ways, first describe it in cookbooks `metadata.rb` as described in [OpsCode documentation](https://docs.chef.io/config_rb_metadata.html)
Expand Down Expand Up @@ -179,6 +191,8 @@ Comment section beggining from `*Description*` till `...` will be used as detail
Please note, that first line of your code in recipe should have it own comment, in example above `cluster_name = ENV['OPSCODE_ORGNAME']`
have its own comment.

You can also use tags `@note` and `@example` like for providers.

### Cookbooks (metadata.rb)

Short cookbook description and version will be received from keyworks `description` and `version` in `metadata.rb` file:
Expand Down

0 comments on commit 4103980

Please sign in to comment.