| 1 | PyTermGUI offers a markup language complimentary to the other features of the library, named **T**erminal **I**nline **M**arkup, or **TIM** for short. This language is in use in various places within the library, and is supported by pretty much everything we offer that displays text. |
| 2 | |
| 3 | ```python |
| 4 | --8<-- "docs/src/tim/index.py" |
| 5 | ``` |
| 6 | |
| 7 | |
| 8 | ```termage-svg include=docs/src/tim/index.py title=TIM\ Example height=4 |
| 9 | ``` |
| 10 | |
| 11 | ## Philosophy |
| 12 | |
| 13 | - **Convenience** |
| 14 | |
| 15 | Raw ANSI sequences are cumbersome to use and hard to read/write. TIM aims to improve this by assigning easy-to-read names to pretty much all ANSI syntax. |
| 16 | |
| 17 | - **Speed** |
| 18 | |
| 19 | Since this language is meant to be used in performance-critical applications, it must be pretty fast. As of 16th of July 2022, TIM is magnitudes faster than [Rich](https://github.com/textualize/rich)'s own markup language, the only "competition" I know about. |
| 20 | |
| 21 | This is achieved mostly by smart caching routines, as well as a tightly written parsing algorithm. |
| 22 | |
| 23 | - **Extensibility** |
| 24 | |
| 25 | I like tinkering. I hate using things that are made with the philosophy of "this is what I made, and it's all that you will get.". TIM implements customizability in its [alias](usage/#alias) and [macro](usage/#macros) systems. |
| 26 | |
| 27 | - **Convenience & granularity** |
| 28 | |
| 29 | Above all, TIM was made to be simple and ergonomic to use. Styles follow their most-commonly used names, and every tag is applied as its own distinct entity, and aren't joined into a set style. This allows you to specifically clear certain tags, while not touching the rest of the style. |