ナレーション
マークアップ言語と CSS
Pixi’VN で ink とともに Markdown や CSS スタイルを使用する方法を学びます。競合する記号のエスケープや改行の追加方法も説明します。
ink と Pixi’VN の連携では、テキストに マークアップ を導入するコンポーネントを使いやすくする追加機能が提供されます。
改行
改行するには、エスケープ文字 \n を使用できます。
この場合、Markdown で改行を表示するには、\n\n のように二つの改行指定が必要です。
例:
=== start ===
Hello, this is a test. \\n\\n This is a new line.Markdown
Pixi’VN では、テキストの装飾に Markdown を使用することを推奨します。プロジェクトに Markdown を実装している場合、ink 内のテキストを Markdown 構文で装飾できます。
その際、Markdown 構文の多くの記号は ink の構文 でも使用されることに注意してください。たとえば #、*、/、~、-、| などです。競合を避けるには、Markdown の記号の前にエスケープ文字 \ を置きます。
例:
Hello, this is some *italic* text and this is some **bold** text.\# Markdown Test \\n<>
Hello, this is a test of the markdown parser. Pixi’VN does not manage markdown, but you can implement a markdown parser to display text with markdown syntax. \\n<>
For example in React, you can use the library [@tanstack/markdown](https:\/\/www.npmjs.com/package/@tanstack/markdown). \\n<>
\#\# Bold Text \\n<>
\**This is bold text.** \\n<>
\#\# Italic Text \\n<>
\*This is italic text.* \\n<>
\#\# Delete Text \\n<>
\~~This is deleted text.~~ \\n<>
\#\# Link Test \\n<>
[Link to Google](https:\/\/www.google.com) \\n<>
\#\# H2 Test \\n<>
\#\#\# H3 Test \\n<>
\#\#\#\# H4 Test \\n<>
\#\# Code Test \\n<>
\`Hello World\` \\n<>
\`\`\`js \\n<>
console.log("Hello World") \\n<>
\`\`\` \\n<>
\#\# List Test \\n<>
\- Item 1 \\n<>
\* Item 2 \\n<>
\- [x] Item 3 \\n<>
\#\# Table Test \\n<>
\| Header 1 \| Header 2 \| \\n<>
\| -------- \| -------- \| \\n<>
\| Cell 1 \| Cell 2 \| \\n<>
\#\# Separator Test \\n<>
\*\*\* \\n<>
FooterCSS
HTML と Tailwind CSS のクラスを使ってテキストを装飾することもできます。
例:
<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>.