-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Question: Build Yard docs upon gem installation? #1187
Comments
YARD supports RubyGems'
You can configure that globally in your gemrc. YARD also added a metadata override for gemspecs:
Hope that helps! |
? Added support for gemspec metadata key I'm not that familiar with crafting gems (still leaning). Does the above mean I'd add something like this to my gemspec file?
And that should trigger YARD to build docs for that gem when its installed/updated? |
I've been testing. When I added the snipped above it did indeed generate the docs. But it took a lot longer than For the purpose of the API stub gem - for use with Solargraph - that is precisely what I need. So maybe I should moderate my question; upon installation of my gem, can I trigger YARD to generate only the |
Oooh.... I just discovered what YRI does! And this is what I needed for the gem:
Sidenote, YRI is very interesting. Is there a way to search for a module/class/method without having the full qualified identifier path? For instance; |
I'm running into problems where yri has not been run for my gem. Is I've had a few times where I have had to run (The YRI data is used by Solargraph to provide code insight in VSCode.) |
Keep in mind that YARD respects |
I typically use wither Maybe I need to look for a way to force YRI to alway run regardless of Is there any way to debug/log/verbose when YRI is suppose to run as part of |
I believe that running gem with its respective debug flags should give you information about which plugins get loaded, but tldr any gem with a Unfortunately YARD won't provide a way to force doc generation to run regardless of user settings, since users need to be able to fully control how gems get installed on their machines. The fix here might be for Solargraph to take on, namely maybe that project should be providing a plugin to auto-index all gems after a successful gem installation. Or perhaps this can be coupled with a notification to VS Code to initiate such an action so that it only works when you're running in a development context. Basically, Solargraph should not assume that indexing has been performed on a gem install, nor should it expect a user has this configured. |
Yea - it might be something that can be done on the side of Solargraph. A while back when I was using RubyMine it "just worked" - so this is rather exclusive to Solargraph. |
I know you can configure Yard to build docs upon all gem installations.
But I was wondering if it was possible for a gem itself to control whether this happened?
The background is that I have a set of Ruby API stubs to provide code insight for IDEs. With VSCode one can use the Solargraph gem. It makes use of Yard to provide some of the code insight - it picks up types from the doc comments.
However, right now one have to manually trigger YARD to build the docs when installing or updating.
yard gems sketchup-api-stubs
Apart from making Yard build for all gems (which I'd prefer not to - most I don't need docs for), is there a way to make a gem trigger yard documentation upon installation? I found some references to
has_rdoc = 'yard'
- but that appear to be deprecated and removed.The text was updated successfully, but these errors were encountered: