[{"name":"LaTeX.Export","comment":" Export XMarkdown source to LaTeX.\n\n@docs DocumentInfo\n@docs exportDocument, exportBody\n@docs imageUrls\n\n","unions":[],"aliases":[{"name":"DocumentInfo","comment":" Title-block information. Fields left empty are taken from the document's\n`%title` / `%author` / `%date` block, if it has one. When all fields end up\nempty, the document has no \\\\maketitle.\n","args":[],"type":"{ title : String.String, authors : List.List String.String, date : String.String }"}],"values":[{"name":"exportBody","comment":" The LaTeX for the document body only, with no preamble, for pasting into\nan existing LaTeX document.\n","type":"String.String -> String.String"},{"name":"exportDocument","comment":" A complete .tex document, ready for pdflatex once the images listed by\n`imageUrls` have been downloaded.\n","type":"LaTeX.Export.DocumentInfo -> String.String -> String.String"},{"name":"imageUrls","comment":" Every image in the document as (url, local path), in order and without\nduplicates. The exported LaTeX refers to the local paths; download each url\nto its path, relative to the .tex file.\n","type":"String.String -> List.List ( String.String, String.String )"}],"binops":[]},{"name":"Render.Theme","comment":" Light and dark theming for the XMarkdown renderer.\n\nThe compiler turns `CompilerParameters` into a [`RenderSettings`](#RenderSettings)\nrecord with [`makeSettings`](#makeSettings), and the `Render.*` modules read\ntheir sizes and colors from it. Applications that embed the editor (see the\n`DemoTOC+Sync` example) additionally read the raw [`ThemedStyles`](#ThemedStyles)\npalettes — [`lightTheme`](#lightTheme) / [`darkTheme`](#darkTheme) — and the\n[`themedColor`](#themedColor) helper to keep their own chrome in step with the\ndocument's current theme.\n\n\n# Render settings\n\nThe fully-resolved bundle of sizes and colors handed to every renderer.\n\n@docs RenderSettings, makeSettings, scaleFont\n\n\n# Theme palettes\n\n`ThemedStyles` is a raw color palette; `lightTheme` and `darkTheme` are the two\nbuilt-in instances, and `themedColor` looks up one field for a given theme,\nreturning a CSS color string.\n\n@docs ThemedStyles, lightTheme, darkTheme, themedColor\n\n","unions":[],"aliases":[{"name":"RenderSettings","comment":" Everything a renderer needs to lay out and color a document: sizes\n(`width`, `fontSize`, `titleSize`, spacing, margins), the resolved theme\ncolors (`textColor`, `backgroundColor`, `linkColor`, …), and the current\nselection/`theme`. Build one with [`makeSettings`](#makeSettings).\n","args":[],"type":"{ interBlockSpacing : Basics.Float, selectedId : String.String, display : Render.Theme.Display, selectedSlug : Maybe.Maybe String.String, showErrorMessages : Basics.Bool, showTOC : Basics.Bool, titleSize : Basics.Int, fontSize : Basics.Int, width : Basics.Int, listSpacing : Basics.Int, backgroundColor : Render.NewColor.Color, redColor : Render.NewColor.Color, textColor : Render.NewColor.Color, codeColor : Render.NewColor.Color, linkColor : Render.NewColor.Color, highlight : Render.NewColor.Color, codeBackground : Render.NewColor.Color, theme : XMarkdown.Types.Theme, margins : Basics.Int, leftIndentation : Basics.Int, numberToLevel : Basics.Int }"},{"name":"ThemedStyles","comment":" A raw color palette for one theme. Each field is an\n[`avh4/elm-color`](https://package.elm-lang.org/packages/avh4/elm-color/latest/)\n`Color`. See [`lightTheme`](#lightTheme) and [`darkTheme`](#darkTheme) for the\nbuilt-in instances, and [`themedColor`](#themedColor) to read a field as a CSS\nstring.\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, highlight : Render.NewColor.Color, border : Render.NewColor.Color, indentGuide : Render.NewColor.Color }"}],"values":[{"name":"darkTheme","comment":" A dark theme with a near-black background and light text.\n","type":"Render.Theme.ThemedStyles"},{"name":"lightTheme","comment":" A light theme with a white background and dark text.\n","type":"Render.Theme.ThemedStyles"},{"name":"makeSettings","comment":" Resolve a `CompilerParameters` into a [`RenderSettings`](#RenderSettings):\nscale the font/title sizes, parse the highlight color (falling back to the\ntheme), and pull the theme's colors for the chosen `theme`.\n","type":"XMarkdown.Types.CompilerParameters -> Render.Theme.RenderSettings"},{"name":"scaleFont","comment":" Scale a design-time font size by the document's `fontSize`, preserving the\nproportion the design size had to the reference body size. Use this in place of\na hardcoded `Font.size n` so all text scales with `settings.fontSize`.\n","type":"Render.Theme.RenderSettings -> Basics.Int -> Basics.Int"},{"name":"themedColor","comment":" Look up one palette field for a theme and render it as a CSS color string\n(`rgb(...)` or `rgba(...)`). Pass a `ThemedStyles` field accessor:\n\n    themedColor .background model.theme --> \"rgb(230, 230, 230)\"\n\n","type":"(Render.Theme.ThemedStyles -> Render.NewColor.Color) -> XMarkdown.Types.Theme -> String.String"}],"binops":[]},{"name":"XMarkdown.API","comment":" XMarkdown.API provides the core compilation interface for converting XMarkdown\nsource text into renderable Html. See [xmarkdowndemo.netlify.app](https://xmarkdowndemo.netlify.app/)\nfor a working example.\n\n\n# Overview\n\nThe simplest way to compile XMarkdown text is to use `compileString`, e.g.\n\n    compileString defaultCompilerParameters\n        \"# Mathematics\\n\\nPythagoras sez that $a^2 + b^2 = c^2$\"\n\nSee below for more information on compiler parameters. The DemoTOC and DemoTOC+Sync+Sync examples require a two-step workflow:\n(1) Compile source text into a CompilerOutput structure using the function `compileOutput`, (2) view the CompilerOutput structure using the function\n`viewBodyOnly` for the body of the text `viewTOC`, for the table of contents, etc.\n\n\n# Example\n\n        import XMarkdown.API\n        import XMarkdown.Types exposing (defaultCompilerParameters)\n\n\n        -- Configure compiler\n        params =\n            { defaultCompilerParameters\n                | docWidth = 600\n            }\n\n        -- Compile source text\n        output =\n            XMarkdown.API.compileOutput params\n              \"\"\"\n              # Introduction\"\n\n              XMarkdown can render mathematical formulas in **real time.**\n\n              ## Examples\n\n              Pythagoras says that $a^2 + b^2 = c^2$.\n              Integration of polynomials depends on the formula\n\n              $$\n              int x^n dx = frac(1,n+1) x^{n+1} + C\n              $$\n              \"\"\"\n\n\n# Compilation\n\n@docs compileOutput, compileString, compileStringWithTitle, defaultCompilerParameters\n\n\n# Viewing\n\n@docs viewEditor, viewBodyOnly, viewTOC, BlockMatch, fromMsgToSyncHighlight, renderedTextId, searchBlocksContainingText\n\n        -- Render the document body\n        body =\n            XMarkdown.API.viewBodyOnly 600 output\n\n        -- Render table of contents separately\n        toc =\n            XMarkdown.API.viewTOC output\n\n","unions":[],"aliases":[{"name":"BlockMatch","comment":" Re-export BlockMatch type for searching\n","args":[],"type":"XMarkdown.Compiler.BlockMatch"}],"values":[{"name":"compileOutput","comment":" Compile source text into a CompilerOutput structure.\n\nThis is the main compilation function that parses and processes XMarkdown source text.\nThe output contains the rendered body, optional banner, table of contents, and title,\nwhich can then be displayed using the view functions.\n\n","type":"XMarkdown.Types.CompilerParameters -> String.String -> XMarkdown.Types.CompilerOutput"},{"name":"compileString","comment":" ","type":"XMarkdown.Types.CompilerParameters -> String.String -> List.List (Html.Html XMarkdown.Types.MarkupMsg)"},{"name":"compileStringWithTitle","comment":" ","type":"String.String -> XMarkdown.Types.CompilerParameters -> String.String -> List.List (Html.Html XMarkdown.Types.MarkupMsg)"},{"name":"defaultCompilerParameters","comment":" defaultCompilerParameters =\n{ docWidth = 500\n, editCount = 0\n, selectedId = \"\"\n, selectedSlug = Nothing\n, theme = Light\n, backgroundColor = \"rgba(255, 255, 255, 1.0)\"\n, highlightColor = \"rgba(200, 200, 255, 0.4)\"\n, paddingAboveHeadings = 10\n, interBlockSpacing = 0\n, lineHeight = 1.5\n, fontSize = 16\n, windowWidth = 500\n, scale = 1\n, numberToLevel = 0\n, data = Dict.empty\n}\n","type":"XMarkdown.Types.CompilerParameters"},{"name":"fromMsgToSyncHighlight","comment":" ","type":"Basics.Int -> XMarkdown.Types.MarkupMsg -> Maybe.Maybe XMarkdown.Types.SyncHighlight"},{"name":"renderedTextId","comment":" ","type":"String.String"},{"name":"searchBlocksContainingText","comment":" Search blocks in the document for text containing the search query.\n\nReturns a list of matching blocks with their metadata (id, lineNumber, numberOfLines, sourceText).\nThe search is case-insensitive.\n\n    matches =\n        searchBlocksContainingText params (String.lines sourceText) \"hello\"\n\n","type":"XMarkdown.Types.CompilerParameters -> List.List String.String -> String.String -> List.List XMarkdown.API.BlockMatch"},{"name":"viewBodyOnly","comment":" Render only the body content from a CompilerOutput.\n\nTakes a width parameter (in pixels) and returns a list of Html elements\nrepresenting the document body without the title or banner.\n\n    body =\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 -> XMarkdown.Types.CompilerOutput -> List.List (Html.Html XMarkdown.Types.MarkupMsg)"},{"name":"viewEditor","comment":" ","type":"XMarkdown.Editor.Config msg -> Html.Html msg"},{"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    toc =\n        viewTOC output\n\nThe table of contents automatically includes links to document sections and\nrespects the document hierarchy.\n\n","type":"XMarkdown.Types.CompilerOutput -> List.List (Html.Html XMarkdown.Types.MarkupMsg)"}],"binops":[]},{"name":"XMarkdown.Types","comment":" This module defines the core types used for configuring the Scripta compiler.\nThe main type is `CompilerParameters`, which controls how XMarkdown source text\nis compiled and rendered.\n\n\n# Configuration\n\n@docs CompilerParameters, defaultCompilerParameters\n\n\n## Key Parameters\n\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\n\n## Usage\n\nFor simple use cases, start with `defaultCompilerParameters` and override the fields you need:\n\n    { defaultCompilerParameters\n        | docWidth = 600\n        , editCount = model.editCount\n    }\n\n@docs CompilerOutput, Handling, MarkupMsg, SyncHighlight, Theme\n\n","unions":[{"name":"Handling","comment":" How to handle a MarkupMsg.\n","args":[],"cases":[["MHStandard",[]],["MHAsCheatSheet",[]]]},{"name":"MarkupMsg","comment":" Messages from rendered markup for synchronization with the editor.\nUsed for rendered-to-source syncing (e.g., clicking rendered text highlights source).\n","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"]],["HighlightId",["String.String"]],["JumpToTop",[]],["MMNoOp",[]]]},{"name":"Theme","comment":" Represents the available themes.\n","args":[],"cases":[["Light",[]],["Dark",[]]]}],"aliases":[{"name":"CompilerOutput","comment":" ","args":[],"type":"{ body : List.List (Html.Html XMarkdown.Types.MarkupMsg), banner : Maybe.Maybe (Html.Html XMarkdown.Types.MarkupMsg), toc : List.List (Html.Html XMarkdown.Types.MarkupMsg), title : Html.Html XMarkdown.Types.MarkupMsg, interBlockSpacing : Basics.Float }"},{"name":"CompilerParameters","comment":" ","args":[],"type":"{ windowWidth : Basics.Int, scale : Basics.Float, docWidth : Basics.Int, editCount : Basics.Int, selectedId : String.String, selectedSlug : Maybe.Maybe String.String, theme : XMarkdown.Types.Theme, backgroundColor : String.String, highlightColor : String.String, paddingAboveHeadings : Basics.Float, interBlockSpacing : Basics.Float, lineHeight : Basics.Float, fontSize : Basics.Int, numberToLevel : Basics.Int, data : Dict.Dict String.String String.String }"},{"name":"SyncHighlight","comment":" A source span to highlight in the editor.\n\n  - `mode = \"chars\"`: `start`/`end` are document character offsets (`end` exclusive).\n    Used for inline (phrase) clicks.\n  - `mode = \"lines\"`: `start`/`end` are 1-indexed source lines, both inclusive.\n    Used for block clicks.\n  - `tick` is a monotonic counter so repeat clicks on the same span re-trigger the editor.\n\n","args":[],"type":"{ mode : String.String, start : Basics.Int, end : Basics.Int, tick : Basics.Int }"}],"values":[{"name":"defaultCompilerParameters","comment":" ","type":"XMarkdown.Types.CompilerParameters"}],"binops":[]}]