Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions build/generate/featureMatrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"html"
"os"
"sort"
"strings"
Expand Down Expand Up @@ -85,16 +86,30 @@ func featureEmoji(
featureMap FeatureMap,
featureName string,
) string {
var emoji string
var tooltip string

if featureMap[featureName] == nil {
return "❔"
emoji = "❔"
tooltip = "Unknown"
} else if featureMap[featureName].HasFeature {
emoji = "✅"
tooltip = "Supported"
} else if featureMap[featureName].Unimplemented {
emoji = "❓"
tooltip = "Not implemented"
} else {
emoji = "❌"
tooltip = "Not supported"
}

if featureMap[featureName].HasFeature {
return "✅"
} else if featureMap[featureName].Unimplemented {
return "❔"
if featureMap[featureName] != nil && featureMap[featureName].Comment != "" {
emoji += " ⁱ"
tooltip += ": " + featureMap[featureName].Comment
}
return "❌"

escapedTooltip := strings.ReplaceAll(html.EscapeString(tooltip), "|", "|")
return fmt.Sprintf("<span title=\"%s\">%s</span>", escapedTooltip, emoji)
}

func matrixData() *FeatureMatrix {
Expand Down
Loading