-
Notifications
You must be signed in to change notification settings - Fork 290
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
Add rake doc task to generate documentation from inline comments
#748
Comments
|
For types and providers, this is less useful than I hoped. Puppet::Type.newtype() obscures any inline documentation from YARD because it's nested in a passed block. |
|
What about https://github.com/puppetlabs/puppet-strings ? |
Great idea! Exactly what I was looking for. |
rake doc task to generate documentation from inline comments
|
puppet-strings is great, and I'm going to put up a PR adding the rake tasks to generate documentation. The only gotcha is that helper methods inside of a type or provider block are still not parsed. I believe this is a result of the meta-programming involved in To handle my original need to document a helper method, the method should be placed into a pure Ruby class and included inside the closure passed to Puppet::Type.newtype. This will allow Yard (via puppet strings) to parse the PuppetX namespace like it normally does now. I'll add a second issue to record the need to update all of the inline documentation comments to YARD syntax. This will be pretty straight forward and mechanical with some vim macros, but it needs to happen after #682 and related changes are merged into master. |
Build the documentation with `bundle exec rake puppet:strings` The documentation is generated in every matrix cell for Travis. RedCarpet is used to support Github Flavored Markdown. The change to sensu_redis_config.rb is to avoid a bug in YARD, throwing ArgumentError trying to parse the affected node in the syntax tree. This patch changes the code to be compatible with YARD. Resolves sensu#748
rake doc task to generate documentation from inline commentsrake puppet:strings task to generate documentation from inline comments
rake puppet:strings task to generate documentation from inline commentsrake doc task to generate documentation from inline comments
Build the documentation with `bundle exec rake puppet:strings` The documentation is generated in every matrix cell for Travis. RedCarpet is used to support Github Flavored Markdown. The change to sensu_redis_config.rb is to avoid a bug in YARD, throwing ArgumentError trying to parse the affected node in the syntax tree. This patch changes the code to be compatible with YARD. Resolves sensu#748
(#748) Add puppet-strings gem and dependencies
Working with the types and providers, there is little documentation for the class and instance methods. This isn't a huge problem, much of it is self-explanatory, however it would make maintenance of the module much more accessible to have YARD documentation for the types and providers.
As an example, I tend to reach for this cheatsheet when adding code comments.
The text was updated successfully, but these errors were encountered: