Conversation
piepert
left a comment
There was a problem hiding this comment.
I really like your idea. I'm sorry if I am opinionated on this, but I'd like to make sure that this package stays consistent in aesthetics and API design. So my intuition might be a bit nitpicky with your changes or how to approach this generally.
Some general ideas for this PR that I'm not going to review individually for each file:
- I thought about every template offering a
format-authors: (authors) => ...function that makes it customizable how the authors are formatted. But maybe it's just okay to not have this function and just be opinionated about how authors are displayed. I'd like to hear your thoughts on this. - Maybe the old
authorattribute can be deleted. At least I don't want to see templates where bothauthorandauthorsare used in the same template functions. I tend toauthorand then just give it an array if there are multiple authors like you implemented. The package has to check ifauthoris either (1) a single string like currently implemented, (2) just one author dictionary (name, email, ...) or (3) an array of authors just like you implemented. After normalization, formatting it could be handled by theformat-authorsfunction.
There was a problem hiding this comment.
I think we already have enough example files and the examples don't need to display every possible version of a document. So I think it'd be best if no new example files are added.
| table(columns: (auto, auto, auto, auto), | ||
| stroke: white, | ||
| inset: 0cm, | ||
| if is-multi-author { |
There was a problem hiding this comment.
I suggest this:
if is-multi-author {
stack(
spacing: 3em,
..normalized-authors.map(e => grid(columns: 2,
row-gutter: 2em,
column-gutter: 1em,
strong[Ort, Datum: ], box(width: 1fr, repeat(".", gap: 0.1em)),
strong[Unterschrift: ], box(width: 1fr, repeat(".", gap: 0.1em)),
none, [#v(-1em) (#e.name)]
))
)
} else { ...| ( | ||
| name: item.at("name"), | ||
| email: _dict-get(item, "email"), | ||
| student-number: _dict-get(item, "student-number", aliases: ("student_number",)), |
There was a problem hiding this comment.
Why aliases? I don't think it's a task of the package to correct users' typing mistakes.
| if authors.len() == 0 { | ||
| none | ||
| } else { | ||
| authors.map(author => [ |
There was a problem hiding this comment.
Again, a bit hacky, but I'd suggest the following for more natural spacing:
box(stack(spacing: 1em, ..authors.map(author => [
#let name = author-name(author, link-names: link-names)
#let student-number = author.at("student-number")
#if student-number != none {
name + [ (#student-number)]
} else {
name
}
#if author.at("address") != none [\ #author.at("address")]
])))
Just had this problem, for a group assignment. I know you are busy, and I'm currently mainly running my own version... so if you find it useful you can apply the implementation. Have a good one as always.