Limitations
To keep source code valid, typstyle will give up formatting in certain cases. This is a list of what typstyle will not format.
Overall¶
Markup lines¶
Typstyle only formats the code, it does not format the markup lines. It will keep the markup lines as is. Specifically, if a line contains text(ast::Expr::Text
), the whole line will be kept as is.
Math mode¶
Overall there is very few formatting in math mode. It is not well implemented.
@typstyle off¶
Why: It is a directive to turn off formatting.
When there are block comment child, gives up formatting the whole node.¶
Why: We currently cannot handle block comment in all places. It is hard to handle.
1 2 3 4 5 |
|
Multiline raw with single backtick.¶
Why: it is white space dependent
1 2 3 4 5 |
|
When a child contains # in math mode, gives up formatting the whole node.¶
Why: hash can appear anywhere, we cannot handle it very well.
1 |
|
Args in math mode.¶
Why: it works very different. like 2d args, trailing commas
1 |
|
Special¶
Table¶
Typstyle currently tries to format tables into a rectangular shape. However, it only do such formatting when the table is simple enough. Namely:
- no comments
- no spread args
- no named args, or named args appears before all pos args
- no
table/grid.vline/hline/cell
columns
is int or array