Linguaggio di markup e CSS
Learn how to use Markdown and CSS styling with ink in Pixi’VN, including escaping conflicting symbols and adding new lines.
The ink + Pixi’VN integration provides some additional features to facilitate the use of components that introduce a Markup in the text.
New Lines
To create a new line, you can use the escape character \n.
In our case, since we use Markdown to display the line break, we will need two \n\n.
Ad esempio:
=== start ===
Hello, this is a test. \\n\\n This is a new line.Markdown
On Pixi’VN it is recommended to use Markdown to add style to your text. If you have implemented Markdown in your project then you will be able to use Markdown syntax to style your text in ink.
To do this you need to keep in mind that many symbols of Markdown syntax are also used by ink syntax, such as: #, *, /, ~, -, | etc. To avoid conflicts you can use the escape character \ before the Markdown symbol.
Ad esempio:
Hello, this is some *italic* text and this is some **bold** text.CSS
You can also use Tailwind CSS classes to format text using HTML.
Ad esempio:
<span class="inline-block text-blue-500">some *blue* text</span>.
<span class="inline-block text-red-500">some *red* text</span>.
<span class="inline-block text-green-500">some *green* text</span>.