[{"name":"SyntaxHighlight","comment":" Syntax highlighting in Elm.\n\n@docs HCode\n\n\n## Html view\n\n@docs toBlockHtml, toInlineHtml, toStaticBlockHtml, toStaticInlineHtml\n\n\n## Helpers\n\n@docs Highlight, highlightLines\n\n\n## Languages\n\nError while parsing should not happen. If it happens, please [open an issue](https://github.com/pablohirafuji/elm-syntax-highlight/issues) with the code that gives the error and the language.\n\n@docs css, elm, javascript, python, sql, xml, json, nix, kotlin, go, noLang\n\n\n## Themes\n\n@docs Theme, useTheme, monokai, gitHub, oneDark\n\n\n## Console view\n\n@docs ConsoleOptions, toConsole\n\n\n## Custom transformation\n\n@docs CustomTransform, toCustom\n\n\n## Internal\n\n@docs toHCode\n\n","unions":[{"name":"HCode","comment":" A highlighted code.\n","args":[],"cases":[]},{"name":"Highlight","comment":" Highlight type.\n\n  - `Highlight` will highlight the line in a way to differentiate it from the rest, like github's yellow background.\n  - `Add` will highlight in a manner that gives the ideia of new content added.\n  - `Del` will highlight in a manner that gives the ideia of removed content.\n\nThe specific styles will depend on the chosen `Theme`.\n\n","args":[],"cases":[["Highlight",[]],["Add",[]],["Del",[]]]},{"name":"Theme","comment":" A theme defines the background and syntax colors.\n","args":[],"cases":[]}],"aliases":[{"name":"ConsoleOptions","comment":" Console styling options.\nYou can use the [rtfeldman/console-print](http://package.elm-lang.org/packages/rtfeldman/console-print/latest) package to fill in the styles.\n\nThe common uses of the styles are the following:\n\n  - **default**: Default style\n  - **highlight**: Highlight style\n  - **addition**: Addition style\n  - **deletion**: Deletion style\n  - **comment**: Comment\n  - **style1**: Number\n  - **style2**: Literal string, attribute value\n  - **style3**: Keyword, tag, operator symbols (=+-\\*/...)\n  - **style4**: Keyword 2, group symbols ({}(),), type signature\n  - **style5**: Function, attribute name\n  - **style6**: Literal keyword, capitalized types\n  - **style7**: Argument, parameter\n\n","args":[],"type":"{ default : String.String -> String.String, highlight : String.String -> String.String, addition : String.String -> String.String, deletion : String.String -> String.String, comment : String.String -> String.String, style1 : String.String -> String.String, style2 : String.String -> String.String, style3 : String.String -> String.String, style4 : String.String -> String.String, style5 : String.String -> String.String, style6 : String.String -> String.String, style7 : String.String -> String.String }"},{"name":"CustomTransform","comment":" Custom transform options.\nThe common uses of the styles are the following:\n\n  - **noOperation**: No operation (aplly to the whole line)\n  - **highlight**: Highlight style (aplly to the whole line)\n  - **addition**: Addition style (aplly to the whole line)\n  - **deletion**: Deletion style (aplly to the whole line)\n  - **default**: Default style\n  - **comment**: Comment\n  - **style1**: Number\n  - **style2**: Literal string, attribute value\n  - **style3**: Keyword, tag, operator symbols (=+-\\*/...)\n  - **style4**: Keyword 2, group symbols ({}(),), type signature\n  - **style5**: Function, attribute name\n  - **style6**: Literal keyword, capitalized types\n  - **style7**: Argument, parameter\n\n","args":["fragment","line"],"type":"{ noOperation : List.List fragment -> line, highlight : List.List fragment -> line, addition : List.List fragment -> line, deletion : List.List fragment -> line, default : String.String -> fragment, comment : String.String -> fragment, style1 : String.String -> fragment, style2 : String.String -> fragment, style3 : String.String -> fragment, style4 : String.String -> fragment, style5 : String.String -> fragment, style6 : String.String -> fragment, style7 : String.String -> fragment }"}],"values":[{"name":"css","comment":" Parse CSS syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"elm","comment":" Parse Elm syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"gitHub","comment":" GitHub inspired theme.\n","type":"SyntaxHighlight.Theme"},{"name":"go","comment":" Parse Go syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"highlightLines","comment":" Highlight lines given a highlight type, start and end index.\nIf no highlight type is given (`Nothing`), it will remove any\nhighlight from the line range.\nNegative indexes are taken starting from the _end_ of the list.\n","type":"Maybe.Maybe SyntaxHighlight.Highlight -> Basics.Int -> Basics.Int -> SyntaxHighlight.HCode -> SyntaxHighlight.HCode"},{"name":"javascript","comment":" Parse Javascript syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"json","comment":" Parse JSON syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"kotlin","comment":" Parse Kotlin syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"monokai","comment":" Monokai inspired theme.\n","type":"SyntaxHighlight.Theme"},{"name":"nix","comment":" Parse Nix syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"noLang","comment":" Parse code from an unknown language with generic styling.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"oneDark","comment":" Atom One Dark inspired theme.\n","type":"SyntaxHighlight.Theme"},{"name":"python","comment":" Parse Python syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"sql","comment":" Parse SQL syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"toBlockHtml","comment":" Transform a highlighted code into a Html block.\nThe `Maybe Int` argument is for showing or not line count and, if so, starting from what number.\n","type":"Maybe.Maybe Basics.Int -> SyntaxHighlight.HCode -> Html.Html msg"},{"name":"toConsole","comment":" Transform a highlighted code into a list of console highlighted strings given the styling options defined by `ConsoleOptions`.\nEach string in the list is a line.\n","type":"SyntaxHighlight.ConsoleOptions -> SyntaxHighlight.HCode -> List.List String.String"},{"name":"toCustom","comment":" Transform a highlighted code into a list of anything you want. Each `line` in the list corresponds to a line in the original code.\n","type":"SyntaxHighlight.CustomTransform fragment line -> SyntaxHighlight.HCode -> List.List line"},{"name":"toHCode","comment":" This function is exposed for internal use only.\n","type":"List.List SyntaxHighlight.Line.Line -> SyntaxHighlight.HCode"},{"name":"toInlineHtml","comment":" Transform a highlighted code into inline Html.\n\n    import SyntaxHighlight exposing (elm, toInlineHtml)\n\n    info : Html msg\n    info =\n        p []\n            [ text \"This function signature \"\n            , elm \"isEmpty : String -> Bool\"\n                |> Result.map toInlineHtml\n                |> Result.withDefault\n                    (code [] [ text \"isEmpty : String -> Bool\" ])\n            , text \" means that a String argument is taken, then a Bool is returned.\"\n            ]\n\n","type":"SyntaxHighlight.HCode -> Html.Html msg"},{"name":"toStaticBlockHtml","comment":" Transform a highlighted code into a static (pure text) Html block. The `Maybe Int` argument is for showing or not line count and, if so, starting from what number.\n","type":"Maybe.Maybe Basics.Int -> SyntaxHighlight.HCode -> String.String"},{"name":"toStaticInlineHtml","comment":" Transform a highlighted code into static (pure text) inline Html.\n","type":"SyntaxHighlight.HCode -> String.String"},{"name":"useTheme","comment":" Transform a theme into Html. Any highlighted code transformed into Html in the same page will be themed according to the chosen `Theme`.\n\nTo preview the themes, check out the [demo](https://pablohirafuji.github.io/elm-syntax-highlight/).\n\n    import SyntaxHighlight exposing (elm, monokai, toBlockHtml, useTheme)\n\n    view : Model -> Html msg\n    view model =\n        div []\n            [ useTheme monokai\n            , elm model.elmCode\n                |> Result.map (toBlockHtml (Just 1))\n                |> Result.withDefault\n                    (pre [] [ code [] [ text model.elmCode ] ])\n            ]\n\nIf you prefer to use CSS external stylesheet, you do **not** need this,\njust copy the theme CSS into your stylesheet.\nAll themes can be found [here](https://pablohirafuji.github.io/elm-syntax-highlight/themes.html).\n\n","type":"SyntaxHighlight.Theme -> Html.Html msg"},{"name":"xml","comment":" Parse XML syntax.\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"}],"binops":[]},{"name":"SyntaxHighlight.Custom","comment":" You can highlight your own custom syntax by using this module!\n\n@docs fromParser\n\n\n## Fragments\n\n@docs Fragment\n\n@docs fragment, newline, setFragmentStyle, setFragmentClasses\n\n\n## Styles\n\n@docs Style\n\n@docs styleDefault, styleComment, style1, style2, style3, style4, style5, style6, style7\n\n","unions":[{"name":"Fragment","comment":" One single styled portion of custom parsed code. Construct using\n[`fragment`](#fragment) or [`newline`](#newline), and use it as the returned\nvalue of your parser when using [`fromParser`](#fromParser).\n","args":[],"cases":[]},{"name":"Style","comment":" The style of a `Fragment`, whose actual appearance is given by the theme\nthat is applied. Construct using the different `style*` definitions provided,\nand set it to a fragment using [`setFragmentStyle`](#setFragmentStyle).\n\n    import SyntaxHighlight.Custom as Custom\n\n    aKeywordFragment =\n        Custom.fragment \"case\"\n            |> Custom.setFragmentStyle Custom.style3\n\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"fragment","comment":" Constructs a `Fragment` value out of a part of the code you're parsing.\nTypically should represent one syntactic unit in the code, such as a string,\nan identifier, a keyword, an operator, whitespace, etc. You can add styling\ndetails to this `Fragment` using [`setFragmentStyle`](#setFragmentStyle) and\n[`setFragmentClasses`](#setFragmentClasses).\n\nCheck the [`fromParser`](#fromParser) documentation for an example.\n\n","type":"String.String -> SyntaxHighlight.Custom.Fragment"},{"name":"fromParser","comment":" Use a parser from [`elm/parser`][elm-parser] to define your own custom\nsyntax. Your parser must produce a list of [`Fragment`](#Fragment) values out of\nthe code string.\n\nHere's a small example, to give you an idea of how to write your syntax. You can\nalso check the [custom syntax example][example] in the repo.\n\n[elm-parser]: https://package.elm-lang.org/packages/elm/parser/latest/\n[example]: https://github.com/pablohirafuji/elm-syntax-highlight/blob/3.8.0/demo/src/CustomSyntax.elm\n\n    import Html\n    import Parser exposing (Parser)\n    import SyntaxHighlight\n    import SyntaxHighlight.Custom as Custom\n\n    viewHighlightedCustomSyntax : String -> Html msg\n    viewHighlightedCustomSyntax code =\n        code\n            |> Custom.fromParser parser\n            |> Result.map (SyntaxHighlight.toBlockHtml Nothing)\n            |> Result.withDefault (Html.text \"[Parser error]\")\n\n    parser : Parser (List Custom.Fragment)\n    parser =\n        -- This is just to demonstrate the kind of output\n        -- your parser can have. Please check the `elm/parser`\n        -- package to learn how to write a proper parser.\n        Parser.succeed\n            [ Custom.fragment \"2\"\n                |> Custom.setFragmentStyle Custom.style1\n            , Custom.fragment \" \"\n            , Custom.fragment \"+\"\n                |> Custom.setFragmentStyle Custom.style3\n                |> Custom.setFragmentClasses \"plus\"\n            , Custom.fragment \" \"\n            , Custom.fragment \"3\"\n                |> Custom.setFragmentStyle Custom.style1\n            ]\n\n","type":"Parser.Parser (List.List SyntaxHighlight.Custom.Fragment) -> String.String -> Result.Result (List.List Parser.DeadEnd) SyntaxHighlight.HCode"},{"name":"newline","comment":" A special kind of `Fragment`: a way to insert an explicit break\ninto a new line when parsing your code. You can optionally pass it a\n[`Highlight`](SyntaxHighlight#Highlight) value to change how the following line\nis rendered.\n\nPlease note that regular line breaks (`'\\n'`) in a fragment are interpreted\nthe same way as `newline Nothing`. So you don't really need to use this at all\nunless you want to highlight a line in your custom syntax code.\n\nHere's an example of how you can mark a line as “added” using this function.\n\n    import Parser\n    import SyntaxHighlight\n    import SyntaxHighlight.Custom as Custom\n\n    parser =\n        Parser.succeed\n            [ Custom.fragment \"first line\"\n            , Custom.newline (Some SyntaxHighlight.Add)\n            , Custom.fragment \"added line\"\n            , Custom.newline Nothing\n            , Custom.fragment \"normal line\"\n            ]\n\n","type":"Maybe.Maybe SyntaxHighlight.Highlight -> SyntaxHighlight.Custom.Fragment"},{"name":"setFragmentClasses","comment":" You can optionally use this function to give a [`Fragment`](#Fragment) one\nor more custom CSS classes (separated by spaces), if you want more control over\nhow you style your custom syntax.\n","type":"String.String -> SyntaxHighlight.Custom.Fragment -> SyntaxHighlight.Custom.Fragment"},{"name":"setFragmentStyle","comment":" Sets a specific [`Style`](#Style) to a [`Fragment`](#Fragment), which gives\nit a different color depending on the theme used.\n","type":"SyntaxHighlight.Custom.Style -> SyntaxHighlight.Custom.Fragment -> SyntaxHighlight.Custom.Fragment"},{"name":"style1","comment":" Style typically used for numbers.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style2","comment":" Style typically used for literal strings and attribute values.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style3","comment":" Style typically used for keywords, tags and operator symbols (`=+-*/`…).\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style4","comment":" Style typically used for keywords (alternative), group symbols (`{}(),`) and type signatures.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style5","comment":" Style typically used for functions and attribute names.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style6","comment":" Style typically used for literal keywords and capitalized types.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"style7","comment":" Style typically used for arguments and parameters.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"styleComment","comment":" Style specific for comments.\n","type":"SyntaxHighlight.Custom.Style"},{"name":"styleDefault","comment":" The default style for a fragment.\n","type":"SyntaxHighlight.Custom.Style"}],"binops":[]}]