Closed ParadaCarleton closed 1 year ago
There are already some examples in which this probably also fails. I just didn't check them since I was in a hurry. But adding some CI would be awesome and should be "relatively" simple now that png export is supported.
This unfortunately reintroduces #9. I think that if figure.has("caption") { figure.caption.body }
is the right thing to here as suggested in #13.
If you want to update this PR, I'm happy to merge it later (after checking the sample files this time 😅).
When I tried that approach, I got:
error: function `figure` does not contain field `has`
┌─ lemmify/src/util.typ:24:19
│
24 │ body = if figure.has("caption") {
│ ^^^
help: error occurred while applying show rule to this figure
┌─ lemmify/src/util.typ:7:4
│
7 │ ╠figure(
8 │ │ content,
9 │ │ caption: name,
10 │ │ kind: group,
11 │ │ supplement: subgroup,
12 │ │ numbering: numbering
13 │ │ )
│ ╰─────^
It should have been if fig.has("caption") { fig.caption.body }
.
It should have been
if fig.has("caption") { fig.caption.body }
.
Thanks!
I accidentally opened two PRs so I'm gonna close this now :sweat_smile:
I think this fixes #13. But because Typst is too new to have stuff like testing frameworks, it's a bit hard to know :sweat_smile:
It should be possible to set up a very basic GitHub workflow to test whether anything fails to compile, though. (@laurmaedje would you happen to have code on hand for this?)