-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capable of generating attribute documentation ? #4
Comments
'yard-chef' is capable of documenting attributes. The generated doc displays attribute in a table format (name and description being the columns). The plugin parses the attribute name and description from |
Hey, Thanks for the quick reply but I am not exactly sure I see what you mean by "cookbook-level attributes" in the metadata.rb file. Are you talking about this? attribute 'pets/cat/name',
:display_name => "Cat Name",
:description => "The name of your cat",
:choice => [
'kitty kitty',
'peanut',
'einstein',
'honey' ],
:type => "string",
:required => "recommended",
:recipes => [ 'cats::eat' ],
:default => "kitty kitty" If so I did try adding that to my metadata.rb file and rerunning yard-chef but I didnt get that attribute in the result. Am I perhaps doing something wrong or misunderstanding ? Thanks again -John |
You should find the attribute displayed in whatever cookbook you defined your attribute in. Can you find the documentation of your cookbook in the "Cookbook List"? If so, check in that and let me know if you can find it. Otherwise it could probably be a bug. |
Nitin, Right now I have one cookbook I am testing this with ( prism ) I run the following jdyer@dyer:~/Dropbox/Projects/chef/site-cookbooks/prism(master⚡) » bundle jdyer@dyer:~/Dropbox/Projects/chef/site-cookbooks/prism(master⚡) » In the results I see this ( http://note.io/Z0VzrF ) in the bottom of the On Mon, Apr 1, 2013 at 7:54 PM, Nitin notifications@github.com wrote:
|
I think you are using the plugin from within the 'prism' directory. Try running the same command from 'site-cookbooks' directory. The plugin will then generate documentation for all cookbooks in that directory. The plugin, as of now, works only if it is run from the directory which has all the cookbooks (in your case 'site-directory'). Try that and please let me know. This is still a work in progress. |
Nitin, Great, much further now ( http://note.io/XmXLZx ) . I do have a few remaining questions if you don't mind.
attribute 'pets/cat/name',
:display_name => "Cat Name",
:description => "The name of your cat",
:choice => [
'kitty kitty',
'peanut',
'einstein',
'honey' ],
:type => "string",
:required => "recommended",
:recipes => [ 'cats::eat' ],
:default => "kitty kitty"
Thanks again -John |
I am working on getting the ":description" from attribute. As of now if you put a comment on top of the attribute that gets generated in the docs. For the recipes you can have description on the metadata.rb. recipe "cookbook::recipe_name", "Recipe description" |
I have updated the README on how to document the cookbooks. Please let me know if you still run into any issues. |
Add js templates to gemspec for gem packaging
I see mention of attribute handling in this project but I see no examples of how to use it. Can yard-chef generate documentation of attributes somehow or am I reading to much into the source ?
The text was updated successfully, but these errors were encountered: