-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
core/src/main/kotlin/eu/iamgio/quarkdown/ast/quarkdown/block/Container.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package eu.iamgio.quarkdown.ast.quarkdown.block | ||
|
||
import eu.iamgio.quarkdown.ast.NestableNode | ||
import eu.iamgio.quarkdown.ast.Node | ||
import eu.iamgio.quarkdown.document.size.Sizes | ||
import eu.iamgio.quarkdown.misc.color.Color | ||
import eu.iamgio.quarkdown.visitor.node.NodeVisitor | ||
|
||
/** | ||
* A general-purpose container that groups content. | ||
* @param foregroundColor text color | ||
* @param backgroundColor background color | ||
* @param padding whitespace around the content | ||
* @param cornerRadius border radius of the container | ||
*/ | ||
data class Container( | ||
val foregroundColor: Color? = null, | ||
val backgroundColor: Color? = null, | ||
val padding: Sizes? = null, | ||
val cornerRadius: Sizes? = null, | ||
override val children: List<Node>, | ||
) : NestableNode { | ||
override fun <T> accept(visitor: NodeVisitor<T>): T = visitor.visit(this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/src/test/resources/rendering/quarkdown/container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div class="container"> | ||
<p> | ||
Foo bar | ||
</p> | ||
<blockquote> | ||
<p> | ||
Baz | ||
</p> | ||
</blockquote> | ||
</div> | ||
|
||
--- | ||
|
||
<div style="color: rgba(100, 20, 80, 1.0); background-color: rgba(10, 20, 30, 1.0);" class="container"> | ||
<p> | ||
Foo bar | ||
</p> | ||
<blockquote> | ||
<p> | ||
Baz | ||
</p> | ||
</blockquote> | ||
</div> | ||
|
||
--- | ||
|
||
<div style="background-color: rgba(10, 20, 30, 1.0); padding: 2.0cm 3.0cm 2.0cm 3.0cm; border-radius: 12.0px 12.0px 12.0px 12.0px;" class="container"> | ||
<p> | ||
Foo bar | ||
</p> | ||
<blockquote> | ||
<p> | ||
Baz | ||
</p> | ||
</blockquote> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters