add text styles docs

This commit is contained in:
MihailRis 2024-12-06 18:36:16 +03:00
parent 47259d5590
commit 63c10979f5
4 changed files with 45 additions and 1 deletions

View File

@ -14,9 +14,10 @@ Documentation for in-development version 0.26.
- [Content-packs](content-packs.md)
- [Engine usage recommendations](engine-use-recommendations.md)
- [Item properties](item-properties.md)
- [Particles](particles.md)
- [Resources (resources.json)](resources.md)
- [Rigging](rigging.md)
- [Scripting](scripting.md)
- [Text styles](text-styles.md)
- [World generator engine](world-generator.md)
- [XML UI building](xml-ui-layouts.md)
- [Particles](particles.md)

21
doc/en/text-styles.md Normal file
View File

@ -0,0 +1,21 @@
# Text styles
A proprietary Markdown dialect is used to mark up text styles.
Formatting works on UI elements: label and textbox, if `markdown="true"` is explicitly specified.
## Styles
| Style | Example | Output |
| ------------- | ------------------------ | -------------------------- |
| Bold | `**Bold font**` | **Bold font** |
| Italic | `*Text in italics*` | *Text in italics* |
| Underline | `__Underlined text__` | <ins>Underlined text</ins> |
| Strikethrough | `~~Strikethrough text~~` | ~~Strikethrough text~~ |
Styles can be combined. Example:
```md
***__Message__*** using *~~combed~~ combined* styles__~~.~~__
```
Output:
***<ins>Message</ins>*** using *~~combed~~ combined* styles<ins>~~.~~</ins>

View File

@ -19,4 +19,5 @@
- [Свойства блоков](block-properties.md)
- [Свойства предметов](item-properties.md)
- [Скриптинг](scripting.md)
- [Стили текста](text-styles.md)
- [Частицы](particles.md)

21
doc/ru/text-styles.md Normal file
View File

@ -0,0 +1,21 @@
# Стили текста
Для разметки стилей текста используется собственный диалект Markdown.
Форматирование работает на UI элементах: label и textbox, если явно указано `markdown="true"`.
## Стили
| Стиль | Пример | Вывод |
| ------------ | ------------------------- | ----------------------- |
| Жирный | `**Жирный шрифт**` | **Жирный шрифт** |
| Курсив | `*Текст курсивом*` | *Текст курсивом* |
| Подчеркнутый | `__Подчеркнутый текст__` | <ins>Подчеркнутый</ins> |
| Зачеркнутый | `~~Зачеркнутый текст~~` | ~~Зачеркнутый~~ |
Стили могут объединяться. Пример:
```md
***__Сообщение__***, демонстрирующее *~~обедненные~~ объединенные* стили__~~.~~__
```
Вывод:
***<ins>Сообщение</ins>***, демонстрирующее *~~обедненные~~ объединенные* стили<ins>~~.~~</ins>