From 8050c845e40ada86525763e1b18e5e429b21a304 Mon Sep 17 00:00:00 2001 From: Giorgio Garofalo Date: Mon, 26 Aug 2024 17:35:33 +0200 Subject: [PATCH] Add more documentation to TextTransform components --- .../ast/quarkdown/inline/TextTransform.kt | 109 +++++++++++++++++- 1 file changed, 107 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt index 156b1b9b..8d544cb0 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/inline/TextTransform.kt @@ -9,14 +9,15 @@ import eu.iamgio.quarkdown.visitor.node.NodeVisitor /** * Text transformation a portion of text can undergo. - * If a property is set to `null` it is not specified, hence ignored. + * If a property is set to `null` it is not specified, hence ignored + * and the default value is used. * @param size font size * @param weight font weight * @param style font style * @param decoration text decoration * @param case text case * @param variant font variant - * @param color text color + * @param color text (foreground) color */ class TextTransformData( val size: Size? = null, @@ -27,59 +28,163 @@ class TextTransformData( val variant: Variant? = null, val color: Color? = null, ) { + /** + * Font size, relative to the default font size. + */ enum class Size : RenderRepresentable { + /** + * Tiny font size (50%). + */ TINY, + + /** + * Small font size (75%). + */ SMALL, + + /** + * Normal font size (100%). + */ NORMAL, + + /** + * Medium font size (125%). + */ MEDIUM, + + /** + * Larger font size (150%). + */ LARGER, + + /** + * Large font size (200%). + */ LARGE, + + /** + * Huge font size (300%). + */ HUGE, ; override fun accept(visitor: RenderRepresentableVisitor): T = visitor.visit(this) } + /** + * Font weight. + */ enum class Weight : RenderRepresentable { + /** + * Normal font weight. + */ NORMAL, + + /** + * Bold font weight. + */ BOLD, ; override fun accept(visitor: RenderRepresentableVisitor): T = visitor.visit(this) } + /** + * Font style. + */ enum class Style : RenderRepresentable { + /** + * Normal font style. + */ NORMAL, + + /** + * Italic font style. + */ ITALIC, ; override fun accept(visitor: RenderRepresentableVisitor): T = visitor.visit(this) } + /** + * Text decoration. + */ enum class Decoration : RenderRepresentable { + /** + * No text decoration. + */ NONE, + + /** + * Line under the text. + */ UNDERLINE, + + /** + * Line over the text. + */ OVERLINE, + + /** + * Lines under and over the text. + */ UNDEROVERLINE, + + /** + * Line through the text. + */ STRIKETHROUGH, + + /** + * Lines under, over and through the text. + */ ALL, ; override fun accept(visitor: RenderRepresentableVisitor): T = visitor.visit(this) } + /** + * Text case transformation. + */ enum class Case : RenderRepresentable { + /** + * No text case transformation. + */ NONE, + + /** + * Uppercase text. + */ UPPERCASE, + + /** + * Lowercase text. + */ LOWERCASE, + + /** + * Capitalize text (first letter of each word is uppercase). + */ CAPITALIZE, ; override fun accept(visitor: RenderRepresentableVisitor): T = visitor.visit(this) } + /** + * Font variant. + */ enum class Variant : RenderRepresentable { + /** + * No font variant. + */ NORMAL, + + /** + * Small-caps font variant. + */ SMALL_CAPS, ;