Skip to content

Change the way to differentiate between tudaexercise-exercise and -submission #20

@St0rml

Description

@St0rml

Hey,
firstly, thank you for creating this package! I've used it now for quite a bit and it worked really well :)

I do, however, think that the way that the user is required to provide info for the title-sub-parameter in the tudaexercise template is quite confusing. The documentation for title-sub.submission() and title-sub.excercise() is only found in the source code and therefore quite inaccessible for anyone, who does not want to change anything in the template. Also, the way the implementation is at the moment, it's difficult to extend and adapt the code, e.g. for a unified language handling system for all templates (which I am going to open another Issue & PR for shortly).

In short, I get why the implementation is how it is, but I want to suggest a more user-friendly implementation of differentiation between "exercise" and "submission" as laid out in the following:

  1. Remove parameter title-sub
  2. The user can switch between exercise template "exercise" and "submission" via a top level parameter of tudaexercise
  3. Predefined fields (term, date, sheet, group, tutor, lecturer) are all provided via the info dictionary. Logic can then select the needed predefined fields depending on the type of exercise (submission or exercise)
  4. Any custom additional fields should also be specified by the user in info but using string notation.
  5. To allow for customization of the previous title-sub layout, introduce new parameter info-layout. Here, keys specified in info can be assigned to left or right by adding the key to the respective array.
#show: tudaexercise.with(
  type: "exercise" // Choose between "exercise" and "submission"
  language: "en",
  info: (
    title: "Usage of TUDaExercise",
    subtitle: "A small guide.",
    author: (("Andreas", "129219"), "Dennis"),
    term: "Summer semester 2021",
    date: datetime.today(),
    sheet: 5,
    group: 1,
    tutor: "Dr. John Smith",
    lecturer: "Prof. Dr. Jane Doe",
    "A custom key": "A custom value",
  ),
  info-layout: (
    left: ("term", "date", "sheet", "group"),
    right: ("tutor", "lecturer", "A custom key"),
  ),
  logo: image("logos/tuda_logo_replace.svg"),
  design: (
    accentcolor: "0b",
    colorback: true,
    darkmode: false,
  ),
  task-prefix: none,
)

Please let me know what you think about that suggestion. I will open a PR soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions