diff --git a/app/Commands/Html.hs b/app/Commands/Html.hs index 3590e99566..bc0d56900c 100644 --- a/app/Commands/Html.hs +++ b/app/Commands/Html.hs @@ -28,6 +28,7 @@ parseHtml = do <> value Ayu <> showDefault <> help "selects a theme: ayu (light); nord (dark)" + <> completeWith (map show allThemes) ) _htmlOutputDir <- option @@ -46,8 +47,10 @@ parseHtml = do ) pure HtmlOptions {..} where + allThemes :: [Theme] + allThemes = allElements parseTheme :: String -> Either String Theme - parseTheme s = case s of + parseTheme s = case map toLower s of "nord" -> Right Nord "ayu" -> Right Ayu _ -> Left $ "unrecognised theme: " <> s diff --git a/src/Juvix/Compiler/Backend/Html/Data/Theme.hs b/src/Juvix/Compiler/Backend/Html/Data/Theme.hs index 7ca5415cab..4b899e61a8 100644 --- a/src/Juvix/Compiler/Backend/Html/Data/Theme.hs +++ b/src/Juvix/Compiler/Backend/Html/Data/Theme.hs @@ -5,7 +5,7 @@ import Juvix.Prelude data Theme = Nord | Ayu - deriving stock (Show) + deriving stock (Show, Enum, Bounded) data HtmlKind = HtmlDoc