From 8017402b1518cfea154af5dfe6b4e1d51045d6ea Mon Sep 17 00:00:00 2001 From: Seth Landry Date: Thu, 30 Jan 2025 07:21:36 -0600 Subject: [PATCH] Migrate to homebrew-core for Linux Related to #566 Separate macOS and Linux dependencies and caveats in formula pages. * Add separate tables for macOS and Linux 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). --- _layouts/formula.html | 39 ++++++++++++++++++++++++++++++++++++++ _layouts/formula_json.json | 8 ++++++++ 2 files changed, 47 insertions(+) diff --git a/_layouts/formula.html b/_layouts/formula.html index 711378446441..7afd00196668 100644 --- a/_layouts/formula.html +++ b/_layouts/formula.html @@ -233,3 +233,42 @@ {%- endfor -%} {%- endfor %} + + +{%- if f.variations.size > 0 -%} +

Dependencies:

+ + + + + + {%- for variation in f.variations -%} + + + + + {%- endfor -%} +
OSDependencies
{{ variation[0] | capitalize }} + {%- for dep in variation[1].dependencies -%} + {{ dep | escape }} + {%- unless forloop.last -%}, {% endunless -%} + {%- endfor -%} +
+{%- endif -%} + + +{%- if f.caveats -%} +

Caveats:

+ + + + + + {%- for variation in f.variations -%} + + + + + {%- endfor -%} +
OSCaveats
{{ variation[0] | capitalize }}{{ variation[1].caveats | escape }}
+{%- endif -%} diff --git a/_layouts/formula_json.json b/_layouts/formula_json.json index 8c1f96477822..d68b7d5d3e68 100644 --- a/_layouts/formula_json.json +++ b/_layouts/formula_json.json @@ -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" }}"}