Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-flavour mode with matrix generation #168

Closed
sgoudham opened this issue Apr 2, 2024 · 0 comments · Fixed by #169
Closed

Support multi-flavour mode with matrix generation #168

sgoudham opened this issue Apr 2, 2024 · 0 comments · Fixed by #169
Labels
enhancement New feature or request whiskers Issues relating to whiskers

Comments

@sgoudham
Copy link
Contributor

sgoudham commented Apr 2, 2024

Currently, it seems like the flavors object is not present when running in multi-flavour mode.

This is a use-case initially raised by @tecandrew (the current catppuccin/zed maintainer) where we're trying to generate all the configuration for 4 flavours but split them out into 2 separate variants and generate 2 files instead of 8.

Reproducible Template

---
whiskers:
  version: 2.0.0
  matrix:
    - variant: ["italics", "no-italics"]
  filename: "themes/catppuccin-{{ variant }}.json"
---

{% for _, flavor in flavors -%}
{{flavor.name}} {% if variant == "no-italics" %} (no italics){% endif %}
{% endfor %}

Actual Output

└ $ whiskers cava.tera
Error: Multi-output render failed

Caused by:
    0: Main template render failed
    1: Failed to render 'cava.tera'
    2: Variable `flavors` not found in context while rendering 'cava.tera'

Expected Output

Directory Structure:

themes/
	catppuccin-italics.json (contains rendered template for all 4 flavours)
	catppuccin-no-italics.json (contains rendered template for all 4 flavours)

catppuccin-italics.json

Latte
Frappé
Macchiato
Mocha

catppuccin-no-italics.json

Latte (no-italics)
Frappé  (no-italics)
Macchiato  (no-italics)
Mocha  (no-italics)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request whiskers Issues relating to whiskers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant