Custom handlers in gem documentation
Hi,
I've written a custom handler to parse the documentation for some methods in the gem I maintain: https://github.com/Jesus/dropbox_api
The library uses a bit of meta-programming to make those methods
available as instance methods for the Client class.
I've used the custom handler (EndpointHandler) to generate the
documentation for these.
I've updated my .yardopts to include the handler with
--load ./yardoc/endpoint_handler.rb.
It works correctly in my local machine when I run yard. However, the published documentation seems to be ignoring my custom handler.
Not sure if I'm missing something or this isn't working correctly.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by lsegal on 14 Jan, 2017 06:22 PM
Hi,
We explicitly disable custom handlers from working on rubydoc.info for security reasons. However, we DO allow (blessed) plugins to run on the site, so if you export your handlers to a generic yard- plugin, we could merge it into https://github.com/docmeta/rubydoc.info so everyone could benefit from the functionality.
Hope that explains it, sorry we can't run your custom handler!
Loren
2 Posted by Jesús Burgos Ma... on 18 Mar, 2017 03:42 PM
Hi Loren,
thanks for your reply.
The gem is actually using two plugins, one of them is a modified version of
https://github.com/lsegal/yard-spec-plugin, I've sent a PR with the updates
I needed.
The other plugin is too specific and I don't think it could be resused by
any other library, if you're interested in the details it's available here:
https://github.com/Jesus/dropbox_api/blob/master/yardoc/endpoint_handler.rb
I've decided to host the documentation in Github Pages for now, that way I
can use the custom plugins.
Kind regards