elm-syntax-highlight

Syntax highlighting in Elm

Github星跟踪图

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.

主要指标

概览
名称与所有者pablohirafuji/elm-syntax-highlight
主编程语言Elm
编程语言Elm (语言数: 3)
平台
许可证Apache License 2.0
所有者活动
创建于2017-08-11 17:21:23
推送于2025-03-16 13:48:10
最后一次提交2025-03-16 10:47:29
发布数16
最新版本名称3.7.1 (发布于 2025-03-16 10:47:47)
第一版名称1.0.0 (发布于 2017-08-25 03:16:44)
用户参与
星数79
关注者数4
派生数16
提交数141
已启用问题?
问题数15
打开的问题数3
拉请求数12
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?