Skip to content

Commit

Permalink
Migrate to homebrew-core for Linux
Browse files Browse the repository at this point in the history
Fixes Homebrew#566

Separate macOS and Linux dependencies and caveats in formula pages.

* Add separate tables for macOS and Linux dependencies in `_layouts/formula.html`.
* Add a column indicating OS-specific differences in dependencies in `_layouts/formula.html`.
* Add separate sections for macOS and Linux caveats in `_layouts/formula.html`.
* Update the JSON structure in `_layouts/formula_json.json` to include separate macOS and Linux dependencies and caveats.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Homebrew/formulae.brew.sh/issues/566?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
Setland34 committed Jan 30, 2025
1 parent 2799586 commit 665ec00
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
39 changes: 39 additions & 0 deletions _layouts/formula.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,42 @@
{%- endfor -%}
{%- endfor %}
</table>

<!-- Separate tables for macOS and Linux dependencies -->
{%- if f.variations.size > 0 -%}
<p>Dependencies:</p>
<table>
<tr>
<th>OS</th>
<th>Dependencies</th>
</tr>
{%- for variation in f.variations -%}
<tr>
<td>{{ variation[0] | capitalize }}</td>
<td>
{%- for dep in variation[1].dependencies -%}
{{ dep | escape }}
{%- unless forloop.last -%}, {% endunless -%}
{%- endfor -%}
</td>
</tr>
{%- endfor -%}
</table>
{%- endif -%}

<!-- Separate sections for macOS and Linux caveats -->
{%- if f.caveats -%}
<p>Caveats:</p>
<table>
<tr>
<th>OS</th>
<th>Caveats</th>
</tr>
{%- for variation in f.variations -%}
<tr>
<td>{{ variation[0] | capitalize }}</td>
<td>{{ variation[1].caveats | escape }}</td>
</tr>
{%- endfor -%}
</table>
{%- endif -%}
8 changes: 8 additions & 0 deletions _layouts/formula_json.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@
{%- endunless -%}
{%- endfor -%}
},
"dependencies":{
"macos":{{ fdata.dependencies.macos | jsonify }},
"linux":{{ fdata.dependencies.linux | jsonify }}
},
"caveats":{
"macos":{{ fdata.caveats.macos | jsonify }},
"linux":{{ fdata.caveats.linux | jsonify }}
},
"generated_date":"{{ "today" | date: "%F" }}"}

0 comments on commit 665ec00

Please sign in to comment.