Fix #97. Typstyle previously add an extra newline for table and grid when there is no positional argument and there are extra arguments. Now it doesn't add an extra newline.
Typstyle cli now returns non-zero exit code when there are formatting errors.
v0.11.26 - [2024-06-13]
Typstyle now keeps newlines in function call args. Multiple newlines in function call args are common in fletcher diagrams. Before this release, typstyle removes all extra newlines in function call args. Now it keeps them as they are.
For tables, if typstyle is unable to format it in a column-aware way, it will now format each arg, but do not reflow them. That is, the relative position of each arg is kept. If you put something in a single line, it will stay in a single line. Newlines are also kept.
Example
12345678
#table(columns: 4 * (1fr,),
[a], [b], [c], [d],
fill: (_, y) => if y == 0 { black },
table.cell(rowspan: 2)[aa], table.cell(colspan: 2)[bc], [d],
[b], table.cell(colspan: 2)[cd],
)
After formatting, it will become this. Notice the relative position of each arg is kept.
1 2 3 4 5 6 7 8 910
#table(columns: 4 * (1fr,),
[a], [b], [c], [d],
fill: (_, y) => if y == 0 {
black
},
table.cell(rowspan: 2)[aa], table.cell(colspan: 2)[bc], [d],
[b], table.cell(colspan: 2)[cd],
)
v0.11.25 - [2024-06-09]
Typstyle now keeps extra newlines in markup mode. Multiple newlines are sometimes used to separate different sections in a document or act as a paragraph placeholder. Typstyle now keeps them as they are.
Typstyle now can format table and grid in a "column-aware" way. It now recognizes basic patterns and column numbers, and put a single row in a single line if possible.
API Change: allow takes a typst::Source as input to avoid re-parsing
v0.11.13 - [2024-04-12]
(#49) typstyle cli now support multiple input files. If multiple files are provided, they will be processed in order.
This is especially useful when you want to format multiple files inplace with a single command.
1
typstyle-i**/*.typ
v0.11.12 - [2024-04-09]
Improve performance when formatting nested structures.
Previously it takes infinite time to format this code:
Fix flavor detection for function call args. It now works correctly when the first space in the args contains a newline.
v0.11.10 - [2024-04-02]
Block math equations are no longer indented.
We now support flavor detection for block equations.
For example, this code:
123456
$F(x) = integral_0^x f(t) dif t
$$F(x) = integral_0^x f(t) dif t
$
After formatting, it will become:
12345
$
F(x) = integral_0^x f(t) dif t
$$F(x) = integral_0^x f(t) dif t $
v0.11.9 - [2024-04-01]
Trailing spaces are now trimmed.
Spread args/array/dict into multiple lines if the first space in it contains a newline. This enables flexible control over the formatting of spread args.
This is called flavor detection.