def to-divs [] { select 0 | transpose name value | each { | color | $"
($color.name) ($color.value)
" } | str join (char newline) } def make-code-block-divs [] { '

package com.orga.my.package;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.springframework.stereotype.Service;
import jakarta.validation.constraints.NotNull;

// DemoService: A chaotic showcase of every Java keyword and type
@Service
public final class DemoService implements DemoInterface {
  private static final String CONSTANT = "CONST";
  private transient volatile int counter = 0;
  private Map<Long, Double> cache;

  // Enum for no reason other than to flex
  public enum Mode { ON, OFF }

  // Record because Java loves new toys
  public record Data(byte b, short s) {}

  public synchronized void demo(@NotNull Object obj) throws Exception {
    assert obj != null : "Obj is null, you fool";
    var value = new Data((byte) 1, (short) 2);
    if (obj instanceof String str) {
      switch (str) {
        case "test" -> { yield true; }
        default -> { yield false; }
      }
    }
    else {
      for (int i = 0; i < 10; i++) {
        continue;
      }
    }
    while (counter < 5) {
      try {
        double result = Math.random();
        if (result > 0.5) break;
      } catch (Exception e) {
        throw new RuntimeException("Chaos", e);
      } finally {
        counter++;
      }
    }
    synchronized (this) {
      cache.put(1L, 42.0);
    }
    return;
  }

  // Abstract method in an interface for no reason
  interface DemoInterface {
    abstract void pointless();
  }

  // Module stuff because Java wants to be fancy
  module demo.module {
    requires java.base;
    exports com.orga.my.package;
    provides DemoInterface with DemoService;
  }
}
  
' } export def html [ theme: string ] { let palette = ( open $"output/($theme).toml" | get palette ) let palette_colors = ( $palette | reject content ui ) let content_colors = ( $palette | get content ) let ui_colors = ( $palette | get ui ) let global_color_divs = ( $palette_colors | to-divs ) let content_color_divs = ( $content_colors | to-divs ) let ui_color_divs = ( $ui_colors | to-divs ) let code_block_divs = make-code-block-divs let backdrop = if $theme == "dark" { "black" } else { "white" } let normal = if $theme == "dark" { "white" } else { "black" } $"

nugu color palette

global colors

($global_color_divs)

content colors

($content_color_divs)

ui colors

($ui_color_divs)

syntax example

($code_block_divs)
" }