Merge pull request #1685 from Homebrew/sync-shared-config
[Homebrew/formulae.brew.sh.git] / _layouts / formula.html
blob711378446441654347ac44a2559891a0cb689786
1 ---
2 layout: default
3 permalink: :title
4 ---
5 {%- assign fname = page.title -%}
6 {%- assign data_fname = fname | remove: "@" | remove: "." | replace: "+", "_" -%}
7 {%- assign f = site.data.formula[data_fname] -%}
8 <h2
9 {%- if f.disabled %} class="disabled" title="This formula has been disabled since {{ f.disable_date | escape }} because it {{ site.reasons.formula[f.disable_reason] | default: f.disable_reason | escape }}"
10 {%- elsif f.deprecated %} class="deprecated" title="This formula has been deprecated since {{ f.deprecation_date | escape }} because it {{ site.reasons.formula[f.deprecation_reason] | default: f.deprecation_reason | escape }}"
11 {%- endif -%}
13 {{ f.name | escape }}
14 {%- if f.disabled %} (disabled)
15 {%- elsif f.deprecated %} (deprecated)
16 {%- endif -%}
17 </h2>
19 {%- include install_command.html item=f.name %}
20 {%- if f.aliases.size > 0 %}
21 <p class="aliases">Also known as:
22 {%- for alias in f.aliases %}
23 <strong>{{ alias | escape }}</strong>
24 {%- unless forloop.last -%}, {% endunless -%}
25 {%- endfor %}
26 </p>
27 {%- endif -%}
28 {%- if f.oldnames.size > 0 %}
29 <p class="oldnames">Formerly known as:
30 {%- for oldname in f.oldnames %}
31 <strong>{{ oldname | escape }}</strong>
32 {%- unless forloop.last -%}, {% endunless -%}
33 {%- endfor %}
34 </p>
35 {%- endif %}
36 <p class="desc">{{ f.desc | escape }}</p>
37 <p class="homepage"><a href="{{ f.homepage | escape }}">{{ f.homepage | escape }}</a></p>
38 {%- if f.license.size > 0 %}
39 <p>License:
40 {%- for license in f.license %}
41 <strong>{{ license | replace: "_", " " | escape }}</strong>
42 {%- unless forloop.last -%}, {% endunless -%}
43 {%- endfor %}
44 </p>
45 {%- endif %}
47 <p>Formula JSON API: <a href="{{ site.baseurl }}/api/formula/{{ f.name | uri_escape }}.json"><code>/api/formula/{{ f.name | escape }}.json</code></a></p>
49 <p>Formula code: <a target="_blank" href="{{ site.taps.core.remote }}/blob/{{ f.tap_git_head | url_encode }}/{{ f.ruby_source_path | uri_escape }}"><code>{{ f.name | escape }}.rb</code></a> on GitHub</p>
51 <p>Bottle (binary package)
52 {%- assign bottles = false -%}
53 {%- if f.bottle_disabled %} not required, support provided for all supported Homebrew platforms.
54 {%- elsif f.bottle.stable %} installation support provided
55 {%- if f.bottle.stable.files.all -%}.
56 {%- else -%}
57 {%- assign bottles = true %} for:
58 {%- endif -%}
59 {%- else %} not available on this platform.
60 {%- endif -%}</p>
62 {%- if bottles -%}
63 {%- assign arm64_bottle_count = 0 -%}
64 {%- assign intel_bottle_count = 0 -%}
65 {%- for b in f.bottle.stable.files -%}
66 {%- if b[0] contains "arm64_" -%}
67 {%- assign arm64_bottle_count = arm64_bottle_count | plus: 1 -%}
68 {%- else -%}
69 {%- assign intel_bottle_count = intel_bottle_count | plus: 1 -%}
70 {%- endif -%}
71 {%- endfor %}
72 <table>
73 {%- assign subsequent = false -%}
74 {%- for b in f.bottle.stable.files -%}
75 {%- if b[0] contains "arm64_" %}
76 <tr>
77 {%- unless subsequent -%}
78 <th rowspan="{{ arm64_bottle_count }}" scope="rowgroup">Apple Silicon</th>
79 {%- endunless %}
80 <td style="text-transform:capitalize;">
81 {{ b[0] | remove_first: "arm64_" | replace: "_", "&nbsp;" }}
82 {%- assign subsequent = true -%}
83 </td>
84 <td></td>
85 </tr>
86 {%- endif -%}
87 {%- endfor %}
88 <tr><th colspan="3"></th></tr>
89 {%- assign subsequent = false -%}
90 {%- for b in f.bottle.stable.files -%}
91 {%- unless b[0] contains "arm64_" %}
92 <tr>
93 {%- unless subsequent -%}
94 <th rowspan="{{ intel_bottle_count }}" scope="rowgroup">Intel</th>
95 {%- endunless %}
96 <td style="text-transform:capitalize;">
97 {{ b[0] | replace: "x86_64", "64-bit" | replace: "_", "&nbsp;" }}
98 {%- assign subsequent = true -%}
99 </td>
100 <td></td>
101 </tr>
102 {%- endunless -%}
103 {%- endfor -%}
104 </table>
105 {%- endif %}
107 <p>Current versions:</p>
108 <table>
109 <tr>
110 <td><strong>stable</strong></td>
111 <td></td>
112 <td>{{ f.versions.stable | escape }}</td>
113 </tr>
114 {%- if f.versions.head %}
115 <tr>
116 <td><strong>head</strong></td>
117 <td>⚡️</td>
118 <td>{{ f.versions.head | escape }}</td>
119 </tr>
120 {%- endif %}
121 </table>
123 {%- include formulae.html fnames=f.versioned_formulae description="Other versions" -%}
125 {%- if f.revision > 0 %}
126 <p>Revision: <strong>{{ f.revision }}</strong></p>
127 {%- endif -%}
129 {%- if f.keg_only %}
130 <p>Keg-only</p>
131 {%- endif -%}
133 {%- if f.options.size > 0 %}
134 <p>Options:</p>
135 <table>
136 {%- for o in f.options -%}
137 <tr>
138 <td>{{ o.option | escape }}</td>
139 <td>{{ o.description | escape }}</td>
140 </tr>
141 {%- endfor %}
142 </table>
143 {%- endif -%}
145 {%- include formulae.html fnames=f.dependencies description="Depends on" -%}
146 {%- include formulae.html fnames=f.recommended_dependencies description="Depends on recommended" -%}
147 {%- include formulae.html fnames=f.optional_dependencies description="Depends on optionally" -%}
148 {%- include formulae.html fnames=f.build_dependencies description="Depends on when building from source" -%}
150 {%- if f.requirements.size > 0 %}
151 <p>Requires:
152 {%- for r in f.requirements %}
153 <strong>
154 {%- capture requirement -%}
155 {%- case r.name -%}
156 {%- when "arch" -%}
157 {{ r.version | escape }}
158 {%- when "macos" or "maximum_macos" -%}
159 macOS
160 {%- else -%}
161 {{ r.name | capitalize | escape }}
162 {%- endcase -%}
163 {%- endcapture -%}
164 {%- if r.cask -%}
165 {%- unless r.cask contains "/" -%}
166 <a href="{{ site.baseurl }}/cask/{{ r.cask | uri_escape }}">{{ requirement }}</a>
167 {%- else -%}
168 {{ requirement }}
169 {%- endunless -%}
170 {%- else -%}
171 {{ requirement }}
172 {%- endif -%}
173 </strong>
174 {%- if r.version -%}
175 {%- if r.name == "arch" %} architecture
176 {%- elsif r.name contains "maximum" %} &lt;= {{ r.version | escape }}
177 {%- else %} &gt;= {{ r.version | escape }}
178 {%- endif -%}
179 {%- endif -%}
180 {%- for c in r.contexts -%}
181 {%- if forloop.first %} ( {%- endif -%}
182 {{ c | escape }}
183 {%- unless forloop.last -%}, {% endunless -%}
184 {%- if forloop.last -%} ) {%- endif -%}
185 {%- endfor -%}
186 {%- unless forloop.last -%}, {% endunless -%}
187 {%- endfor %}
188 </p>
189 {%- endif -%}
191 {%- if f.conflicts_with.size > 0 %}
192 <p>Conflicts with:
193 {%- for conflict in f.conflicts_with %}
194 <strong><a href="{{ site.baseurl }}/formula/{{ conflict | uri_escape }}">{{ conflict | escape }}</a></strong>
195 {%- unless forloop.last -%}, {% endunless -%}
196 {%- endfor %}
197 </p>
198 {%- endif -%}
200 {%- if f.caveats -%}
201 {%- capture soft_indent %}
202 {% endcapture -%}
203 {%- capture hard_indent %}
204 &nbsp;&nbsp;&nbsp;&nbsp;{% endcapture %}
205 <table class="full-width">
206 <tr>
207 <td>{{ f.caveats | escape | replace: soft_indent, hard_indent | strip | newline_to_br }}</td>
208 </tr>
209 </table>
210 {%- endif -%}
212 <p>Analytics:</p>
213 <table>
214 {%- for interval in site.analytics.intervals -%}
215 {%- for category in site.analytics.categories.formulae -%}
216 {%- if forloop.parentloop.first == false and forloop.last -%}
217 {%- break -%}
218 {%- endif -%}
219 <tr>
220 <th colspan="2">{{ category.name }} ({{ interval.name }})</th>
221 </tr>
222 {%- for fa in site.data.analytics[category.path].homebrew-core[interval.path].formulae[fname] -%}
223 <tr>
224 <td><code>{{ fa.formula | escape }}</code></td>
225 <td class="number-data">{{ fa.count }}</td>
226 </tr>
227 {%- else -%}
228 <tr>
229 <td><code>{{ fname | escape }}</code></td>
230 <td class="number-data">0</td>
231 </tr>
232 {%- endfor -%}
233 {%- endfor -%}
234 {%- endfor %}
235 </table>