Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module Language.Rzk.Syntax.Abs
- parseModule :: String -> Either String Module
- parseModuleRzk :: String -> Either String Module
- parseModuleFile :: FilePath -> IO (Either String Module)
- parseTerm :: String -> Either String Term
- printTree :: Print a => a -> String
- tryExtractMarkdownCodeBlocks :: String -> String -> String
- extractMarkdownCodeBlocks :: String -> String -> String
Documentation
module Language.Rzk.Syntax.Abs
extractMarkdownCodeBlocks :: String -> String -> String Source #
Extract code for a given alias (e.g. "rzk" or "haskell") from a Markdown file by replacing any lines that do not belong to the code in that language with blank lines. This way the line numbers are preserved correctly from the original file.
All of the following notations are supported to start a code block:
```rzk
```{.rzk title="Example"}
``` { .rzk title="Example" }
>>>
example = "Example:\n```rzk\n#lang rzk-1\n```\nasd asd\n```rzk\n#def x : U\n := U\n``` \nasda"
>>>
putStrLn example
Example: ```rzk #lang rzk-1 ``` asd asd ```rzk #def x : U := U ``` asda>>>
putStrLn $ extractMarkdownCodeBlocks "rzk" example
#lang rzk-1 #def x : U := U