Skip to main content

Text blocks

A Text field that can be used to display a static text (max. 1800 characters) as follows:

class Parametrization(vkt.Parametrization):
not_in_params = vkt.Text('My static text')
note

The value of the Text field is not included in the params.

The value of the Text fields can be styled using Markdown:

import viktor as vkt


class Parametrization(vkt.Parametrization):
info1 = vkt.Text("""
Please select the wing model below ✈️
- 2D: Select 2D to model an **infinite wing**
- 3D: Select 3D to model a *finite wing*, along with the aspect ratio
1. High AR for slender wings
2. Low AR for delta wings
""")
model = vkt.OptionField("Wing model", options=["2D", "3D"])
ar = vkt.NumberField("AR", variant="slider", min=1, max=30)
info2 = vkt.Text("""
### Block / in-line math

#### Lift Coefficient

$$
L = \\frac{1}{2} \\rho v^2 S C_L
$$

where $\\rho = \\frac{m}{v}$. Read more about this equation on
[this page](https://en.wikipedia.org/wiki/Lift_coefficient).

### Horizontal rules

---
---

and another...

---

# Heading level 1
## Heading level 2
""")