Extract documentation from chef cookbooks' attributes files and output it to the cookbook's README.md file.
chef-attrdoc
groups attribute initialization lines together with the comments immediately above them. Any lines containing an attribute initialization which are not separated by an empty line are considered a group. The comment immediately above them is assumed to describe the group of attributes below. Groups of attribute initialization lines which are not immediately preceded by a comment line are ignored and will not show up in the output.
chef-attrdoc currently ignores TODO, XXX, NOTE and foodcritic comments.
# gem install chef-attrdoc
# chef-attrdoc ~/cookbooks/mycookbook
chef-attrdoc
will try to find an Attributes heading in the README.md file in that directory and replace its contents with the generated attributes/default.rb
documentation.
chef-attrdoc
uses ruby's stdlib ripper
module and so does not have any dependencies.
Here are some example outputs from openstack chef cookbooks: