Write markdown-like checklist easily.
Checklists are incredibly useful for keeping track of important items. We can use the cheq package to achieve checklist syntax similar to GitHub Flavored Markdown and Minimal.
#import "@preview/cheq:0.2.2": checklist
#show: checklist
= Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [-] Jupiter
- [/] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
= Extras
- [>] Forwarded
- [<] Scheduling
- [?] question
- [!] important
- [\*] star
- ["] quote
- [l] location
- [b] bookmark
- [i] information
- [S] savings
- [I] idea
- [p] pros
- [c] cons
- [f] fire
- [k] key
- [w] win
- [u] up
- [d] down
#import "@preview/cheq:0.2.2": checklist
#show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em)
= Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [-] Jupiter
- [/] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
#show: checklist.with(marker-map: (" ": sym.ballot, "x": sym.ballot.x, "-": sym.bar.h, "/": sym.slash.double))
= Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [-] Jupiter
- [/] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
#let checklist(
fill: white,
stroke: rgb("#616161"),
radius: .1em,
marker-map: (:),
body,
) = { .. }
Arguments:
fill
: [string
] — The fill color for the checklist marker.stroke
: [string
] — The stroke color for the checklist marker.radius
: [string
] — The radius of the checklist marker.marker-map
: [map
] — The map of the checklist marker. It should be a map of character to symbol function, such as(" ": sym.ballot, "x": sym.ballot.x, "-": sym.bar.h, "/": sym.slash.double)
.show-list-set-block
: [dictionary
] - The configuration of the block in list. It should be a dictionary ofabove
andbelow
keys, such as(above: .5em)
.body
: [content
] — The main body from#show: checklist
rule.
The default map is:
#let default-map = (
"x": checked-sym(fill: fill, stroke: stroke, radius: radius),
" ": unchecked-sym(fill: fill, stroke: stroke, radius: radius),
"/": incomplete-sym(fill: fill, stroke: stroke, radius: radius),
"-": canceled-sym(fill: fill, stroke: stroke, radius: radius),
">": "➡",
"<": "📆",
"?": "❓",
"!": "❗",
"*": "⭐",
"\"": "❝",
"l": "📍",
"b": "🔖",
"i": "ℹ️",
"S": "💰",
"I": "💡",
"p": "👍",
"c": "👎",
"f": "🔥",
"k": "🔑",
"w": "🏆",
"u": "🔼",
"d": "🔽",
)
#let unchecked-sym(fill: white, stroke: rgb("#616161"), radius: .1em) = { .. }
Arguments:
fill
: [string
] — The fill color for the unchecked symbol.stroke
: [string
] — The stroke color for the unchecked symbol.radius
: [string
] — The radius of the unchecked symbol.
#let checked-sym(fill: white, stroke: rgb("#616161"), radius: .1em) = { .. }
Arguments:
fill
: [string
] — The fill color for the checked symbol.stroke
: [string
] — The stroke color for the checked symbol.radius
: [string
] — The radius of the checked symbol.
#let incomplete-sym(fill: white, stroke: rgb("#616161"), radius: .1em) = { .. }
Arguments:
fill
: [string
] — The fill color for the incomplete symbol.stroke
: [string
] — The stroke color for the incomplete symbol.radius
: [string
] — The radius of the incomplete symbol.
#let canceled-sym(fill: white, stroke: rgb("#616161"), radius: .1em) = { .. }
Arguments:
fill
: [string
] — The fill color for the canceled symbol.stroke
: [string
] — The stroke color for the canceled symbol.radius
: [string
] — The radius of the canceled symbol.
This project is licensed under the MIT License.