jxxcarlson/scripta-compiler-v2/1.3.0

ScriptaV2.Types

This module defines the core types used for configuring the Scripta compiler. The main type is CompilerParameters, which controls how source text is compiled and rendered across all supported markup languages (MicroLaTeX, SMarkdown, L0/Enclosure).

Configuration

type alias CompilerParameters =
{ windowWidth : Int
, scale : Float
, lang : Language
, docWidth : Int
, editCount : Int
, selectedId : String
, selectedSlug : Maybe String
, idsOfOpenNodes : List String
, filter : Filter
, theme : Theme
, longEquationLimit : Float
, numberToLevel : Int
, data : Dict String String
}
defaultCompilerParameters : CompilerParameters
type Filter
= NoFilter
| SuppressDocumentBlocks

Key Parameters

  • lang: The markup language to compile (MicroLaTeX, SMarkdown, or Enclosure)
  • docWidth: Width of the rendered document in pixels
  • editCount: Increment this after each edit for live editing contexts (use 0 for static documents)
  • selectedId: ID of the currently selected block for highlighting
  • theme: Visual theme (Light or Dark)
  • idsOfOpenNodes: List of IDs for expanded/collapsed sections

Usage

For simple use cases, start with defaultCompilerParameters and override the fields you need:

{ defaultCompilerParameters
    | lang = ScriptaV2.Language.MicroLaTeXLang
    , docWidth = 600
    , editCount = model.editCount
}