mkdocs inited

This commit is contained in:
2023-06-10 01:50:56 +06:00
parent 43f8fcaf6e
commit b08ddfea84
25 changed files with 1563 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# Text
For the text creating there are several tools. The most simple one is to concatenate several text sources to make list of text sources as a result:
```kotlin
val sources = "Regular start of text " + bold("with bold part") + italic("and italic ending")
```
But there is a little bit more useful way: entities builder:
```kotlin
val items = (0 until 10).map { it.toString() }
buildEntities(" ") {// optional " " auto separator which will be pasted between text sources
+"It is regular start too" + bold("it is bold as well")
items.forEachIndexed { i, item ->
if (i % 2) {
italic(item)
} else {
strikethrough(item)
}
}
}
```
In the code above we are creating an items list just for demonstrating that inside of buildEntities body we may use any operations for cunstructing our result list of `TextSource`s. As a result, will be created the list which will looks like in telegram as "It is regular start too **it is bold as well** *0* ~~1~~ *2* ~~3~~ *4* ~~5~~ *6* ~~7~~ *8* ~~9~~".