diff --git a/demo/demo.qmd b/demo/demo.qmd index 291f00d7..b32e8665 100644 --- a/demo/demo.qmd +++ b/demo/demo.qmd @@ -25,8 +25,7 @@ Export your Quarkdown project as: .function {poweredby} credits: - .text size:{tiny} variant:{smallcaps} - powered by .credits + .text {powered by .credits} size:{tiny} variant:{smallcaps} - .fragment beautiful slides for your next presentation, just like this one. @@ -103,8 +102,7 @@ from your Markdown code. ``` .fragment - .text size:{small} - **Hello, world** from Giorgio! + .text {**Hello, world** from Giorgio!} size:{small} .function {sourceresult} @@ -122,8 +120,7 @@ from your Markdown code. !(150x150)[Quarkdown](img/icon.png) .column cross:{start} - .text size:{large} variant:{smallcaps} - **Quarkdown is on GitHub!** + .text {**Quarkdown is on GitHub!**} size:{large} variant:{smallcaps} https://github.com/iamgio/quarkdown @@ -161,8 +158,7 @@ from your Markdown code. ## Scripting {#scripting-basic} -.text size:{small} - Basic algorithm +.text {Basic algorithm} size:{small} .sourceresult .row alignment:{spacearound} @@ -173,8 +169,7 @@ from your Markdown code. ## Scripting {#scripting-fibonacci} -.text size:{small} - Fibonacci sequence +.text {Fibonacci sequence} size:{small} .sourceresult .var {t1} {0} 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 8abb2476..9633030c 100644 --- a/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt +++ b/stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Text.kt @@ -24,6 +24,7 @@ val Text: Module = /** * Creates an inline text node with specified formatting and transformation. + * @param text inline content to transform * @param size font size, or default if not specified * @param weight font weight, or default if not specified * @param style font style, or default if not specified @@ -31,9 +32,9 @@ val Text: Module = * @param case text case, or default if not specified * @param variant font variant, or default if not specified * @param color text color, or default if not specified - * @param content inline content to transform */ fun text( + text: InlineMarkdownContent, size: TextTransformData.Size? = null, weight: TextTransformData.Weight? = null, style: TextTransformData.Style? = null, @@ -41,11 +42,10 @@ fun text( case: TextTransformData.Case? = null, variant: TextTransformData.Variant? = null, color: Color? = null, - content: InlineMarkdownContent, ): NodeValue = TextTransform( TextTransformData(size, weight, style, decoration, case, variant, color), - content.children, + text.children, ).wrappedAsValue() /** diff --git a/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt b/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt index 3b6773ae..e1b02bc4 100644 --- a/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt +++ b/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt @@ -166,7 +166,7 @@ class FullPipelineTest { ) } - execute("This is a .text content:{small text} size:{tiny} variant:{smallcaps}") { + execute("This is a .text {small text} size:{tiny} variant:{smallcaps}") { assertEquals( "

This is a small text

", it, @@ -250,7 +250,7 @@ class FullPipelineTest { assertEquals("

5

", it) } - execute("###### .text size:{tiny} content:{Hello, **world**}") { + execute("###### .text {Hello, **world**} size:{tiny}") { assertEquals("
Hello, world
", it) } @@ -1002,8 +1002,7 @@ class FullPipelineTest { """ .function {poweredby} credits: - .text size:{small} variant:{smallcaps} - powered by .credits + .text {powered by .credits} size:{small} variant:{smallcaps} This **exciting feature**, .poweredby {[Quarkdown](https://github.com/iamgio/quarkdown)}, looks great! """.trimIndent(),