Custom handlers in gem documentation

's Avatar

jburmac

14 Jan, 2017 03:11 PM

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.

  1. Support Staff 1 Posted by lsegal on 14 Jan, 2017 06:22 PM

    lsegal's Avatar

    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. 2 Posted by Jesús Burgos Ma... on 18 Mar, 2017 03:42 PM

    Jesús Burgos Maciá's Avatar

    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

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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