Skip to content

Commit 03fb26f

Browse files
committed
manual: Fix the manual + Update Tidy
1 parent 49548df commit 03fb26f

22 files changed

+81
-80
lines changed

common

doc/example.typ

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
let canvas-background = yellow.lighten(95%)
2222

2323
let picture = cetz.canvas(
24-
eval(
24+
std.eval(
2525
example-preamble + source,
26-
scope: example-scope
26+
scope: example-scope,
2727
),
2828
..args
2929
)

doc/style.typ

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#import "example.typ": example
21
#import "/src/lib.typ"
32

4-
#import "@preview/tidy:0.3.0"
3+
#import "@preview/tidy:0.4.3"
54
#import "@preview/t4t:0.3.2": is
65

76
#let show-function(fn, style-args) = {
@@ -84,11 +83,11 @@
8483
tidy.parse-module(
8584
read(path),
8685
scope: (
87-
example: example,
8886
show-parameter-block: show-parameter-block,
8987
cetz: lib
9088
)
9189
),
90+
first-heading-level: 1,
9291
show-outline: false,
9392
sort-functions: none,
9493
)

gallery/cycles.png

48 Bytes
Loading

manual.pdf

-103 KB
Binary file not shown.

manual.typ

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
#import "/doc/example.typ": example
44
#import "/doc/style.typ" as doc-style
55
#import "/src/lib.typ": *
6-
#import "@preview/tidy:0.3.0"
6+
#import "@preview/tidy:0.4.3"
77

88

99
// Usage:
10-
// ```example
10+
// ```cexample
1111
// /* canvas drawing code */
1212
// ```
13-
#show raw.where(lang: "example"): example
14-
#show raw.where(lang: "example-vertical"): example.with(vertical: true)
13+
//
14+
// Why cexample? Because tidy thinks it has to mess
15+
// with each raw block...
16+
#show raw.where(lang: "cexample"): example
17+
#show raw.where(lang: "cexample-vertical"): example.with(vertical: true)
1518

1619
#make-title()
1720

@@ -64,7 +67,7 @@ You can use style root `axes` with the following keys:
6467
#doc-style.parse-show-module("/src/axes.typ")
6568

6669
=== Example
67-
```example
70+
```cexample
6871
import cetz.draw: *
6972
import cetz-plot: *
7073

src/chart/barchart.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// rectangular bars that grow from left to right, proportional to the values
1717
/// they represent.
1818
///
19-
/// = Styling
19+
/// === Styling
2020
/// Can be applied with `cetz.draw.set-style(barchart: (bar-width: 1))`.
2121
///
2222
/// *Root*: `barchart`.

src/chart/boxwhisker.typ

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
/// Add one or more box or whisker plots.
1313
///
14-
/// #example(```
14+
/// ```cexample
1515
/// chart.boxwhisker(size: (2,2), label-key: none,
1616
/// y-min: 0, y-max: 70, y-tick-step: 20,
1717
/// (x: 1, min: 15, max: 60,
1818
/// q1: 25, q2: 35, q3: 50))
19-
/// ```)
19+
/// ```
2020
///
21-
/// = Styling
21+
/// === Styling
2222
/// *Root* `boxwhisker`
2323
/// #show-parameter-block("box-width", "float", default: .75, [
2424
/// The width of the box. Since boxes are placed 1 unit next to each other,

src/chart/columnchart.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// rectangular bars that grow from bottom to top, proportional to the values
1717
/// they represent.
1818
///
19-
/// = Styling
19+
/// === Styling
2020
/// *Root*: `columnchart`.
2121
/// #show-parameter-block("bar-width", "float", default: .8, [
2222
/// Width of a single bar (basic) or a cluster of bars (clustered) in the plot.])

src/chart/piechart.typ

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
/// Draw a pie- or donut-chart
9191
///
92-
/// #example(```
92+
/// ```cexample
9393
/// let data = (24, 31, 18, 21, 23, 18, 27, 17, 26, 13)
9494
/// let colors = gradient.linear(red, blue, green, yellow)
9595
///
@@ -99,9 +99,9 @@
9999
/// slice-style: colors,
100100
/// inner-radius: .5,
101101
/// outer-label: (content: "%",))
102-
/// ```)
102+
/// ```
103103
///
104-
/// = Styling
104+
/// === Styling
105105
/// *Root* `piechart` \
106106
/// #show-parameter-block("radius", ("number"), [
107107
/// Outer radius of the chart.], default: 1)
@@ -157,7 +157,7 @@
157157
/// #show-parameter-block("legend.label", ("none","string","function"), [
158158
/// See `outer-label.content`. The legend gets shown if this key is set != none.], default: "LABEL")
159159
///
160-
/// = Anchors
160+
/// === Anchors
161161
/// The chart places one anchor per item at the radius of it's slice that
162162
/// gets named `"item-<index>"` (outer radius) and `"item-<index>-inner"` (inner radius),
163163
/// where index is the index of the sclice data in `data`.

0 commit comments

Comments
 (0)