elm-syntax-highlight

Syntax highlighting in Elm

Github stars Tracking Chart

Elm Syntax Highlight

Syntax highlighting in Elm. Demo.

Language support

Themes

You can define the theme either by copying and pasting the theme styles into your .css file or using the useTheme helper.

Copying and pasting the theme

All themes and required styles can be found here.

Using useTheme helper

Place the useTheme function with your chosen theme anywhere on your view.

import SyntaxHighlight exposing (useTheme, monokai, elm, toBlockHtml)

view : Model -> Html msg
view model =
    div []
        [ useTheme monokai
        , elm model.elmCode, > Result.map (toBlockHtml (Just 1)), > Result.withDefault
                (pre [] [ code [] [ text model.elmCode ]])
        ]

Thanks

Thank you Evan for bringing joy to the frontend.

Main metrics

Overview
Name With Ownerpablohirafuji/elm-syntax-highlight
Primary LanguageElm
Program languageElm (Language Count: 3)
Platform
License:Apache License 2.0
所有者活动
Created At2017-08-11 17:21:23
Pushed At2025-03-16 13:48:10
Last Commit At2025-03-16 10:47:29
Release Count16
Last Release Name3.7.1 (Posted on 2025-03-16 10:47:47)
First Release Name1.0.0 (Posted on 2017-08-25 03:16:44)
用户参与
Stargazers Count79
Watchers Count4
Fork Count16
Commits Count141
Has Issues Enabled
Issues Count15
Issue Open Count3
Pull Requests Count12
Pull Requests Open Count0
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private