Giter Club home page Giter Club logo

Comments (8)

nitinmohan87 avatar nitinmohan87 commented on July 27, 2024

'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.

johntdyer avatar johntdyer commented on July 27, 2024

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.

nitinmohan87 avatar nitinmohan87 commented on July 27, 2024

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.

johntdyer avatar johntdyer commented on July 27, 2024

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.

nitinmohan87 avatar nitinmohan87 commented on July 27, 2024

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.

johntdyer avatar johntdyer commented on July 27, 2024

Nitin,

Great, much further now ( http://note.io/XmXLZx ) . I do have a few remaining questions if you don't mind.

  1. 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"
  1. 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.

nitinmohan87 avatar nitinmohan87 commented on July 27, 2024

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.

nitinmohan87 avatar nitinmohan87 commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.