| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Agda.Syntax.Parser.Literate
Description
Preprocessors for literate code formats.
Synopsis
- literateProcessors :: Bool -> [(String, (Processor, FileType))]
- literateExts :: [String]
- literateTeX :: Processor
- literateRsT :: Processor
- literateMd :: Bool -> Processor
- literateOrg :: Processor
- illiterate :: [Layer] -> String
- atomizeLayers :: Layers -> [(LayerRole, Char)]
- type Processor = PositionWithoutFile -> String -> [Layer]
- type Layers = [Layer]
- data Layer = Layer {}
- data LayerRole
- isCode :: LayerRole -> Bool
- isCodeLayer :: Layer -> Bool
Documentation
literateProcessors :: Bool -> [(String, (Processor, FileType))] Source #
List of valid extensions for literate Agda files, and their corresponding preprocessors.
If you add new extensions, remember to update test/Utils.hs so that test cases ending in the new extensions are found.
The Bool parameter controls whether only ```agda blocks
are treated as Agda code in Markdown/Typst files.
When True, only blocks marked ```agda are considered code.
When False, both ``` and ```agda blocks are code (default).
literateExts :: [String] Source #
List of valid literate file extensions.
literateTeX :: Processor Source #
Preprocessor for literate TeX.
literateRsT :: Processor Source #
Preprocessor for reStructuredText.
literateMd :: Bool -> Processor Source #
Preprocessor for Markdown.
The Bool parameter controls whether only ```agda blocks
are treated as Agda code.
When True, only blocks explicitly marked ```agda are considered code.
When False, both unmarked ``` and ```agda blocks are code (default).
literateOrg :: Processor Source #
Preprocessor for Org mode documents.
illiterate :: [Layer] -> String Source #
Blanks the non-code parts of a given file, preserving positions of characters corresponding to code. This way, there is a direct correspondence between source positions and positions in the processed result.
type Processor = PositionWithoutFile -> String -> [Layer] Source #
Type of a literate preprocessor: Invariants:
f : Processor
proposition> f pos s /= []
proposition> f pos s >>= layerContent == s
isCodeLayer :: Layer -> Bool Source #
Returns True if the layer contains Agda code.