Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Linkify method names and toggle details onclick
Browse files Browse the repository at this point in the history
Co-Authored-By: Antonio Scandurra <[email protected]>
  • Loading branch information
jasonrudolph and Antonio Scandurra committed Jun 27, 2019
1 parent 8e119a3 commit 6cdbad6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lib/filters/api_json_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,24 @@ def argument_list(func)
end

def method(func, scope)
id = "#{scope}-#{func["name"]}"

<<~HTML
<div
class="api-entry js-api-entry #{visibility_class(func["visibility"])}"
id="#{scope}-#{func["name"]}">
id="#{id}">
<h3 class="name">
#{func["name"]}#{argument_list(func)}
<a href="##{id}" class="js-api-name method-signature" name="#{id}">
#{func["name"]}#{argument_list(func)}
</a>
#{source_link(func)}
</h3>
</div>
<div class="api-entry method-summary-wrapper js-method-summary-wrapper">
#{summary(func)}
#{description(func)}
#{arguments_table(func) if func["arguments"]}
#{return_values_table(func) if func["returnValues"]}
<div class="method-summary-wrapper">
#{summary(func)}
#{description(func)}
#{arguments_table(func) if func["arguments"]}
#{return_values_table(func) if func["returnValues"]}
</div>
</div>
HTML
end
Expand Down

0 comments on commit 6cdbad6

Please sign in to comment.