Skip to content

feat: adopt compact layout for markup with single primary expressions#400

Merged
QuadnucYard merged 1 commit intotypstyle-rs:masterfrom
QuadnucYard:compact-content-block
Aug 2, 2025
Merged

feat: adopt compact layout for markup with single primary expressions#400
QuadnucYard merged 1 commit intotypstyle-rs:masterfrom
QuadnucYard:compact-content-block

Conversation

@QuadnucYard
Copy link
Copy Markdown
Collaborator

@QuadnucYard QuadnucYard commented Jul 28, 2025

Closes #21, #82

  • Indent the body of a strong / emph expression.
  • Compact layout for markup. For a content block, strong, or emph, if its open boundary is non-breakable, it contains no linebreak or parbreak, and it contains exactly one primary expression (excluding labels, linebreak symbols, and text), do not indent it. This follows feat: further preserve boundary spaces and improve text wrapping #396

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 28, 2025

📊 Benchmark Performance Report

group                               base                                   pr
-----                               ----                                   --
pretty-ai-comprehensive-showcase    1.02   902.5±16.42µs        ? ?/sec    1.00   884.1±10.44µs        ? ?/sec
pretty-cetz-manual                  1.00   747.9±12.03µs        ? ?/sec    1.01   755.9±22.48µs        ? ?/sec
pretty-codly                        1.01  1772.8±22.00µs        ? ?/sec    1.00  1763.2±21.83µs        ? ?/sec
pretty-cpe                          1.51     18.4±2.38ms        ? ?/sec    1.00     12.2±0.75ms        ? ?/sec
pretty-deep-nested-args             1.00     17.7±0.25µs        ? ?/sec    1.01     17.9±0.23µs        ? ?/sec
pretty-fletcher-diagram             1.01   517.4±11.38µs        ? ?/sec    1.00    513.7±9.58µs        ? ?/sec
pretty-fletcher-draw                1.00  1254.5±30.86µs        ? ?/sec    1.00  1254.6±10.51µs        ? ?/sec
pretty-tablex                       1.01      3.4±0.02ms        ? ?/sec    1.00      3.3±0.02ms        ? ?/sec
pretty-touying-core                 1.00      2.1±0.02ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
pretty-touying-utils                1.01  1201.4±26.23µs        ? ?/sec    1.00  1190.8±17.98µs        ? ?/sec
pretty-undergraduate-math           1.00   856.8±14.30µs        ? ?/sec    1.02   870.5±90.21µs        ? ?/sec

📏 Binary Size Comparison

Metric Base PR Change
File Size 5.7 MB 5.7 MB 📈 +4.0 kB (+0.07%)
Text Section 1.4 MB 1.4 MB 📈 +784 B (+0.05%)
📦 Detailed Crate Size Diff (cargo-bloat)

Note: Numbers above are a result of guesswork. They are not 100% correct and never will be.

@@ -1,8 +1,8 @@
-std                       392.0 kB
+std                       391.9 kB
 clap_builder              342.3 kB
-typstyle_core             200.8 kB
+typstyle_core             201.7 kB
 typst_syntax              141.4 kB
 clap_complete             130.8 kB
 similar                   72.5 kB
 typstyle                  54.7 kB
 walkdir                   19.4 kB

Generated by GitHub Actions on 2025-08-01 15:54:13 UTC

@Enter-tainer

This comment was marked as resolved.

@Enter-tainer
Copy link
Copy Markdown
Collaborator

This conflicts with #396

Does this imply we should choose one of them?

@QuadnucYard
Copy link
Copy Markdown
Collaborator Author

This conflicts with #396

Does this imply we should choose one of them?

sorry I didn't make it clear. The two both touch the markup boundary, and that's a git conflict.

@QuadnucYard QuadnucYard force-pushed the compact-content-block branch from 7cd8f67 to 0f1f9ad Compare July 31, 2025 15:16
@QuadnucYard QuadnucYard marked this pull request as draft July 31, 2025 15:16
@QuadnucYard QuadnucYard force-pushed the compact-content-block branch from 0f1f9ad to 6ddebbc Compare August 1, 2025 15:50
@QuadnucYard QuadnucYard marked this pull request as ready for review August 1, 2025 15:50
@QuadnucYard QuadnucYard merged commit 05fbc5d into typstyle-rs:master Aug 2, 2025
20 checks passed
@QuadnucYard QuadnucYard deleted the compact-content-block branch August 2, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content math bad case

2 participants