[{"name":"Render.Theme","comment":" Theme support for Scripta rendering.\n\nThis module provides light and dark themes for rendering Scripta documents,\nwith support for both raw Color values and elm-ui Element.Color.\n\n\n# Types\n\n@docs Theme, ActualTheme\n\n\n# Theme Selection\n\n@docs getColor, getElementColor\n\n\n# Predefined Themes\n\n@docs lightTheme, darkTheme\n\n","unions":[{"name":"Theme","comment":" Represents the available themes.\n","args":[],"cases":[["Light",[]],["Dark",[]]]}],"aliases":[{"name":"ActualTheme","comment":" A theme's color palette, containing colors for various UI elements.\n","args":[],"type":"{ background : Render.NewColor.Color, text : Render.NewColor.Color, codeBackground : Render.NewColor.Color, codeText : Render.NewColor.Color, offsetBackground : Render.NewColor.Color, offsetText : Render.NewColor.Color, link : Render.NewColor.Color, footnote : Render.NewColor.Color, highlight : Render.NewColor.Color }"}],"values":[{"name":"darkTheme","comment":" The predefined dark theme with reduced eye strain for low-light environments.\n","type":"Render.Theme.ActualTheme"},{"name":"getColor","comment":" Get a Color value from the selected theme.\n\n    myTextColor =\n        getColor Light .text\n\n","type":"Render.Theme.Theme -> (Render.Theme.ActualTheme -> Render.NewColor.Color) -> Render.NewColor.Color"},{"name":"getElementColor","comment":" Get an Element.Color value from the selected theme.\nThis is useful when working with elm-ui.\n\n    myBackgroundColor =\n        getElementColor Dark .background\n\n","type":"Render.Theme.Theme -> (Render.Theme.ActualTheme -> Render.NewColor.Color) -> Element.Color"},{"name":"lightTheme","comment":" The predefined light theme with professional, readable colors.\n","type":"Render.Theme.ActualTheme"}],"binops":[]},{"name":"ScriptaV2.API","comment":" ScriptaV2.API provides the core compilation interface for converting markup text\ninto renderable elm-ui Elements. This module supports three markup languages:\nMicroLaTeX, SMarkdown/XMarkdown, and Enclosure/L0.\n\n\n# Overview\n\nThe API follows a two-step workflow:\n\n1.  **Compile** source text into a `CompilerOutput` using `compileOutput`\n2.  **View** the compiled output using `viewBodyOnly` or `viewTOC`\n\nThis separation allows you to compile once and render different parts (body, table\nof contents) independently, which is useful for building rich document viewers with\nnavigation panels.\n\n\n# Compilation\n\n@docs compileOutput\n\n\n# Viewing\n\n@docs viewBodyOnly, viewTOC\n\n\n# Usage Example\n\n    import ScriptaV2.API\n    import ScriptaV2.Types exposing (defaultCompilerParameters)\n    import ScriptaV2.Language exposing (Language(..))\n\n    -- Configure compiler\n    params =\n        { defaultCompilerParameters\n            | lang = MicroLaTeXLang\n            , docWidth = 600\n            , editCount = 0\n        }\n\n    -- Compile source text\n    output =\n        ScriptaV2.API.compileOutput params\n            [ \"\\\\section{Introduction}\"\n            , \"This is a document with \\\\strong{bold} text.\"\n            , \"\"\n            , \"\\\\subsection{Details}\"\n            , \"More content here.\"\n            ]\n\n    -- Render the document body\n    bodyElements =\n        ScriptaV2.API.viewBodyOnly 600 output\n\n    -- Render table of contents separately\n    tocElements =\n        ScriptaV2.API.viewTOC output\n\n\n# Supported Languages\n\n  - **MicroLaTeXLang** - LaTeX-like syntax with mathematical expressions via KaTeX\n  - **SMarkdownLang** - Extended Markdown with scientific notation support\n  - **EnclosureLang** - L0 language with bracket-based syntax\n  - **MarkdownLang** - Standard Markdown (currently handled as SMarkdown)\n\n\n# See Also\n\nFor a simpler API that handles both compilation and rendering in one step,\nsee `ScriptaV2.APISimple`.\n\n","unions":[],"aliases":[],"values":[{"name":"compileOutput","comment":" Compile source text into a CompilerOutput structure.\n\nThis is the main compilation function that parses and processes markup text according\nto the language specified in `CompilerParameters`. The output contains the rendered\nbody, optional banner, table of contents, and title, which can then be displayed\nusing the view functions.\n\n    params =\n        { defaultCompilerParameters\n            | lang = MicroLaTeXLang\n            , docWidth = 600\n        }\n\n    output =\n        compileOutput params\n            [ \"\\\\title{My Document}\"\n            , \"\\\\section{Introduction}\"\n            , \"Content here.\"\n            ]\n\nThe language field in CompilerParameters determines which parser to use:\n\n  - MicroLaTeXLang → MicroLaTeX parser\n  - SMarkdownLang/MarkdownLang → XMarkdown parser\n  - EnclosureLang → L0/Enclosure parser\n\n","type":"ScriptaV2.Types.CompilerParameters -> List.List String.String -> ScriptaV2.Compiler.CompilerOutput"},{"name":"viewBodyOnly","comment":" Render only the body content from a CompilerOutput.\n\nTakes a width parameter (in pixels) and returns a list of elm-ui Elements\nrepresenting the document body without the title or banner.\n\n    bodyElements =\n        viewBodyOnly 600 output\n\nThis is useful when you want to display the main content separately from other\ndocument parts like the table of contents or title.\n\n","type":"Basics.Int -> ScriptaV2.Compiler.CompilerOutput -> List.List (Element.Element ScriptaV2.Msg.MarkupMsg)"},{"name":"viewTOC","comment":" Render the table of contents from a CompilerOutput.\n\nGenerates a navigable table of contents based on the document structure\n(sections, subsections, etc.).\n\n    tocElements =\n        viewTOC output\n\nThe table of contents automatically includes links to document sections and\nrespects the document hierarchy.\n\n","type":"ScriptaV2.Compiler.CompilerOutput -> List.List (Element.Element ScriptaV2.Msg.MarkupMsg)"}],"binops":[]},{"name":"ScriptaV2.APISimple","comment":" Use `ScriptaV2.APISimple.compile` to transform source text to elm-ui HTML for the given markup language.\nYou will need the following imports in your Elm file:\n\n    import ScriptaV2.APISimple\n    import ScriptaV2.Msg exposing (MarkupMsg)\n    import ScriptaV2.Language exposing (Language)\n    import Element exposing (Element)\n\nYour `Msg` type definition should read:\n\n    type Msg\n        =  ...\n        | Render MarkupMsg\n\nThe choice of language is made from\n\n    type Language\n        = MicroLaTeXLang\n        | EnclosureLang\n        | SMarkdownLang\n\nin ScriptaV2.Language\n\n@docs compile\n\n","unions":[],"aliases":[],"values":[{"name":"compile","comment":" Compile source text to elm-ui HTML. The width of the rendered text in pixels is\ndefined by docWidth. The editCount should be 0 for a static document. For documents\nin a live editing context, the editCount should be increment after each edit.\nThis ensures that the rendered text is properly updated.\n","type":"ScriptaV2.Types.CompilerParameters -> String.String -> List.List (Element.Element ScriptaV2.Msg.MarkupMsg)"}],"binops":[]},{"name":"ScriptaV2.Language","comment":"\n\n@docs Language, ExpressionBlock, toString\n\n","unions":[{"name":"Language","comment":" ","args":[],"cases":[["MicroLaTeXLang",[]],["EnclosureLang",[]],["SMarkdownLang",[]],["MarkdownLang",[]]]}],"aliases":[{"name":"ExpressionBlock","comment":" ","args":[],"type":"Generic.Language.ExpressionBlock"}],"values":[{"name":"toString","comment":" ","type":"ScriptaV2.Language.Language -> String.String"}],"binops":[]},{"name":"ScriptaV2.Msg","comment":" The ScriptaV2.Msg.MarkupMsg type is need for synchronization of the source and rendered\ntext when using the Codemirror editor.\n\n@docs MarkupMsg, SolutionState, Handling\n\n","unions":[{"name":"Handling","comment":" ","args":[],"cases":[["MHStandard",[]],["MHAsCheatSheet",[]]]},{"name":"MarkupMsg","comment":" ","args":[],"cases":[["SendMeta",["{ begin : Basics.Int, end : Basics.Int, index : Basics.Int, id : String.String }"]],["SendLineNumber",["{ begin : Basics.Int, end : Basics.Int }"]],["SelectId",["String.String"]],["ToggleTOCNodeID",["String.String"]],["HighlightId",["String.String"]],["GetPublicDocument",["ScriptaV2.Msg.Handling","String.String"]],["GetPublicDocumentFromAuthor",["ScriptaV2.Msg.Handling","String.String","String.String"]],["GetDocumentWithSlug",["ScriptaV2.Msg.Handling","String.String"]],["ProposeSolution",["ScriptaV2.Msg.SolutionState"]],["RequestCopyOfDocument",[]],["RequestToggleIndexSize",[]],["JumpToTop",[]],["LoadFile",["String.String","String.String"]],["NewPost",["String.String"]],["MMNoOp",[]]]},{"name":"SolutionState","comment":" ","args":[],"cases":[["Unsolved",[]],["Solved",["String.String"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"ScriptaV2.Types","comment":" This module defines the core types used for configuring the Scripta compiler.\nThe main type is `CompilerParameters`, which controls how source text is compiled\nand rendered across all supported markup languages (MicroLaTeX, SMarkdown, L0/Enclosure).\n\n\n# Configuration\n\n@docs CompilerParameters, defaultCompilerParameters, Filter\n\n\n## Key Parameters\n\n  - **lang**: The markup language to compile (MicroLaTeX, SMarkdown, or Enclosure)\n  - **docWidth**: Width of the rendered document in pixels\n  - **editCount**: Increment this after each edit for live editing contexts (use 0 for static documents)\n  - **selectedId**: ID of the currently selected block for highlighting\n  - **theme**: Visual theme (Light or Dark)\n  - **idsOfOpenNodes**: List of IDs for expanded/collapsed sections\n\n\n## Usage\n\nFor simple use cases, start with `defaultCompilerParameters` and override the fields you need:\n\n    { defaultCompilerParameters\n        | lang = ScriptaV2.Language.MicroLaTeXLang\n        , docWidth = 600\n        , editCount = model.editCount\n    }\n\n","unions":[{"name":"Filter","comment":" ","args":[],"cases":[["NoFilter",[]],["SuppressDocumentBlocks",[]]]}],"aliases":[{"name":"CompilerParameters","comment":" ","args":[],"type":"{ windowWidth : Basics.Int, scale : Basics.Float, lang : ScriptaV2.Language.Language, docWidth : Basics.Int, editCount : Basics.Int, selectedId : String.String, selectedSlug : Maybe.Maybe String.String, idsOfOpenNodes : List.List String.String, filter : ScriptaV2.Types.Filter, theme : Render.Theme.Theme, longEquationLimit : Basics.Float, numberToLevel : Basics.Int, data : Dict.Dict String.String String.String }"}],"values":[{"name":"defaultCompilerParameters","comment":" ","type":"ScriptaV2.Types.CompilerParameters"}],"binops":[]}]