Custom tags, handlers, and templates
I recently pushed an update to Capybara - https://github.com/jnicklas/capybara/commit/6af2a4609f6093d470a52f8b2132cd7342ef8792 - that adds custom yard tags, handlers and templates to document built-in selectors that are defined with a DSL. This info isn't showing up on http://www.rubydoc.info/github/jnicklas/capybara/Capybara/Selector. Are custom tags, etc not supported?
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 17 Sep, 2016 06:27 AM
Custom tags are supported when supplied in the command line / .yardopts file (
--tag
, etc), but arbitrary Ruby code is not executed on rubydoc.info (--load
is disabled) by default. We could potentially whitelist the project and allow code to be executed for this and its gem. It does look like some of this can be solved with standard--tag
calls, though.2 Posted by Thomas Walpole on 17 Sep, 2016 04:34 PM
If you'd be willing to whitelist the Capybara project that would be great, If not - from the documentation I've read - I don't see how it would possible to get this to work with starndard --tags calls.
Support Staff 3 Posted by lsegal on 18 Sep, 2016 07:43 PM
It wouldn't work exactly the same as you have it, but it may not be necessary to define custom CodeObjects, since the tags could be defined on any arbitrary namespace. Using
@!parse
with private modules would work, and then included in some class or extra file markdown document via{render:TheSelectorModule}
. It's not as nicely automated (you'd have to manually document thexpath
/css
calls), but it could work. Given that you're already defining the filter/locator tags manually which builds the bulk of your Selectors template, it wouldn't be that much of a change.YARD could benefit from some kind of
@!parseinto
directive to force parsing in a block, which would allow you to define macros on thexpath
/css
calls, which could simplify some of this and remove the need for custom templating.For whitelisting, open an issue on http://github.com/docmeta/rubydoc.info so we can track it there. Thanks!