diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstAttributes.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstAttributes.kt index 3cd69d9e..fb525e70 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstAttributes.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstAttributes.kt @@ -1,5 +1,8 @@ package eu.iamgio.quarkdown.ast +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode + /** * Additional information about the node tree, produced by the parsing stage and stored in a [eu.iamgio.quarkdown.context.Context]. * @see eu.iamgio.quarkdown.context.Context diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstRoot.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstRoot.kt index 5b1ba408..f2ef540e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstRoot.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/AstRoot.kt @@ -3,7 +3,7 @@ package eu.iamgio.quarkdown.ast import eu.iamgio.quarkdown.visitor.node.NodeVisitor /** - * The AST root. + * The root of a node tree. */ data class AstRoot( override val children: List, diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/BlockNodes.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/BlockNodes.kt deleted file mode 100644 index 028bf206..00000000 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/BlockNodes.kt +++ /dev/null @@ -1,239 +0,0 @@ -package eu.iamgio.quarkdown.ast - -import eu.iamgio.quarkdown.ast.id.Identifiable -import eu.iamgio.quarkdown.ast.id.IdentifierProvider -import eu.iamgio.quarkdown.function.value.data.Range -import eu.iamgio.quarkdown.visitor.node.NodeVisitor - -/** - * A blank line. - */ -class Newline : Node { - override fun toString() = "Newline" - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A code block. - * @param content code content - * @param language optional syntax language - * @param showLineNumbers whether to show line numbers - * @param focusedLines range of lines to focus on. No lines are focused if `null` - */ -data class Code( - val content: String, - val language: String?, - val showLineNumbers: Boolean = true, - val focusedLines: Range? = null, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A math (TeX) block. - * @param expression expression content - */ -data class Math( - val expression: String, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A horizontal line (thematic break). - */ -class HorizontalRule : Node { - override fun toString() = "HorizontalRule" - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A heading defined via prefix symbols. - * A heading is identifiable, as it can be looked up in the document and can be referenced. - * @param depth importance (`depth=1` for H1, `depth=6` for H6) - * @param customId optional custom ID. If `null`, the ID is automatically generated - */ -data class Heading( - val depth: Int, - override val text: InlineContent, - val customId: String? = null, -) : TextNode, Identifiable { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) - - override fun accept(visitor: IdentifierProvider) = visitor.visit(this) -} - -/** - * Creation of a link reference. - * @param label inline content of the displayed label - * @param url URL this link points to - * @param title optional title - */ -data class LinkDefinition( - override val label: InlineContent, - override val url: String, - override val title: String?, -) : LinkNode, TextNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) - - /** - * Alias for [label]. - */ - override val text: InlineContent - get() = label -} - -/** - * A list, either ordered or unordered. - */ -interface ListBlock : NestableNode { - /** - * Whether the list is loose. - */ - val isLoose: Boolean -} - -/** - * An unordered list. - * @param isLoose whether the list is loose - * @param children items - */ -data class UnorderedList( - override val isLoose: Boolean, - override val children: List, -) : ListBlock { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An ordered list. - * @param isLoose whether the list is loose - * @param children items - * @param startIndex index of the first item - */ -data class OrderedList( - val startIndex: Int, - override val isLoose: Boolean, - override val children: List, -) : ListBlock { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An item of a [ListBlock]. - */ -interface ListItem : NestableNode { - /** - * The list that owns this item. - */ - var owner: ListBlock? -} - -/** - * An item of a [ListBlock]. - * @param children content - */ -data class BaseListItem( - override val children: List, -) : ListItem { - override var owner: ListBlock? = null - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An item of a [ListBlock] that includes a task, with a checked/unchecked value. - * @param isChecked whether the task is checked - * @param children content - * @see CheckBox - */ -data class TaskListItem( - val isChecked: Boolean, - override val children: List, -) : ListItem { - override var owner: ListBlock? = null - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An HTML block. - * @param content raw HTML content - */ -data class Html( - val content: String, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A table. - * @param columns columns of the table. Each column has a header and multiple cells - */ -data class Table( - val columns: List, -) : Node { - /** - * A column of a table. - * @param alignment text alignment - * @param header header cell - * @param cells other cells - */ - data class Column(val alignment: Alignment, val header: Cell, val cells: List) - - /** - * A single cell of a table. - * @param text content - */ - data class Cell(val text: InlineContent) - - /** - * Text alignment of a [Column]. - */ - enum class Alignment { - LEFT, - CENTER, - RIGHT, - NONE, - } - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A text paragraph. - * @param text text content - */ -data class Paragraph( - override val text: InlineContent, -) : TextNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A block quote. - * @param children content - */ -data class BlockQuote( - override val children: List, -) : NestableNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A forced page break. - */ -class PageBreak : Node { - override fun toString() = "PageBreak" - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Anything else (should not happen). - */ -class BlockText : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineContent.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineContent.kt new file mode 100644 index 00000000..7f83f92a --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineContent.kt @@ -0,0 +1,7 @@ +package eu.iamgio.quarkdown.ast + +/** + * Represents an ordered sequence of inline nodes, such as text, links, images, etc., + * that can be part of a block's text, such as a paragraph or heading. + */ +typealias InlineContent = List diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineNodes.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineNodes.kt deleted file mode 100644 index a1121fc8..00000000 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/InlineNodes.kt +++ /dev/null @@ -1,183 +0,0 @@ -package eu.iamgio.quarkdown.ast - -import eu.iamgio.quarkdown.misc.Color -import eu.iamgio.quarkdown.visitor.node.NodeVisitor - -typealias InlineContent = List - -/** - * A [Node] that contains plain text. - * @see eu.iamgio.quarkdown.util.toPlainText - */ -interface PlainTextNode : Node { - val text: String -} - -/** - * A comment whose content is ignored. - */ -class Comment : Node { - override fun toString() = "Comment" - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A hard line break. - */ -class LineBreak : Node { - override fun toString() = "LineBreak" - - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Content (usually a single character) that requires special treatment during the rendering stage. - * @param text wrapped text - */ -data class CriticalContent(override val text: String) : PlainTextNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A link. - * @param label inline content of the displayed label - * @param url URL this link points to - * @param title optional title - */ -data class Link( - override val label: InlineContent, - override val url: String, - override val title: String?, -) : LinkNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A link that references a [LinkDefinition]. - * @param label inline content of the displayed label - * @param reference label of the [LinkDefinition] this link points to - * @param fallback supplier of the node to show instead of [label] in case the reference is invalid - */ -data class ReferenceLink( - val label: InlineContent, - val reference: InlineContent, - val fallback: () -> Node, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An image. - * @param link the link the image points to - * @param width optional width constraint - * @param height optional height constraint - */ -data class Image( - val link: LinkNode, - val width: Int?, - val height: Int?, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An images that references a [LinkDefinition]. - * @param link the link the image references - * @param width optional width constraint - * @param height optional height constraint - */ -data class ReferenceImage( - val link: ReferenceLink, - val width: Int?, - val height: Int?, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * An immutable checkbox that is either checked or unchecked. - * @param isChecked whether the checkbox is checked - * @see TaskListItem - */ -data class CheckBox( - val isChecked: Boolean, -) : Node { - override fun accept(visitor: NodeVisitor): T = visitor.visit(this) -} - -// Emphasis - -/** - * Inline code. - * @param text text content - * @param content additional content this code holds, if any - */ -data class CodeSpan( - override val text: String, - val content: ContentInfo? = null, -) : PlainTextNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) - - /** - * Additional content a [CodeSpan] may hold. - */ - sealed interface ContentInfo - - /** - * A color linked to a [CodeSpan]. - * For instance, this content may be assigned to a [CodeSpan] if its text holds information about a color's hex. - * @param color color data - */ - data class ColorContent(val color: Color) : ContentInfo -} - -/** - * Plain inline text. - * @param text text content. - */ -data class Text(override val text: String) : PlainTextNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Weakly emphasized content. - * @param children content - */ -data class Emphasis(override val children: InlineContent) : NestableNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Strongly emphasized content. - * @param children content - */ -data class Strong(override val children: InlineContent) : NestableNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Heavily emphasized content. - * @param children content - */ -data class StrongEmphasis(override val children: InlineContent) : NestableNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * Strikethrough content. - * @param children content - */ -data class Strikethrough(override val children: InlineContent) : NestableNode { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} - -/** - * A math (TeX) inline. - * @param expression expression content - */ -data class MathSpan( - val expression: String, -) : Node { - override fun accept(visitor: NodeVisitor) = visitor.visit(this) -} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/MarkdownContent.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/MarkdownContent.kt index 3b11956a..3aaeb227 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/MarkdownContent.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/MarkdownContent.kt @@ -2,8 +2,7 @@ package eu.iamgio.quarkdown.ast import eu.iamgio.quarkdown.visitor.node.NodeVisitor -// Nodes that aren't parsed from the source Markdown input, -// but rather returned from and/or handled by Quarkdown functions. +// Utility nodes that are used as input in Quarkdown functions to expect Markdown data as an argument. /** * A generic group of block nodes used as input for Quarkdown functions. diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/Node.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/Node.kt index 7972497d..d3f482d7 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/Node.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/Node.kt @@ -20,38 +20,3 @@ interface Node { interface NestableNode : Node { val children: List } - -/** - * A node that may contain inline content as its children. - */ -interface TextNode : NestableNode { - /** - * The text of the node as processed inline content. - */ - val text: InlineContent - - override val children: List - get() = text -} - -/** - * A general link node. - * @see Link - * @see LinkDefinition - */ -interface LinkNode : Node { - /** - * Inline content of the displayed label. - */ - val label: InlineContent - - /** - * URL this link points to. - */ - val url: String - - /** - * Optional title. - */ - val title: String? -} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/LinkNode.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/LinkNode.kt new file mode 100644 index 00000000..461624b3 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/LinkNode.kt @@ -0,0 +1,26 @@ +package eu.iamgio.quarkdown.ast.base + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.Node + +/** + * A general link node. + * @see eu.iamgio.quarkdown.ast.base.inline.Link + * @see eu.iamgio.quarkdown.ast.base.block.LinkDefinition + */ +interface LinkNode : Node { + /** + * Inline content of the displayed label. + */ + val label: InlineContent + + /** + * URL this link points to. + */ + val url: String + + /** + * Optional title. + */ + val title: String? +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/TextNode.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/TextNode.kt new file mode 100644 index 00000000..0d057014 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/TextNode.kt @@ -0,0 +1,18 @@ +package eu.iamgio.quarkdown.ast.base + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.NestableNode +import eu.iamgio.quarkdown.ast.Node + +/** + * A node that may contain inline content as its children. + */ +interface TextNode : NestableNode { + /** + * The text of the node as processed inline content. + */ + val text: InlineContent + + override val children: List + get() = text +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockQuote.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockQuote.kt new file mode 100644 index 00000000..0ccdc30a --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockQuote.kt @@ -0,0 +1,15 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.NestableNode +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A block quote. + * @param children content + */ +data class BlockQuote( + override val children: List, +) : NestableNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockText.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockText.kt new file mode 100644 index 00000000..229f710c --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/BlockText.kt @@ -0,0 +1,11 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * Anything else (should not happen). + */ +class BlockText : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Code.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Code.kt new file mode 100644 index 00000000..76c5b0ef --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Code.kt @@ -0,0 +1,21 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.function.value.data.Range +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A code block. + * @param content code content + * @param language optional syntax language + * @param showLineNumbers whether to show line numbers + * @param focusedLines range of lines to focus on. No lines are focused if `null` + */ +data class Code( + val content: String, + val language: String?, + val showLineNumbers: Boolean = true, + val focusedLines: Range? = null, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Heading.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Heading.kt new file mode 100644 index 00000000..3470536f --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Heading.kt @@ -0,0 +1,23 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.ast.id.Identifiable +import eu.iamgio.quarkdown.ast.id.IdentifierProvider +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A heading defined via prefix symbols. + * A heading is identifiable, as it can be looked up in the document and can be referenced. + * @param depth importance (`depth=1` for H1, `depth=6` for H6) + * @param customId optional custom ID. If `null`, the ID is automatically generated + */ +data class Heading( + val depth: Int, + override val text: InlineContent, + val customId: String? = null, +) : TextNode, Identifiable { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) + + override fun accept(visitor: IdentifierProvider) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/HorizontalRule.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/HorizontalRule.kt new file mode 100644 index 00000000..2ca8e351 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/HorizontalRule.kt @@ -0,0 +1,13 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A horizontal line (thematic break). + */ +class HorizontalRule : Node { + override fun toString() = "HorizontalRule" + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Html.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Html.kt new file mode 100644 index 00000000..0aab5df0 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Html.kt @@ -0,0 +1,14 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * An HTML block. + * @param content raw HTML content + */ +data class Html( + val content: String, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/LinkDefinition.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/LinkDefinition.kt new file mode 100644 index 00000000..b488fab6 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/LinkDefinition.kt @@ -0,0 +1,26 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.base.LinkNode +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * Creation of a link reference. + * @param label inline content of the displayed label + * @param url URL this link points to + * @param title optional title + */ +data class LinkDefinition( + override val label: InlineContent, + override val url: String, + override val title: String?, +) : LinkNode, TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) + + /** + * Alias for [label]. + */ + override val text: InlineContent + get() = label +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/List.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/List.kt new file mode 100644 index 00000000..2fb80d8a --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/List.kt @@ -0,0 +1,78 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.NestableNode +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A list, either ordered or unordered. + */ +interface ListBlock : NestableNode { + /** + * Whether the list is loose. + */ + val isLoose: Boolean +} + +/** + * An unordered list. + * @param isLoose whether the list is loose + * @param children items + */ +data class UnorderedList( + override val isLoose: Boolean, + override val children: List, +) : ListBlock { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * An ordered list. + * @param isLoose whether the list is loose + * @param children items + * @param startIndex index of the first item + */ +data class OrderedList( + val startIndex: Int, + override val isLoose: Boolean, + override val children: List, +) : ListBlock { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * An item of a [ListBlock]. + */ +interface ListItem : NestableNode { + /** + * The list that owns this item. + */ + var owner: ListBlock? +} + +/** + * An item of a [ListBlock]. + * @param children content + */ +data class BaseListItem( + override val children: List, +) : ListItem { + override var owner: ListBlock? = null + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * An item of a [ListBlock] that includes a task, with a checked/unchecked value. + * @param isChecked whether the task is checked + * @param children content + * @see eu.iamgio.quarkdown.ast.base.inline.CheckBox + */ +data class TaskListItem( + val isChecked: Boolean, + override val children: List, +) : ListItem { + override var owner: ListBlock? = null + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Newline.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Newline.kt new file mode 100644 index 00000000..999cbdac --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Newline.kt @@ -0,0 +1,13 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A blank line. + */ +class Newline : Node { + override fun toString() = "Newline" + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Paragraph.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Paragraph.kt new file mode 100644 index 00000000..293ab40b --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Paragraph.kt @@ -0,0 +1,15 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A general paragraph. + * @param text text content + */ +data class Paragraph( + override val text: InlineContent, +) : TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Table.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Table.kt new file mode 100644 index 00000000..a708147f --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/block/Table.kt @@ -0,0 +1,39 @@ +package eu.iamgio.quarkdown.ast.base.block + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A table. + * @param columns columns of the table. Each column has a header and multiple cells + */ +data class Table( + val columns: List, +) : Node { + /** + * A column of a table. + * @param alignment text alignment + * @param header header cell + * @param cells other cells + */ + data class Column(val alignment: Alignment, val header: Cell, val cells: List) + + /** + * A single cell of a table. + * @param text content + */ + data class Cell(val text: InlineContent) + + /** + * Text alignment of a [Column]. + */ + enum class Alignment { + LEFT, + CENTER, + RIGHT, + NONE, + } + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CheckBox.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CheckBox.kt new file mode 100644 index 00000000..28e89776 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CheckBox.kt @@ -0,0 +1,15 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * An immutable checkbox that is either checked or unchecked. + * @param isChecked whether the checkbox is checked + * @see eu.iamgio.quarkdown.ast.base.block.TaskListItem + */ +data class CheckBox( + val isChecked: Boolean, +) : Node { + override fun accept(visitor: NodeVisitor): T = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CodeSpan.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CodeSpan.kt new file mode 100644 index 00000000..e1730f7e --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/CodeSpan.kt @@ -0,0 +1,28 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.misc.Color +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * Inline code. + * @param text text content + * @param content additional content this code holds, if any + */ +data class CodeSpan( + override val text: String, + val content: ContentInfo? = null, +) : PlainTextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) + + /** + * Additional content a [CodeSpan] may hold. + */ + sealed interface ContentInfo + + /** + * A color linked to a [CodeSpan]. + * For instance, this content may be assigned to a [CodeSpan] if its text holds information about a color's hex. + * @param color color data + */ + data class ColorContent(val color: Color) : ContentInfo +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Comment.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Comment.kt new file mode 100644 index 00000000..40840cb8 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Comment.kt @@ -0,0 +1,13 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A comment whose content is ignored. + */ +class Comment : Node { + override fun toString() = "Comment" + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Emphasis.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Emphasis.kt new file mode 100644 index 00000000..dbdcc4e6 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Emphasis.kt @@ -0,0 +1,37 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * Weakly emphasized content. + * @param text content + */ +data class Emphasis(override val text: InlineContent) : TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * Strongly emphasized content. + * @param text content + */ +data class Strong(override val text: InlineContent) : TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * Heavily emphasized content. + * @param text content + */ +data class StrongEmphasis(override val text: InlineContent) : TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * Strikethrough content. + * @param text content + */ +data class Strikethrough(override val text: InlineContent) : TextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Image.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Image.kt new file mode 100644 index 00000000..9eae273e --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Image.kt @@ -0,0 +1,34 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.ast.base.LinkNode +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * An image. + * @param link the link the image points to + * @param width optional width constraint + * @param height optional height constraint + */ +data class Image( + val link: LinkNode, + val width: Int?, + val height: Int?, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * An images that references a [LinkDefinition]. + * @param link the link the image references + * @param width optional width constraint + * @param height optional height constraint + */ +data class ReferenceImage( + val link: ReferenceLink, + val width: Int?, + val height: Int?, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/LineBreak.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/LineBreak.kt new file mode 100644 index 00000000..285b8bae --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/LineBreak.kt @@ -0,0 +1,13 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A hard line break. + */ +class LineBreak : Node { + override fun toString() = "LineBreak" + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Link.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Link.kt new file mode 100644 index 00000000..3705a71d --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Link.kt @@ -0,0 +1,35 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.InlineContent +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.ast.base.LinkNode +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A link. + * @param label inline content of the displayed label + * @param url URL this link points to + * @param title optional title + */ +data class Link( + override val label: InlineContent, + override val url: String, + override val title: String?, +) : LinkNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * A link that references a [LinkDefinition]. + * @param label inline content of the displayed label + * @param reference label of the [LinkDefinition] this link points to + * @param fallback supplier of the node to show instead of [label] in case the reference is invalid + */ +data class ReferenceLink( + val label: InlineContent, + val reference: InlineContent, + val fallback: () -> Node, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Text.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Text.kt new file mode 100644 index 00000000..64600ceb --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/base/inline/Text.kt @@ -0,0 +1,28 @@ +package eu.iamgio.quarkdown.ast.base.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A [Node] that contains plain text. + * @see eu.iamgio.quarkdown.util.toPlainText + */ +interface PlainTextNode : Node { + val text: String +} + +/** + * Content (usually a single character) that requires special treatment during the rendering stage. + * @param text wrapped text + */ +data class CriticalContent(override val text: String) : PlainTextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} + +/** + * Plain inline text. + * @param text text content. + */ +data class Text(override val text: String) : PlainTextNode { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/id/Identifiable.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/id/Identifiable.kt index 55536118..5f50e711 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/id/Identifiable.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/id/Identifiable.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.ast.id -import eu.iamgio.quarkdown.ast.Heading +import eu.iamgio.quarkdown.ast.base.block.Heading /** * An element that can be identified by a unique identifier, referenced and located by other elements in a document. diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/FunctionCallNode.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/FunctionCallNode.kt similarity index 87% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/FunctionCallNode.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/FunctionCallNode.kt index 8def6aae..bf6b2fc2 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/FunctionCallNode.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/FunctionCallNode.kt @@ -1,5 +1,7 @@ -package eu.iamgio.quarkdown.ast +package eu.iamgio.quarkdown.ast.quarkdown +import eu.iamgio.quarkdown.ast.NestableNode +import eu.iamgio.quarkdown.ast.Node import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.function.call.FunctionCallArgument import eu.iamgio.quarkdown.visitor.node.NodeVisitor diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Aligned.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Aligned.kt similarity index 92% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Aligned.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Aligned.kt index e7bec27c..a6c7f7d6 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Aligned.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Aligned.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Box.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Box.kt similarity index 91% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Box.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Box.kt index 37ef32c3..3c0401ea 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Box.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Box.kt @@ -1,10 +1,10 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block -import eu.iamgio.quarkdown.ast.CodeSpan import eu.iamgio.quarkdown.ast.InlineContent import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.document.size.Size import eu.iamgio.quarkdown.misc.Color import eu.iamgio.quarkdown.visitor.node.NodeVisitor diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Clipped.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Clipped.kt similarity index 94% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Clipped.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Clipped.kt index 59a851b7..f05be3d4 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Clipped.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Clipped.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Math.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Math.kt new file mode 100644 index 00000000..f0de58a5 --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Math.kt @@ -0,0 +1,14 @@ +package eu.iamgio.quarkdown.ast.quarkdown.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A math (TeX) block. + * @param expression expression content + */ +data class Math( + val expression: String, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/PageBreak.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/PageBreak.kt new file mode 100644 index 00000000..22d1b58f --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/PageBreak.kt @@ -0,0 +1,13 @@ +package eu.iamgio.quarkdown.ast.quarkdown.block + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A forced page break. + */ +class PageBreak : Node { + override fun toString() = "PageBreak" + + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesFragment.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/SlidesFragment.kt similarity index 96% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesFragment.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/SlidesFragment.kt index 7d862019..7be539ba 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesFragment.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/SlidesFragment.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Stacked.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Stacked.kt similarity index 97% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Stacked.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Stacked.kt index 11a8285c..d9054edd 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Stacked.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Stacked.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TableOfContents.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/TableOfContents.kt similarity index 96% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TableOfContents.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/TableOfContents.kt index 9e8e8a01..51f2c201 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TableOfContents.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/TableOfContents.kt @@ -1,9 +1,9 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.block -import eu.iamgio.quarkdown.ast.Heading import eu.iamgio.quarkdown.ast.InlineContent import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.TextNode +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.ast.base.block.Heading import eu.iamgio.quarkdown.ast.id.Identifiable import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.util.findAll diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/MathSpan.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/MathSpan.kt new file mode 100644 index 00000000..f4490ede --- /dev/null +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/MathSpan.kt @@ -0,0 +1,14 @@ +package eu.iamgio.quarkdown.ast.quarkdown.inline + +import eu.iamgio.quarkdown.ast.Node +import eu.iamgio.quarkdown.visitor.node.NodeVisitor + +/** + * A math (TeX) inline. + * @param expression expression content + */ +data class MathSpan( + val expression: String, +) : Node { + override fun accept(visitor: NodeVisitor) = visitor.visit(this) +} diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TextTransform.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt similarity index 98% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TextTransform.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt index 57701ed9..fd1f9e40 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/TextTransform.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.inline import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Whitespace.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/Whitespace.kt similarity index 72% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Whitespace.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/Whitespace.kt index 88de2ea4..4379c268 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/Whitespace.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/Whitespace.kt @@ -1,11 +1,11 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.inline import eu.iamgio.quarkdown.ast.Node import eu.iamgio.quarkdown.document.size.Size import eu.iamgio.quarkdown.visitor.node.NodeVisitor /** - * An empty square in a document that adds whitespace to the layout. + * An empty square that adds whitespace to the layout. */ data class Whitespace(val width: Size?, val height: Size?) : Node { override fun accept(visitor: NodeVisitor): T = visitor.visit(this) diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageCounterInitializer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageCounterInitializer.kt similarity index 94% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageCounterInitializer.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageCounterInitializer.kt index 47f01ef3..0f1ffc2e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageCounterInitializer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageCounterInitializer.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.invisible import eu.iamgio.quarkdown.ast.Node import eu.iamgio.quarkdown.document.page.PageMarginPosition diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageMarginContentInitializer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageMarginContentInitializer.kt similarity index 92% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageMarginContentInitializer.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageMarginContentInitializer.kt index 03ad1037..376cfb0b 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/PageMarginContentInitializer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/PageMarginContentInitializer.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.invisible import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesConfigurationInitializer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/SlidesConfigurationInitializer.kt similarity index 92% rename from core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesConfigurationInitializer.kt rename to core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/SlidesConfigurationInitializer.kt index 98a105c7..ace8c5b1 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/SlidesConfigurationInitializer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/invisible/SlidesConfigurationInitializer.kt @@ -1,4 +1,4 @@ -package eu.iamgio.quarkdown.ast.quarkdown +package eu.iamgio.quarkdown.ast.quarkdown.invisible import eu.iamgio.quarkdown.ast.Node import eu.iamgio.quarkdown.document.slides.Transition diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/BaseContext.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/BaseContext.kt index fb93660b..8e4479a2 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/BaseContext.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/BaseContext.kt @@ -1,10 +1,10 @@ package eu.iamgio.quarkdown.context import eu.iamgio.quarkdown.ast.AstAttributes -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.LinkNode -import eu.iamgio.quarkdown.ast.ReferenceLink +import eu.iamgio.quarkdown.ast.base.LinkNode +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.document.DocumentInfo import eu.iamgio.quarkdown.flavor.MarkdownFlavor import eu.iamgio.quarkdown.function.Function diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt index 5664e551..00ac285e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt @@ -1,12 +1,12 @@ package eu.iamgio.quarkdown.context import eu.iamgio.quarkdown.ast.AstAttributes -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Image -import eu.iamgio.quarkdown.ast.LinkNode import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink +import eu.iamgio.quarkdown.ast.base.LinkNode +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.document.DocumentInfo import eu.iamgio.quarkdown.flavor.MarkdownFlavor import eu.iamgio.quarkdown.function.Function diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ContextOptions.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ContextOptions.kt index 908627a2..9924d57e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ContextOptions.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ContextOptions.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.context -import eu.iamgio.quarkdown.ast.Heading +import eu.iamgio.quarkdown.ast.base.block.Heading /** * Read-only properties that affect several behaviors, diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/MutableContext.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/MutableContext.kt index a1ad7417..f5510aba 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/MutableContext.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/MutableContext.kt @@ -1,8 +1,8 @@ package eu.iamgio.quarkdown.context -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.LinkDefinition import eu.iamgio.quarkdown.ast.MutableAstAttributes +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.flavor.MarkdownFlavor import eu.iamgio.quarkdown.function.library.Library diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt index 35e308f2..c980cf9e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt @@ -1,7 +1,7 @@ package eu.iamgio.quarkdown.context -import eu.iamgio.quarkdown.ast.FunctionCallNode import eu.iamgio.quarkdown.ast.MutableAstAttributes +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.document.DocumentInfo import eu.iamgio.quarkdown.function.Function import eu.iamgio.quarkdown.pipeline.Pipeline diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/call/FunctionCallNodeExpander.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/call/FunctionCallNodeExpander.kt index 9d25b4bc..d5b048d6 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/call/FunctionCallNodeExpander.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/call/FunctionCallNodeExpander.kt @@ -1,8 +1,8 @@ package eu.iamgio.quarkdown.function.call -import eu.iamgio.quarkdown.ast.FunctionCallNode import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.quarkdown.Box +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Box import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.function.value.output.OutputValueVisitorFactory diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/ValueFactory.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/ValueFactory.kt index d54e2d1a..72cd5df1 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/ValueFactory.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/ValueFactory.kt @@ -1,10 +1,10 @@ package eu.iamgio.quarkdown.function.value -import eu.iamgio.quarkdown.ast.FunctionCallNode import eu.iamgio.quarkdown.ast.InlineMarkdownContent import eu.iamgio.quarkdown.ast.MarkdownContent import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.PlainTextNode +import eu.iamgio.quarkdown.ast.base.inline.PlainTextNode +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.document.size.Size diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/OutputValueVisitorFactory.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/OutputValueVisitorFactory.kt index d23587e4..9ceeb05a 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/OutputValueVisitorFactory.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/OutputValueVisitorFactory.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.function.value.output -import eu.iamgio.quarkdown.ast.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode import eu.iamgio.quarkdown.function.value.OutputValue /** diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/BlockNodeOutputValueVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/BlockNodeOutputValueVisitor.kt index 0f6e16de..d85dc797 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/BlockNodeOutputValueVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/BlockNodeOutputValueVisitor.kt @@ -1,7 +1,7 @@ package eu.iamgio.quarkdown.function.value.output.node import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Paragraph import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.function.value.BooleanValue import eu.iamgio.quarkdown.function.value.NumberValue diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/InlineNodeOutputValueVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/InlineNodeOutputValueVisitor.kt index d45ead19..51327aaa 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/InlineNodeOutputValueVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/InlineNodeOutputValueVisitor.kt @@ -1,7 +1,7 @@ package eu.iamgio.quarkdown.function.value.output.node -import eu.iamgio.quarkdown.ast.CheckBox -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.inline.CheckBox +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.function.value.BooleanValue import eu.iamgio.quarkdown.function.value.NumberValue diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/NodeOutputValueVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/NodeOutputValueVisitor.kt index 0820411a..94d0a216 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/NodeOutputValueVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/value/output/node/NodeOutputValueVisitor.kt @@ -1,12 +1,12 @@ package eu.iamgio.quarkdown.function.value.output.node -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockText -import eu.iamgio.quarkdown.ast.ListItem import eu.iamgio.quarkdown.ast.MarkdownContent import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.UnorderedList +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockText +import eu.iamgio.quarkdown.ast.base.block.ListItem +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.UnorderedList import eu.iamgio.quarkdown.function.value.DynamicValue import eu.iamgio.quarkdown.function.value.GeneralCollectionValue import eu.iamgio.quarkdown.function.value.IterableValue diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/parser/BlockTokenParser.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/parser/BlockTokenParser.kt index 090104d0..dbee101a 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/parser/BlockTokenParser.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/parser/BlockTokenParser.kt @@ -1,26 +1,26 @@ package eu.iamgio.quarkdown.parser -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.BlockText -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.HorizontalRule -import eu.iamgio.quarkdown.ast.Html import eu.iamgio.quarkdown.ast.InlineContent -import eu.iamgio.quarkdown.ast.LinkDefinition -import eu.iamgio.quarkdown.ast.ListBlock -import eu.iamgio.quarkdown.ast.ListItem -import eu.iamgio.quarkdown.ast.Math -import eu.iamgio.quarkdown.ast.Newline import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.TaskListItem -import eu.iamgio.quarkdown.ast.UnorderedList +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.BlockText +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.HorizontalRule +import eu.iamgio.quarkdown.ast.base.block.Html +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.base.block.ListBlock +import eu.iamgio.quarkdown.ast.base.block.ListItem +import eu.iamgio.quarkdown.ast.base.block.Newline +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.block.TaskListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.function.call.FunctionCallArgument import eu.iamgio.quarkdown.function.value.DynamicValue diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/parser/InlineTokenParser.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/parser/InlineTokenParser.kt index a42216c4..b0a96727 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/parser/InlineTokenParser.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/parser/InlineTokenParser.kt @@ -1,21 +1,21 @@ package eu.iamgio.quarkdown.parser -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.Comment -import eu.iamgio.quarkdown.ast.CriticalContent -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.Image import eu.iamgio.quarkdown.ast.InlineContent -import eu.iamgio.quarkdown.ast.LineBreak -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.MathSpan import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink -import eu.iamgio.quarkdown.ast.Strikethrough -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.StrongEmphasis -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Comment +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.LineBreak +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.base.inline.Strikethrough +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.StrongEmphasis +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.lexer.Lexer import eu.iamgio.quarkdown.lexer.Token diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/BaseHtmlNodeRenderer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/BaseHtmlNodeRenderer.kt index b00d8d13..0b68163b 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/BaseHtmlNodeRenderer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/BaseHtmlNodeRenderer.kt @@ -1,49 +1,49 @@ package eu.iamgio.quarkdown.rendering.html import eu.iamgio.quarkdown.ast.AstRoot -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.BlockText -import eu.iamgio.quarkdown.ast.CheckBox -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.Comment -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.HorizontalRule -import eu.iamgio.quarkdown.ast.Html -import eu.iamgio.quarkdown.ast.Image -import eu.iamgio.quarkdown.ast.LineBreak -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.LinkDefinition -import eu.iamgio.quarkdown.ast.ListItem -import eu.iamgio.quarkdown.ast.Math -import eu.iamgio.quarkdown.ast.MathSpan -import eu.iamgio.quarkdown.ast.Newline -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink -import eu.iamgio.quarkdown.ast.Strikethrough -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.StrongEmphasis -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.TaskListItem -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.UnorderedList -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.PageCounterInitializer -import eu.iamgio.quarkdown.ast.quarkdown.PageMarginContentInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesConfigurationInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.TableOfContents -import eu.iamgio.quarkdown.ast.quarkdown.TextTransform -import eu.iamgio.quarkdown.ast.quarkdown.Whitespace +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.BlockText +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.HorizontalRule +import eu.iamgio.quarkdown.ast.base.block.Html +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.base.block.ListItem +import eu.iamgio.quarkdown.ast.base.block.Newline +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.block.TaskListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList +import eu.iamgio.quarkdown.ast.base.inline.CheckBox +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Comment +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.LineBreak +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.base.inline.Strikethrough +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.StrongEmphasis +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.block.TableOfContents +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransform +import eu.iamgio.quarkdown.ast.quarkdown.inline.Whitespace +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageCounterInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageMarginContentInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.SlidesConfigurationInitializer import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.resolveOrFallback import eu.iamgio.quarkdown.rendering.UnsupportedRenderException diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/CssRepresentableVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/CssRepresentableVisitor.kt index af550a52..dd69883e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/CssRepresentableVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/CssRepresentableVisitor.kt @@ -1,9 +1,9 @@ package eu.iamgio.quarkdown.rendering.html -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.TextTransformData +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransformData import eu.iamgio.quarkdown.document.page.PageMarginPosition import eu.iamgio.quarkdown.document.size.Size import eu.iamgio.quarkdown.document.size.Sizes diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/HtmlIdentifierProvider.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/HtmlIdentifierProvider.kt index f689e8a9..67d5c7c6 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/HtmlIdentifierProvider.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/HtmlIdentifierProvider.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.rendering.html -import eu.iamgio.quarkdown.ast.Heading +import eu.iamgio.quarkdown.ast.base.block.Heading import eu.iamgio.quarkdown.ast.id.IdentifierProvider import eu.iamgio.quarkdown.rendering.NodeRenderer import eu.iamgio.quarkdown.util.toPlainText diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/QuarkdownHtmlNodeRenderer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/QuarkdownHtmlNodeRenderer.kt index 0c16d2d8..b510f133 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/QuarkdownHtmlNodeRenderer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/html/QuarkdownHtmlNodeRenderer.kt @@ -1,28 +1,28 @@ package eu.iamgio.quarkdown.rendering.html import eu.iamgio.quarkdown.ast.AstRoot -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.Image -import eu.iamgio.quarkdown.ast.Math -import eu.iamgio.quarkdown.ast.MathSpan import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Image import eu.iamgio.quarkdown.ast.id.getId -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.PageCounterInitializer -import eu.iamgio.quarkdown.ast.quarkdown.PageMarginContentInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesConfigurationInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.TableOfContents -import eu.iamgio.quarkdown.ast.quarkdown.TextTransform -import eu.iamgio.quarkdown.ast.quarkdown.Whitespace +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.block.TableOfContents +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransform +import eu.iamgio.quarkdown.ast.quarkdown.inline.Whitespace +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageCounterInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageMarginContentInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.SlidesConfigurationInitializer import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.shouldAutoPageBreak import eu.iamgio.quarkdown.document.DocumentType @@ -192,7 +192,7 @@ class QuarkdownHtmlNodeRenderer(context: Context) : BaseHtmlNodeRenderer(context children = when (context.documentInfo.type) { DocumentType.PAGED -> - // Handled by PagedJS' CSS content property. + // Handled by PagedJS CSS content property. node.content( "\"counter(page)\"", "\"counter(pages)\"", diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/representable/RenderRepresentableVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/representable/RenderRepresentableVisitor.kt index 6dff7845..61fee81c 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/representable/RenderRepresentableVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/representable/RenderRepresentableVisitor.kt @@ -1,9 +1,9 @@ package eu.iamgio.quarkdown.rendering.representable -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.TextTransformData +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransformData import eu.iamgio.quarkdown.document.page.PageMarginPosition import eu.iamgio.quarkdown.document.size.Size import eu.iamgio.quarkdown.document.size.Sizes diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/tag/TagNodeRenderer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/tag/TagNodeRenderer.kt index ba0ac6f1..f7d94b29 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/tag/TagNodeRenderer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/rendering/tag/TagNodeRenderer.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.rendering.tag -import eu.iamgio.quarkdown.ast.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.rendering.NodeRenderer diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/util/NodeUtils.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/util/NodeUtils.kt index 0f30a90d..80ae5405 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/util/NodeUtils.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/util/NodeUtils.kt @@ -1,11 +1,11 @@ package eu.iamgio.quarkdown.util import eu.iamgio.quarkdown.ast.AstRoot -import eu.iamgio.quarkdown.ast.CriticalContent import eu.iamgio.quarkdown.ast.InlineContent import eu.iamgio.quarkdown.ast.NestableNode import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.PlainTextNode +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.PlainTextNode import eu.iamgio.quarkdown.visitor.node.NodeVisitor /** diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/visitor/node/NodeVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/visitor/node/NodeVisitor.kt index 9a2ac4b4..db9c0581 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/visitor/node/NodeVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/visitor/node/NodeVisitor.kt @@ -1,49 +1,49 @@ package eu.iamgio.quarkdown.visitor.node import eu.iamgio.quarkdown.ast.AstRoot -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.BlockText -import eu.iamgio.quarkdown.ast.CheckBox -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.Comment -import eu.iamgio.quarkdown.ast.CriticalContent -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.HorizontalRule -import eu.iamgio.quarkdown.ast.Html -import eu.iamgio.quarkdown.ast.Image -import eu.iamgio.quarkdown.ast.LineBreak -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.LinkDefinition -import eu.iamgio.quarkdown.ast.Math -import eu.iamgio.quarkdown.ast.MathSpan -import eu.iamgio.quarkdown.ast.Newline -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink -import eu.iamgio.quarkdown.ast.Strikethrough -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.StrongEmphasis -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.TaskListItem -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.UnorderedList -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.PageCounterInitializer -import eu.iamgio.quarkdown.ast.quarkdown.PageMarginContentInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesConfigurationInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.TableOfContents -import eu.iamgio.quarkdown.ast.quarkdown.TextTransform -import eu.iamgio.quarkdown.ast.quarkdown.Whitespace +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.BlockText +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.HorizontalRule +import eu.iamgio.quarkdown.ast.base.block.Html +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.base.block.Newline +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.block.TaskListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList +import eu.iamgio.quarkdown.ast.base.inline.CheckBox +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Comment +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.LineBreak +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.base.inline.Strikethrough +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.StrongEmphasis +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.block.TableOfContents +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransform +import eu.iamgio.quarkdown.ast.quarkdown.inline.Whitespace +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageCounterInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageMarginContentInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.SlidesConfigurationInitializer /** * A visitor for [eu.iamgio.quarkdown.ast.Node]s. diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/BlockParserTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/BlockParserTest.kt index 78a28333..00794b1d 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/BlockParserTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/BlockParserTest.kt @@ -1,28 +1,28 @@ package eu.iamgio.quarkdown -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.FunctionCallNode -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.HorizontalRule -import eu.iamgio.quarkdown.ast.Html -import eu.iamgio.quarkdown.ast.LinkDefinition -import eu.iamgio.quarkdown.ast.ListBlock -import eu.iamgio.quarkdown.ast.Math import eu.iamgio.quarkdown.ast.NestableNode -import eu.iamgio.quarkdown.ast.Newline import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.PlainTextNode -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.TaskListItem -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.TextNode -import eu.iamgio.quarkdown.ast.UnorderedList +import eu.iamgio.quarkdown.ast.base.TextNode +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.HorizontalRule +import eu.iamgio.quarkdown.ast.base.block.Html +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.base.block.ListBlock +import eu.iamgio.quarkdown.ast.base.block.Newline +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.block.TaskListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList +import eu.iamgio.quarkdown.ast.base.inline.PlainTextNode +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.MarkdownFlavor import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/FunctionNodeExpansionTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/FunctionNodeExpansionTest.kt index 7d2bf601..24882346 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/FunctionNodeExpansionTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/FunctionNodeExpansionTest.kt @@ -1,15 +1,15 @@ package eu.iamgio.quarkdown -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.CheckBox -import eu.iamgio.quarkdown.ast.FunctionCallNode import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.PlainTextNode -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.inline.CheckBox +import eu.iamgio.quarkdown.ast.base.inline.PlainTextNode +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.FunctionCallNode +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/HtmlNodeRendererTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/HtmlNodeRendererTest.kt index 9535d0fb..5b892e67 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/HtmlNodeRendererTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/HtmlNodeRendererTest.kt @@ -2,41 +2,41 @@ package eu.iamgio.quarkdown -import eu.iamgio.quarkdown.ast.BaseListItem -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.Comment -import eu.iamgio.quarkdown.ast.CriticalContent -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.HorizontalRule -import eu.iamgio.quarkdown.ast.Html -import eu.iamgio.quarkdown.ast.Image import eu.iamgio.quarkdown.ast.InlineContent -import eu.iamgio.quarkdown.ast.LineBreak -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.LinkDefinition -import eu.iamgio.quarkdown.ast.ListItem -import eu.iamgio.quarkdown.ast.Math -import eu.iamgio.quarkdown.ast.MathSpan import eu.iamgio.quarkdown.ast.MutableAstAttributes import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.OrderedList -import eu.iamgio.quarkdown.ast.PageBreak -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink -import eu.iamgio.quarkdown.ast.Strikethrough -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.StrongEmphasis -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.TaskListItem -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.UnorderedList -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box -import eu.iamgio.quarkdown.ast.quarkdown.Clipped +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.HorizontalRule +import eu.iamgio.quarkdown.ast.base.block.Html +import eu.iamgio.quarkdown.ast.base.block.LinkDefinition +import eu.iamgio.quarkdown.ast.base.block.ListItem +import eu.iamgio.quarkdown.ast.base.block.OrderedList +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.block.TaskListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.Comment +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.LineBreak +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.base.inline.Strikethrough +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.StrongEmphasis +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.Math +import eu.iamgio.quarkdown.ast.quarkdown.block.PageBreak +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan import eu.iamgio.quarkdown.context.BaseContext import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/InlineParserTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/InlineParserTest.kt index c38f455b..916b66a3 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/InlineParserTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/InlineParserTest.kt @@ -1,18 +1,18 @@ package eu.iamgio.quarkdown -import eu.iamgio.quarkdown.ast.CodeSpan -import eu.iamgio.quarkdown.ast.CriticalContent -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.Image -import eu.iamgio.quarkdown.ast.Link -import eu.iamgio.quarkdown.ast.MathSpan import eu.iamgio.quarkdown.ast.Node -import eu.iamgio.quarkdown.ast.ReferenceImage -import eu.iamgio.quarkdown.ast.ReferenceLink -import eu.iamgio.quarkdown.ast.Strikethrough -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.StrongEmphasis -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.inline.CodeSpan +import eu.iamgio.quarkdown.ast.base.inline.CriticalContent +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Image +import eu.iamgio.quarkdown.ast.base.inline.Link +import eu.iamgio.quarkdown.ast.base.inline.ReferenceImage +import eu.iamgio.quarkdown.ast.base.inline.ReferenceLink +import eu.iamgio.quarkdown.ast.base.inline.Strikethrough +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.StrongEmphasis +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.inline.MathSpan import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.MarkdownFlavor import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt index 91dcb1ff..3e518c34 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt @@ -1,15 +1,15 @@ package eu.iamgio.quarkdown import eu.iamgio.quarkdown.ast.AstRoot -import eu.iamgio.quarkdown.ast.BlockQuote -import eu.iamgio.quarkdown.ast.Code -import eu.iamgio.quarkdown.ast.Emphasis -import eu.iamgio.quarkdown.ast.Heading -import eu.iamgio.quarkdown.ast.Paragraph -import eu.iamgio.quarkdown.ast.Strong -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.block.BlockQuote +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.block.Heading +import eu.iamgio.quarkdown.ast.base.block.Paragraph +import eu.iamgio.quarkdown.ast.base.inline.Emphasis +import eu.iamgio.quarkdown.ast.base.inline.Strong +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.ast.id.getId -import eu.iamgio.quarkdown.ast.quarkdown.TableOfContents +import eu.iamgio.quarkdown.ast.quarkdown.block.TableOfContents import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.document.locale.JVMLocaleLoader import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/StandaloneFunctionTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/StandaloneFunctionTest.kt index 53020068..b2122a05 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/StandaloneFunctionTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/StandaloneFunctionTest.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown -import eu.iamgio.quarkdown.ast.quarkdown.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Data.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Data.kt index cd705f30..39460b78 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Data.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Data.kt @@ -1,8 +1,8 @@ package eu.iamgio.quarkdown.stdlib import com.github.doyaaaaaken.kotlincsv.dsl.csvReader -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.function.reflect.Injected import eu.iamgio.quarkdown.function.reflect.Name diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Document.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Document.kt index bbe73205..475c705c 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Document.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Document.kt @@ -1,10 +1,10 @@ package eu.iamgio.quarkdown.stdlib import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.Text -import eu.iamgio.quarkdown.ast.quarkdown.PageCounterInitializer -import eu.iamgio.quarkdown.ast.quarkdown.PageMarginContentInitializer -import eu.iamgio.quarkdown.ast.quarkdown.TableOfContents +import eu.iamgio.quarkdown.ast.base.inline.Text +import eu.iamgio.quarkdown.ast.quarkdown.block.TableOfContents +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageCounterInitializer +import eu.iamgio.quarkdown.ast.quarkdown.invisible.PageMarginContentInitializer import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.document.DocumentInfo diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Flow.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Flow.kt index f0601c5a..7014106d 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Flow.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Flow.kt @@ -1,6 +1,6 @@ package eu.iamgio.quarkdown.stdlib -import eu.iamgio.quarkdown.ast.BlockText +import eu.iamgio.quarkdown.ast.base.block.BlockText import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.context.ScopeContext import eu.iamgio.quarkdown.function.FunctionParameter diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Layout.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Layout.kt index a66a256e..0a01216f 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Layout.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Layout.kt @@ -2,12 +2,12 @@ package eu.iamgio.quarkdown.stdlib import eu.iamgio.quarkdown.ast.InlineMarkdownContent import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.quarkdown.Aligned -import eu.iamgio.quarkdown.ast.quarkdown.Box -import eu.iamgio.quarkdown.ast.quarkdown.Clipped -import eu.iamgio.quarkdown.ast.quarkdown.Stacked -import eu.iamgio.quarkdown.ast.quarkdown.Whitespace +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.quarkdown.block.Aligned +import eu.iamgio.quarkdown.ast.quarkdown.block.Box +import eu.iamgio.quarkdown.ast.quarkdown.block.Clipped +import eu.iamgio.quarkdown.ast.quarkdown.block.Stacked +import eu.iamgio.quarkdown.ast.quarkdown.inline.Whitespace import eu.iamgio.quarkdown.context.Context import eu.iamgio.quarkdown.document.size.Size import eu.iamgio.quarkdown.function.reflect.Injected diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Slides.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Slides.kt index 0fec8296..d11cccf4 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Slides.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Slides.kt @@ -1,8 +1,8 @@ package eu.iamgio.quarkdown.stdlib import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.quarkdown.SlidesConfigurationInitializer -import eu.iamgio.quarkdown.ast.quarkdown.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.block.SlidesFragment +import eu.iamgio.quarkdown.ast.quarkdown.invisible.SlidesConfigurationInitializer import eu.iamgio.quarkdown.document.slides.Transition import eu.iamgio.quarkdown.function.reflect.Name import eu.iamgio.quarkdown.function.value.NodeValue diff --git a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt index 21c4caf4..7ff7d2f5 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt @@ -1,10 +1,10 @@ package eu.iamgio.quarkdown.stdlib -import eu.iamgio.quarkdown.ast.Code import eu.iamgio.quarkdown.ast.InlineMarkdownContent import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.quarkdown.TextTransform -import eu.iamgio.quarkdown.ast.quarkdown.TextTransformData +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransform +import eu.iamgio.quarkdown.ast.quarkdown.inline.TextTransformData import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.function.reflect.Injected import eu.iamgio.quarkdown.function.reflect.Name diff --git a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/DataTest.kt b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/DataTest.kt index 07b37884..ae35895f 100644 --- a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/DataTest.kt +++ b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/DataTest.kt @@ -1,7 +1,7 @@ package eu.iamgio.quarkdown.stdlib -import eu.iamgio.quarkdown.ast.Table -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.block.Table +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor import eu.iamgio.quarkdown.function.value.data.Range diff --git a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/FlowTest.kt b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/FlowTest.kt index a6a76d1e..f503ed7b 100644 --- a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/FlowTest.kt +++ b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/FlowTest.kt @@ -1,9 +1,9 @@ package eu.iamgio.quarkdown.stdlib -import eu.iamgio.quarkdown.ast.BaseListItem import eu.iamgio.quarkdown.ast.InlineMarkdownContent import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.UnorderedList +import eu.iamgio.quarkdown.ast.base.block.BaseListItem +import eu.iamgio.quarkdown.ast.base.block.UnorderedList import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor import eu.iamgio.quarkdown.function.call.FunctionCall diff --git a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/TextTest.kt b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/TextTest.kt index 9afd7ec9..970d3a31 100644 --- a/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/TextTest.kt +++ b/stdlib/src/test/kotlin/eu/iamgio/quarkdown/stdlib/TextTest.kt @@ -1,8 +1,8 @@ package eu.iamgio.quarkdown.stdlib -import eu.iamgio.quarkdown.ast.Code import eu.iamgio.quarkdown.ast.MarkdownContent -import eu.iamgio.quarkdown.ast.Text +import eu.iamgio.quarkdown.ast.base.block.Code +import eu.iamgio.quarkdown.ast.base.inline.Text import eu.iamgio.quarkdown.context.MutableContext import eu.iamgio.quarkdown.flavor.quarkdown.QuarkdownFlavor import kotlin.test.Test