Skip to content

Commit

Permalink
docs: Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Jan 24, 2025
1 parent d290417 commit 416209b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/api/draw-functions/shapes/polygon.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Polygon from "@site/cetz/docs/_generated/draw/shapes/polygon.mdx";

# polygon

<Polygon />
1 change: 1 addition & 0 deletions docs/api/draw-functions/shapes/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Draw functions that draw shapes onto the canvas, be that lines, circles or curve
- [arc](./arc) Draws an arc between two points.
- [mark](./mark) Draws a mark at a point in a direction.
- [line](./line) Draws a line between two points, or a line strip between 3 or more points.
- [polygon](./polygon) Draws a regular polygon.
- [grid](./grid) Draws a grid.
- [content](./content) Places some content on the canvas.
- [rect](./rect) Draws a rectangle between two points.
Expand Down
2 changes: 2 additions & 0 deletions docs/api/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default [
"api/draw-functions/shapes/arc",
"api/draw-functions/shapes/mark",
"api/draw-functions/shapes/line",
"api/draw-functions/shapes/polygon",
"api/draw-functions/shapes/grid",
"api/draw-functions/shapes/content",
"api/draw-functions/shapes/rect",
Expand All @@ -42,6 +43,7 @@ export default [
"api/draw-functions/grouping/intersections",
"api/draw-functions/grouping/group",
"api/draw-functions/grouping/anchor",
"api/draw-functions/grouping/scope",
"api/draw-functions/grouping/copy-anchors",
"api/draw-functions/grouping/set-ctx",
"api/draw-functions/grouping/get-ctx",
Expand Down
6 changes: 6 additions & 0 deletions src/draw/shapes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@

/// Draws a regular polygon.
///
/// ```typc example
/// polygon((0,0), 3, angle: 90deg)
/// polygon((2,0), 5)
/// polygon((4,0), 7)
/// ```
///
/// - origin (coordinate): Coordinate to draw the polygon at
/// - sides (int): Number of sides of the polygon (>= 3)
/// - angle (angle) = 0deg: Angle angle to rotate the polygon arround its origin
Expand Down

0 comments on commit 416209b

Please sign in to comment.