|
26 | 26 | </nav> |
27 | 27 |
|
28 | 28 | <main class="py-4 flex-1 space-y-8"> |
29 | | - <h1 class="mb-4 text-4xl tracking-tight font-bold text-gray-900 dark:text-white"><%= @code_object.path %></h1> |
| 29 | + <%= render(Docs::Headline::H1.new) { @code_object.path } %> |
30 | 30 |
|
31 | 31 | <section class="format dark:format-invert"> |
32 | 32 | <%= render_docstring(@code_object.docstring_introduction, code_object: @code_object) %> |
|
45 | 45 | <% if @examples.any? %> |
46 | 46 | <section> |
47 | 47 | <%- @examples.each do |example| %> |
48 | | - <h2 class="mt-8 text-2xl font-bold"><%= example.name %></h2> |
| 48 | + <%= render(Docs::Headline::H2.new) { example.name } %> |
49 | 49 | <%= render(Docs::CodeExample.new) do %><%= example.text %><% end %> |
50 | 50 | <% end %> |
51 | 51 | </section> |
52 | 52 | <% end %> |
53 | 53 |
|
54 | 54 | <% if @previews.any? %> |
55 | 55 | <section> |
56 | | - <h2 class="mt-8 text-2xl font-bold">Examples</h2> |
| 56 | + <%= render(Docs::Headline::H2.new) { "Examples" } %> |
57 | 57 |
|
58 | 58 | <% @previews.each do |scenario_group| %> |
59 | 59 | <div class="mt-8"> |
60 | | - <h3 class="mt-4 text-xl font-bold"><%= scenario_group.label %></h3> |
61 | | - |
| 60 | + <%= render(Docs::Headline::H3.new) { scenario_group.label } %> |
62 | 61 | <div class="my-4"> |
63 | 62 | <%= render_docstring(scenario_group.scenarios.map { |s| s.notes.presence }.compact.join("\n\n"), code_object: @code_object) %> |
64 | 63 | </div> |
|
68 | 67 | </section> |
69 | 68 | <% end %> |
70 | 69 |
|
71 | | - <h2 class="mt-8 text-2xl font-bold">API reference</h2> |
| 70 | + <%= render(Docs::Headline::H2.new) { "API reference" } %> |
72 | 71 |
|
73 | 72 | <% if @code_object.type == :class && @code_object.parent && !@code_object.parent.root? %> |
74 | 73 | <section> |
|
81 | 80 |
|
82 | 81 | <% if @child_classes.any? %> |
83 | 82 | <section> |
84 | | - <h3 class="mb-4 mt-8 text-xl font-bold">In namespace</h3> |
| 83 | + <%= render(Docs::Headline::H3.new) { "In namespace" } %> |
85 | 84 | <ul class="list-disc list-inside space-y-2"> |
86 | 85 | <% @child_classes.each do |subclass| %> |
87 | 86 | <li> |
|
94 | 93 |
|
95 | 94 | <% if @viewcomponent_slots.any? %> |
96 | 95 | <section> |
97 | | - <h3 class="mt-8 text-xl font-bold">Slots</h3> |
98 | | - |
| 96 | + <%= render(Docs::Headline::H3.new) { "Slots" } %> |
99 | 97 | <table> |
100 | 98 | <% @viewcomponent_slots.each do |slot_tag| %> |
101 | 99 | <tr> |
|
110 | 108 |
|
111 | 109 | <% if @constructor %> |
112 | 110 | <section> |
113 | | - <h3 class="mb-4 mt-8 text-xl font-bold">Constructor</h3> |
| 111 | + <%= render(Docs::Headline::H3.new) { "Constructor" } %> |
114 | 112 |
|
115 | 113 | <code><%= @constructor.signature %></code> |
116 | 114 |
|
117 | 115 | <% if @constructor_arguments.any? %> |
118 | | - <h4 class="mt-4 text-md font-bold">Parameters</h4> |
| 116 | + <%= render(Docs::Headline::H4.new) { "Parameters" } %> |
119 | 117 | <table> |
120 | 118 | <% @constructor_arguments.each do |param| %> |
121 | 119 | <tr> |
|
130 | 128 | <% end %> |
131 | 129 |
|
132 | 130 | <section> |
133 | | - <h3 class="mb-4 mt-8 text-xl font-bold">See also</h3> |
| 131 | + <%= render(Docs::Headline::H3.new) { "See also" } %> |
134 | 132 | <%= render(Flowbite::Link.new(href: rubydoc_url(@code_object), data: {turbo: false})) do %> |
135 | 133 | Ruby API documentation for |
136 | 134 | <code><%= @code_object.type %> <%= @code_object.path %></code> |
|
0 commit comments