Skip to content

Commit

Permalink
chore: bump to v0.12.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Dec 7, 2024
1 parent 2953ef7 commit cf01976
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## v0.12.8 - [2024-12-07]

- Typstyle will format binary expressions as operator chains. Parentheses are added if necessary.
- Formatting chains with comments is supported now. This is the last piece of formatting with comments.
- Dot chains in markup with parentheses will be broken into multiple lines, if the it contains at least two dots and one function calls.

For example, [the following code](https://github.com/flaribbit/indenta/blob/a6a0c3fa45b4f16f1944b7078678fa4011bbc1fb/lib.typ#L4C1-L5C1):
```typst
#let _is_block(e,fn)=fn==heading or (fn==math.equation and e.block) or (fn==raw and e.has("block") and e.block) or fn==figure or fn==block or fn==list.item or fn==enum.item or fn==table or fn==grid or fn==align or (fn==quote and e.has("block") and e.block)
```

Will be formatted as this in previous versions:
```typst
#let _is_block(e, fn) = (
fn == heading or (fn == math.equation and e.block) or (
fn == raw and e.has("block") and e.block
) or fn == figure or fn == block or fn == list.item or fn == enum.item or fn == table or fn == grid or fn == align or (
fn == quote and e.has("block") and e.block
)
)
```

Now it will be formatted as:
```typst
#let _is_block(e, fn) = (
fn == heading
or (fn == math.equation and e.block)
or (fn == raw and e.has("block") and e.block)
or fn == figure
or fn == block
or fn == list.item
or fn == enum.item
or fn == table
or fn == grid
or fn == align
or (fn == quote and e.has("block") and e.block)
)
```


## v0.12.7 - [2024-12-04]

- Dot chain related improvement:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typstyle"
version = "0.12.7"
version = "0.12.8"
edition = "2021"
authors = ["Wenzhuo Liu"]
license = "Apache-2.0"
Expand Down
8 changes: 2 additions & 6 deletions docs/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ Formatting in math mode is minimal and not well-implemented at this time.

### Expressions with Comments

In the following scenarios, when a block comment is present as a child, the entire node is skipped for formatting:
When a block comment is present as a child in math mode, the entire node is skipped for formatting:

- Parenthesized (e.g., `((a))`)
- Field access (e.g., `a.b.c`)
- Function call (e.g., `f(a, b, c)`)

Why: These cases require special handling to bring better reading experience. Interspersing comments within them introduces additional complexity that is not yet resolved.
Why: This require special handling to bring better reading experience. Interspersing comments within them introduces additional complexity that is not yet resolved.

We guarantee that in all formatable cases, no comments should be lost.
If any comments are lost, please submit a PR to present the issue.
Expand Down

0 comments on commit cf01976

Please sign in to comment.