From f81e85fb95bc54c94e83dde908a066456c342ea6 Mon Sep 17 00:00:00 2001 From: Andrew Voynov Date: Wed, 5 Feb 2025 00:25:35 +0300 Subject: [PATCH] docs: replaced 2 blocks with a table --- crates/typst-library/src/layout/ratio.rs | 32 +++++++----------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/crates/typst-library/src/layout/ratio.rs b/crates/typst-library/src/layout/ratio.rs index 4bd58e305..1343393d4 100644 --- a/crates/typst-library/src/layout/ratio.rs +++ b/crates/typst-library/src/layout/ratio.rs @@ -34,29 +34,15 @@ use crate::foundations::{repr, ty, Repr}; /// multiply ratio by ratio, [length], [relative length]($relative), [angle], /// [int], [float], and [fraction]. /// -/// ```example -/// #ratio: #(27% * 10%) \ -/// #length: #(27% * 100pt) \ -/// #relative: #(27% * (10% + 100pt)) \ -/// #angle: #(27% * 100deg) \ -/// #int: #(27% * 2) \ -/// #float: #(27% * 0.37037) \ // Some rounding is happening. -/// #fraction: #(27% * 3fr) -/// -/// #table( -/// columns: 2, -/// align: (right, left), -/// inset: (x: 2pt), -/// table.vline(x: 1, stroke: none), -/// [#ratio:], [#(27% * 10%)], -/// [#length:], [#(27% * 100pt)], -/// [#relative:], [#(27% * (10% + 100pt))], -/// [#angle:], [#(27% * 100deg)], -/// [#int:], [#(27% * 2)], -/// [#float:], [#(27% * 0.37037)], // Some rounding is happening. -/// [#fraction:], [#(27% * 3fr)], -/// ) -/// ``` +/// | Multiply by | Example | +/// |-----------------|--------------------------------------------------| +/// | `{ratio}` | `{27% * 10%}` | +/// | `{length}` | `{27% * 100pt}` | +/// | `{relative}` | `{27% * (10% + 100pt)}` | +/// | `{angle}` | `{27% * 100deg}` | +/// | `{int}` | `{27% * 2}` | +/// | `{float}` | `{27% * 0.37037 // Some rounding is happening.}` | +/// | `{fraction}` | `{27% * 3fr}` | /// /// # Example /// ```example