MarkdownCodeBlock
classin packageklyn.code.markdown
public class MarkdownCodeBlock extends Object
└ MarkdownCodeBlock

Represents a fenced code block ( language ... ) extracted from a Markdown document.

import klyn.code.ast
import klyn.code.markdown

block = MarkdownCodeBlock("klyn", "x = 42", SourceRange(1, 0, 3, 0))
assert block.language == "klyn"
assert block.code == "x = 42"
Properties
Modifier and Type Member Description
public readonly property code
code as String
Source code inside the fenced block (excluding the opening and closing fence lines).
public readonly property language
language as String
Lowercase language identifier on the opening code fence (or "").
public readonly property range
range as SourceRange
Line range of the fenced block in the enclosing Markdown document.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public MarkdownCodeBlock
MarkdownCodeBlock(language as String, code as String, range as SourceRange)
Constructs a MarkdownCodeBlock.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml