Comments (8)
'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 metadata.rb
(cookbook-level attributes) and in the resources
(resource attributes) directory. We are still working on the final review of design of generated documentation. All your inputs would be very valuable.
from yard-chef.
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
from yard-chef.
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.
from yard-chef.
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
exec yardoc --plugin chef */.rb
Files: 12
Modules: 3 ( 3 undocumented)
Classes: 6 ( 5 undocumented)
Constants: 0 ( 0 undocumented)
Methods: 49 ( 38 undocumented)
20.69% documented
jdyer@dyer:~/Dropbox/Projects/chef/site-cookbooks/prism(master⚡) »
In the results I see this ( http://note.io/Z0VzrF ) in the bottom of the
index.html file which yard is generating but that link for metadata.rb
points to a file which doesnt exist
On Mon, Apr 1, 2013 at 7:54 PM, Nitin [email protected] wrote:
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.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-15744532
.
from yard-chef.
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.
from yard-chef.
Nitin,
Great, much further now ( http://note.io/XmXLZx ) . I do have a few remaining questions if you don't mind.
- How do I fill out the description column of the attributes ? The canonical example from the Opscode docs ( below ) doesn't seem to suffice
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"
-
How do I provide more information on the recipes, for example a description of what they are for ?
I assume for each of these you are expecting metadata to be provided in some manor which I am not doing
Thanks again
-John
from yard-chef.
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"
from yard-chef.
I have updated the README on how to document the cookbooks. Please let me know if you still run into any issues.
from yard-chef.
Related Issues (10)
- Redcarpet 3 HOT 3
- LWRP names incorrect when using provides HOT 3
- Generating Yard documentation for existing LWRP's HOT 3
- Yard dependency needs to be for a later version HOT 7
- How to document dynamic attributes?
- Issues while parsing attributes
- minor documentation typo HOT 2
- Detailed recipe description HOT 13
- Mode to treat cookbook as root object HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yard-chef.