[{"name":"MiniLatex.Differ","comment":" This module is used to speed up parsing-rendering by\ncomparing the old and new lists of paragraphs, noting the changes,\nthen parsing and rendering the changed paragraphs.\n\n\n# API\n\n@docs EditRecord, emptyStringRecord, emptyHtmlMsgRecord, isEmpty, createRecord, diff, prefixer, update\n\n","unions":[],"aliases":[{"name":"EditRecord","comment":" An EditRecord records a list of (logical) newParagraphs\ncorrespoing to the text to be rendered as well as corresponding\nlist of rendered parapgraphs. We need to reveiw this strucure.\n","args":["a"],"type":"{ paragraphs : List.List String.String, renderedParagraphs : List.List a, latexState : MiniLatex.LatexState.LatexState, idList : List.List String.String, newIdsStart : Maybe.Maybe Basics.Int, newIdsEnd : Maybe.Maybe Basics.Int }"}],"values":[{"name":"createRecord","comment":" createRecord: Create an edit record by (1)\nbreaking the text in to pargraphs, (2) applying\nthe transformer to each string in the resulting\nlist of strings.\n","type":"(String.String -> a) -> String.String -> MiniLatex.Differ.EditRecord a"},{"name":"diff","comment":" Let u and v be two lists of strings. Write them as\nu = axb, v = ayb, where a is the greatest common prefix\nand b is the greatest common suffix. Return DiffRecord a b x y\n","type":"List.List String.String -> List.List String.String -> MiniLatex.Differ.DiffRecord"},{"name":"emptyHtmlMsgRecord","comment":" An empty EditRecord -- like the integer 0 in another context. For\nrenderers with `Html a` as target.\n","type":"MiniLatex.Differ.EditRecord (Html.Html msg)"},{"name":"emptyStringRecord","comment":" An empty EditRecord -- like the integer 0 in another context.\n","type":"MiniLatex.Differ.EditRecord String.String"},{"name":"isEmpty","comment":" An EditRecord is considered to be empyt if its list of parapgraphs\nand its list of rendered paraagrahs is empty\n","type":"MiniLatex.Differ.EditRecord a -> Basics.Bool"},{"name":"prefixer","comment":" The prefixer is used to generate unique id's \"p.1\", \"p.2\", etc.\nfor each paragraph.\n","type":"Basics.Int -> Basics.Int -> String.String"},{"name":"update","comment":" The update function takes an EditRecord and a string, the \"text\",\nbreaks the text into a list of logical paragraphs, diffs it with the list\nof paragraphs held by the EditRecord, uses `differentialRender` to\nrender the changed paragraphs while copying the unchanged rendered paragraphsto\nprodduce an updated list of rendered paragraphs. The 'differentialRender'\naccomplishes this using the transformer. The seed is used to produces\na differential idList. This last step is perhaps unnecessary. To investigate.\n(This was part of an optimization scheme.)\n","type":"Basics.Int -> (String.String -> a) -> MiniLatex.Differ.EditRecord a -> String.String -> MiniLatex.Differ.EditRecord a"}],"binops":[]},{"name":"MiniLatex.FastExportToLatex","comment":" This module is for quickly preparing latex for export.\n\n\n# API\n\n@docs export\n\n","unions":[],"aliases":[],"values":[{"name":"export","comment":" Tranform MiniLatex text into Latex text.\n","type":"String.String -> String.String"}],"binops":[]},{"name":"MiniLatex.HasMath","comment":" This module is for determining whether the Latex\nhas mathmode t4ext\n\n\n# API\n\n@docs hasMath, listHasMath\n\n","unions":[],"aliases":[],"values":[{"name":"hasMath","comment":" Determine whether a LatexExpression has math text in it\n","type":"MiniLatex.Parser.LatexExpression -> Basics.Bool"},{"name":"listHasMath","comment":" Determine whether a (List LatexExpression) has math text in it\n","type":"List.List MiniLatex.Parser.LatexExpression -> Basics.Bool"}],"binops":[]},{"name":"MiniLatex.MiniLatex","comment":" This library exposes functions for rendering MiniLaTeX text into HTML.\nMost users will need only (1) the functions exposed in the `MiniLatex` module\nand (2) `EditRecord`, which is exposed in the `Differ` module.\n\nSee [MiniLatex Live](https://jxxcarlson.github.io/app/miniLatexLive/index.html)\nfor a no-login demo of the MiniLatex technology. [Source code](https://github.com/jxxcarlson/MiniLatexLive)\n\nSee this [Hackernoon article](https://hackernoon.com/towards-latex-in-the-browser-2ff4d94a0c08)\nfor an explanation of the theory behind the MiniLatex package.\n\n\n# API\n\n@docs render, initializeEditRecord, getRenderedText, parse, updateEditRecord, emptyStringRecord\n\n","unions":[],"aliases":[],"values":[{"name":"emptyStringRecord","comment":" Return an empty EditRecord\n\n        { paragraphs = []\n        , renderedParagraphs = []\n        , latexState =\n            { counters =\n                Dict.fromList\n                    [ ( \"eqno\", 0 )\n                    , ( \"s1\", 0 )\n                    , ( \"s2\", 0 )\n                    , ( \"s3\", 0 )\n                    , ( \"tno\", 0 )\n                    ]\n            , crossReferences = Dict.fromList []\n            }\n        , idList = []\n        , idListStart = 0\n        }\n\n","type":"MiniLatex.Differ.EditRecord (Html.Html msg)"},{"name":"getRenderedText","comment":" Using the renderedParagraph list of the editRecord,\nreturn an HTML element represeing the paragraph list\nof the editRecord.\n","type":"MiniLatex.Differ.EditRecord (Html.Html msg) -> List.List (Html.Html msg)"},{"name":"initializeEditRecord","comment":" Create an EditRecord from a string of MiniLaTeX text.\nThe `seed` is used for creating id's for rendered paragraphs\nin order to help Elm's runtime optimize diffing for rendering\ntext.\n\n> editRecord = MiniLatex.initialize source\n\n        { paragraphs =\n            [ \"\\\\italic{Test:}\\n\\n\"\n            , \"$$a^2 + b^2 = c^2$$\\n\\n\"\n            , \"\\\\strong{Q.E.D.}\\n\\n\"\n            ]\n        , renderedParagraphs = ((an Html msg value representing))\n            [ \"  <span class=italic>Test:</span>\"\n            , \" $$a^2 + b^2 = c^2$$\"\n            , \"  <span class=\\\"strong\\\">Q.E.D.</span> \"\n            ]\n        , latexState =\n            { counters =\n                Dict.fromList\n                    [ ( \"eqno\", 0 )\n                    , ( \"s1\", 0 )\n                    , ( \"s2\", 0 )\n                    , ( \"s3\", 0 )\n                    , ( \"tno\", 0 )\n                    ]\n            , crossReferences = Dict.fromList []\n            }\n        , idList = []\n        , idListStart = 0\n        } : MiniLatex.Differ.EditRecord\n\n","type":"Basics.Int -> String.String -> MiniLatex.Differ.EditRecord (Html.Html msg)"},{"name":"parse","comment":" Parse the given text and return an AST represeting it.\n\nExample:\n\n> import MiniLatex.MiniLatex exposing(parse)\n> parse \"This \\\\strong{is a test!}\"\n> [[LXString (\"This \"),Macro \"strong\" [][LatexList [LXString (\"is  a  test!\")]]][LXString (\"This \"),Macro \"strong\" [] [LatexList [LXString (\"is  a  test!\")]]]][[LXString (\"This \"),Macro \"strong\" [] [LatexList [LXString (\"is  a  test!\")]]]]\n\n","type":"String.String -> List.List (List.List MiniLatex.Parser.LatexExpression)"},{"name":"render","comment":" The function call `render macros sourceTest` produces\nan HTML element corresponding to the MiniLatex source text\n`sourceText`. The macro definitions in `macros`\nare prepended to this string and are used by MathJax\nto render purely mathematical text. The `macros` string\nmay be empty. Thus, if\n\nmacros = \"\"\nsource = \"\\\\italic{Test:}\\\\n\\\\n$$a^2 + b^2 = c^2$$\\\\n\\\\n\\\\strong{Q.E.D.}\"\n\nthen `render macros source` yields an HTML msg value\nrepresenting the HTML text\n\n    <p>\n    <span class=italic>Test:</span></p>\n      <p>\n        $$a^2 + b^2 = c^2$$\n      </p>\n    <p>\n\n    <span class=\"strong\">Q.E.D.</span>\n    </p>\n\n","type":"String.String -> String.String -> Html.Html msg"},{"name":"updateEditRecord","comment":" Update the given edit record with modified text.\nThus, if\n\n    source2 = \"\\italic{Test:}\\n\\n$$a^3 + b^3 = c^3$$\\n\\n\\strong{Q.E.D.}\"\n\nthen we can say\n\neditRecord2 = updateEditRecord 0 source2 editRecord\n\nThe `updateEditRecord` function attempts to re-render only the (logical) aragraphs\nwhich have been changed. It will always update the text correctly,\nbut its efficiency depends on the nature of the edit. This is\nbecause the \"differ\" used to detect changes is rather crude.\n\n","type":"Basics.Int -> MiniLatex.Differ.EditRecord (Html.Html msg) -> String.String -> MiniLatex.Differ.EditRecord (Html.Html msg)"}],"binops":[]},{"name":"MiniLatex.Parser","comment":" This module is for quickly preparing latex for export.\n\n\n# API\n\n@docs LatexExpression, macro, parse, defaultLatexList\n@docs latexList, endWord, envName, word, latexExpression\n\n","unions":[{"name":"LatexExpression","comment":" The type for the Abstract syntax tree\n","args":[],"cases":[["LXString",["String.String"]],["Comment",["String.String"]],["Item",["Basics.Int","MiniLatex.Parser.LatexExpression"]],["InlineMath",["String.String"]],["DisplayMath",["String.String"]],["SMacro",["String.String","List.List MiniLatex.Parser.LatexExpression","List.List MiniLatex.Parser.LatexExpression","MiniLatex.Parser.LatexExpression"]],["Macro",["String.String","List.List MiniLatex.Parser.LatexExpression","List.List MiniLatex.Parser.LatexExpression"]],["Environment",["String.String","List.List MiniLatex.Parser.LatexExpression","MiniLatex.Parser.LatexExpression"]],["LatexList",["List.List MiniLatex.Parser.LatexExpression"]],["LXError",["List.List Parser.DeadEnd"]]]}],"aliases":[],"values":[{"name":"defaultLatexList","comment":" A default value of type LatexExpression\n","type":"MiniLatex.Parser.LatexExpression"},{"name":"endWord","comment":" Use to parse begin ... end blocks\n","type":"Parser.Parser String.String"},{"name":"envName","comment":" Capture the name of the environment in\na \\\\begin{ENV} ... \\\\end{ENV}\npair\n","type":"Parser.Parser String.String"},{"name":"latexExpression","comment":" Production: $ LatexExpression &\\\\Rightarrow Words\\\\ |\\\\ Comment\\\\ |\\\\ IMath\\\\ |\\\\ DMath\\\\ |\\\\ Macro\\\\ |\\\\ Env $\n","type":"Parser.Parser MiniLatex.Parser.LatexExpression"},{"name":"latexList","comment":" Production: $ LatexList &\\\\Rightarrow LatexExpression^+ $\n","type":"Parser.Parser MiniLatex.Parser.LatexExpression"},{"name":"macro","comment":" Parse the macro keyword followed by\nzero or more optional follwed by zero or more more eventual nominnees.\n","type":"Parser.Parser () -> Parser.Parser MiniLatex.Parser.LatexExpression"},{"name":"parse","comment":" Transform a string into a list of LatexExpressions\n","type":"String.String -> List.List MiniLatex.Parser.LatexExpression"},{"name":"word","comment":" Use `inWord` to parse a word.\n","type":"(Char.Char -> Basics.Bool) -> Parser.Parser String.String"}],"binops":[]},{"name":"MiniLatex.Render","comment":" This module is for quickly preparing latex for export.\n\n\n# API\n\n@docs makeTableOfContents, render, renderLatexList, renderString, renderArg, transformText\n\n","unions":[],"aliases":[],"values":[{"name":"makeTableOfContents","comment":" Build a table of contents from the\ncurrent LatexState\n","type":"MiniLatex.LatexState.LatexState -> String.String"},{"name":"render","comment":" The main rendering funcction. Compute an Html msg value\nfrom the current LatexState and a LatexExpresssion.\n","type":"MiniLatex.LatexState.LatexState -> MiniLatex.Parser.LatexExpression -> String.String"},{"name":"renderArg","comment":" render an argument ","type":"Basics.Int -> MiniLatex.LatexState.LatexState -> List.List MiniLatex.Parser.LatexExpression -> String.String"},{"name":"renderLatexList","comment":" Like `render`, but renders a list of LatexExpressions\nto Html mgs\n","type":"MiniLatex.LatexState.LatexState -> List.List MiniLatex.Parser.LatexExpression -> String.String"},{"name":"renderString","comment":" Parse a string, then render it.\n","type":"Parser.Parser MiniLatex.Parser.LatexExpression -> MiniLatex.LatexState.LatexState -> String.String -> String.String"},{"name":"transformText","comment":" render a string representing Latex text into a string representing Html text\ngiven a LatexState\n","type":"MiniLatex.LatexState.LatexState -> String.String -> String.String"}],"binops":[]},{"name":"MiniLatex.Render2","comment":" This module is for quickly preparing latex for export.\n\n\n# API\n\n@docs makeTableOfContents, render, renderLatexList, renderString\n\n","unions":[],"aliases":[],"values":[{"name":"makeTableOfContents","comment":" Build a table of contents from the\ncurrent LatexState; use only level 1 items\n","type":"MiniLatex.LatexState.LatexState -> List.List (Html.Html msg)"},{"name":"render","comment":" The main rendering funcction. Compute an Html msg value\nfrom the current LatexState and a LatexExpresssion.\n","type":"MiniLatex.LatexState.LatexState -> MiniLatex.Parser.LatexExpression -> Html.Html msg"},{"name":"renderLatexList","comment":" Like `render`, but renders a list of LatexExpressions\nto Html mgs\n","type":"MiniLatex.LatexState.LatexState -> List.List MiniLatex.Parser.LatexExpression -> Html.Html msg"},{"name":"renderString","comment":" Parse a string, then render it.\n","type":"MiniLatex.LatexState.LatexState -> String.String -> Html.Html msg"}],"binops":[]},{"name":"MiniLatex.RenderLatexForExport","comment":" This module is for preparing latex for export.\n\n\n# API\n\n@docs renderLatexForExport\n\n","unions":[],"aliases":[],"values":[{"name":"renderLatexForExport","comment":" parse a string and render it back into Latex\n","type":"String.String -> String.String"}],"binops":[]},{"name":"MiniLatex.Source","comment":" This module provides boilerplat eext.\n\n\n# API\n\n@docs texPrefix, texSuffix\n\n","unions":[],"aliases":[],"values":[{"name":"texPrefix","comment":" A standarad preamble\n","type":"String.String"},{"name":"texSuffix","comment":" Bolerplate for the end of the document.\n","type":"String.String"}],"binops":[]}]