Module: Primer::Static::GenerateArguments
- Defined in:
- lib/primer/static/generate_arguments.rb
Overview
:nodoc:
Class Method Summary collapse
Class Method Details
.call(view_context: self.view_context) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/primer/static/generate_arguments.rb', line 12 def call(view_context: self.view_context) Primer::Component.descendants.sort_by(&:name).map do |component| docs = registry.find(component) ref = Primer::Yard::ComponentManifest.ref_for(component) args = docs.params.map do |tag| default_value = Primer::Yard::DocsHelper.pretty_default_value(tag, component) { "name" => tag.name, "type" => tag.types.join(", "), "default" => default_value, "description" => view_context.render(inline: tag.text.squish) } end { "component" => docs.[:title], "status" => component.status.to_s, "a11y_reviewed" => docs.[:a11y_reviewed] == "true", "short_name" => docs.short_name, "source" => ref.source_url, "lookbook" => ref.lookbook_url, "parameters" => args } end end |