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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

沒有收錄該擁有者的更多項目. 推荐一個?