diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/AstIterator.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/AstIterator.kt index 5dc98f73..a348b5b7 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/AstIterator.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/AstIterator.kt @@ -7,7 +7,8 @@ import eu.iamgio.quarkdown.ast.NestableNode */ interface AstIterator { /** - * Runs the iterator from the given root node + * Runs the iterator from the given root node, + * traversing the node tree and visiting each node. */ - fun run(root: NestableNode) + fun traverse(root: NestableNode) } diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/ObservableAstIterator.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/ObservableAstIterator.kt index 01c3bf9a..75b7bb5e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/ObservableAstIterator.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/iterator/ObservableAstIterator.kt @@ -61,7 +61,7 @@ class ObservableAstIterator : AstIterator { hook.attach(this) } - override fun run(root: NestableNode) { + override fun traverse(root: NestableNode) { root.flattenedChildren().forEach { node -> hooks.forEach { hook -> hook(node) } } diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/BaseMarkdownInlineTokenRegexPatterns.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/BaseMarkdownInlineTokenRegexPatterns.kt index 5c9688f1..6b26a22e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/BaseMarkdownInlineTokenRegexPatterns.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/BaseMarkdownInlineTokenRegexPatterns.kt @@ -156,7 +156,7 @@ open class BaseMarkdownInlineTokenRegexPatterns { ) /** - * An image, same as a link preceeded by a `!`. + * An image, same as a link preceded by a `!`. * As an extension, Quarkdown introduces an optional `(WxH)` to be added at the end which specifies * the image size, where W and H can be integers or `_` (auto). * @see ImageToken @@ -176,7 +176,7 @@ open class BaseMarkdownInlineTokenRegexPatterns { ) /** - * An image that references a link definition, same as a reference link preceeded by a `!`. + * An image that references a link definition, same as a reference link preceded by a `!`. * @see ReferenceImageToken * @see referenceLink */ diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/pipeline/Pipeline.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/pipeline/Pipeline.kt index 7a8c1dfd..924e74dd 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/pipeline/Pipeline.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/pipeline/Pipeline.kt @@ -90,7 +90,7 @@ class Pipeline( private fun visitTree(document: Document) { context.flavor.treeIteratorFactory .default(context) - .run(document) + .traverse(document) hooks?.afterTreeVisiting?.invoke(this) } diff --git a/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt b/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt index 2d85c1c2..d643fa22 100644 --- a/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt +++ b/core/src/test/kotlin/eu/iamgio/quarkdown/MiscTest.kt @@ -90,7 +90,7 @@ class MiscTest { assertEquals("java", it.language) } .onFinished { finished = true } - .run(node) + .traverse(node) assertTrue(finished) } diff --git a/demo/demo.qmd b/demo/demo.qmd index 9ef81412..4d0b5f93 100644 --- a/demo/demo.qmd +++ b/demo/demo.qmd @@ -151,8 +151,10 @@ from your Markdown code. ## Math .sourceresult - If we try to calculate the **surface** of a circle of **radius 8**, - we'll find out it's **.multiply {.pow {8} to:{2}} by:{.pi}** + .var {radius} {8} + + If we try to calculate the **surface** of a circle of **radius .radius**, + we'll find out it's **.multiply {.pow {.radius} to:{2}} by:{.pi}** ## Scripting {#scripting-basic}