Skip to content

Commit

Permalink
mark: Add all marks to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Dec 21, 2023
1 parent 989649a commit 1baa842
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/draw/shapes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "/src/hobby.typ" as hobby_
#import "/src/anchor.typ" as anchor_
#import "/src/mark.typ" as mark_
#import "/src/mark-shapes.typ" as mark-shapes_
#import "/src/aabb.typ"

#import "transformations.typ": *
Expand Down Expand Up @@ -475,28 +476,27 @@
///
/// #example(```
/// mark((0,0), (1,0), symbol: ">", fill: black)
/// mark((0,0), (1,1), symbol: ">", scale: 3, fill: black)
/// mark((0,0), (1,1), symbol: "stealth", scale: 3, fill: black)
/// ```)
///
/// Or as part of a path based element that supports the `mark` style key:
///
/// #example(vertical: true, ```
/// rotate(90deg)
/// set-style(mark: (fill: black))
/// line((1, -1), (1, 10), stroke: (paint: gray, dash: "dotted"))
/// line((0, 9), (rel: (1, 0)), mark: (end: ">", harpoon: true))
/// line((0, 8), (rel: (1, 0)), mark: (end: ">", harpoon: true, flip: true))
/// line((0, 7), (rel: (1, 0)), mark: (end: "hook"))
/// line((0, 6), (rel: (1, 0)), mark: (end: "<>"))
/// line((0, 5), (rel: (1, 0)), mark: (end: "o"))
/// line((0, 4), (rel: (1, 0)), mark: (end: "|"))
/// line((0, 3), (rel: (1, 0)), mark: (end: "<"))
/// line((0, 2), (rel: (1, 0)), mark: (end: ">"))
/// set-style(mark: (fill: none))
/// line((0, 1), (rel: (1, 0)), mark: (end: "<"))
/// line((0, 0), (rel: (1, 0)), mark: (end: ">"))
/// set-style(mark: (scale: 1.5, stroke: red))
/// for (i, name) in cetz.mark-shapes.names.enumerate() {
/// line((0, 0), (0, 1), mark: (end: name))
/// content((0, 0), angle: 45deg, name, anchor: "north-east", padding: .1)
/// set-origin((1, 0))
/// }
/// ```)
///
/// The following short names are available:
/// #table(columns: 2*6, stroke: gray,
/// ..(for (short, item) in cetz.mark-shapes.mnemonics {
/// ([#raw(short)], [#item.at(0) #if item.at(1) {[ (reverse) ]}],)
/// })
/// )
///
/// = parameters
///
/// = Styling <mark-styling>
Expand Down
2 changes: 2 additions & 0 deletions src/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#import "process.typ"
#import "util.typ"
#import "path-util.typ"
#import "mark.typ"
#import "mark-shapes.typ"

// Libraries
#import "lib/axes.typ"
Expand Down

0 comments on commit 1baa842

Please sign in to comment.