-
Notifications
You must be signed in to change notification settings - Fork 438
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
Allow Aggregating Data From Multiple Sources #8
Comments
I think the best way to accomplish this would be through a parser for spec files. https://github.com/rdoc/rdoc-rake is a parser for rake files that you could use as an example. Instead of creating new classes to contain spec data the parser would look up the corresponding class and add the "Spec:" section to the existing comment. This may require some changes to rdoc to ensure that the spec parser runs after other directories are parsed, but I would be happy to assist with those. |
Hey thanks, it was the bit around ensuring rdoc runs the spec parsing after the other directories were parsed where I thought I'd need help since I think rdoc tends to replace comments instead of append to them (?). |
The ruby parser overwrites method comments but not class comments. Usually classes and modules are extended through reopening but defining a method twice for the same class is not a good idea. Try running rdoc on this example:
If you write a custom parser for spec files this does not have to be true. You can look up a method and append to its comment instead of overwriting it just like for a class. |
Great, then it's just a matter of ensuring the correct ordering (ie: stdlib and then the specs). |
And writing a parser for specs, of course |
Closing this bug as I am not going to write the spec parser. |
No problem, thanks for the information :) |
I tried looking through RDoc's docs and source, but didn't really see a good way to do this. My goal was to generate docs and then pull in extra data from another source to provide extra content.
For instance the RubySpec specs are very well formatted, it would be awesome to scan then and say annotate the RDoc for
Date#+
with theit
orshould
clauses in date's add_spec.rb. The final documentation for Date#+ would then read:Anyways, I thought I would open this issue for comments. If someone wanted to point me in the right direction, I'd like to at least try it.
The text was updated successfully, but these errors were encountered: