Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple dates in cvEntry #88

Merged
merged 8 commits into from
Feb 21, 2025
Merged

Conversation

LeWimbes
Copy link
Contributor

This pull request introduces support for multiple dates for a single position. The feature reduces redundancy and saves space for recurring roles such as internships and teaching assistant positions.
To achieve this, a cvEntry is split into two columns: the first column contains the logo, title, society, description, and tags, while the second column displays the location and date(s) only.

image

@yunanwg
Copy link
Owner

yunanwg commented Feb 15, 2025

Actually I thought of having this kind of feature, but put it on hold for complexity reason.

To me, it will be superb to have one entry with multiple dates; but that ideally if we have also have separate entryDescriptions. Imagine working as an intern first and then full-time will definitely have different scope and missions.

I haven't got the occasion to think this over, but definitely open to your idea!

@LeWimbes
Copy link
Contributor Author

I absolutely agree that this would be an amazing feature! In your example, though, we wouldn’t just need a different description; we’d likely also need a different title, and in the "worst" case, even the location could be different, with only the society remaining the same.

At the moment, I’m not entirely sure how to implement something like this (I only started using typst a few days ago). If I come up with a solution, I’ll happily open another PR. For now, though, I believe this lies outside the scope of this current PR.

@yunanwg
Copy link
Owner

yunanwg commented Feb 16, 2025

I understand. Will take a look on this in the following days to see if I can come up with a better solution; otherwise I will accept this PR as it is.

@yunanwg yunanwg force-pushed the allow_multiple_dates branch from 6eae923 to cc3f553 Compare February 16, 2025 18:57
@yunanwg yunanwg self-requested a review February 16, 2025 19:06
@yunanwg yunanwg marked this pull request as draft February 16, 2025 19:07
@LeWimbes LeWimbes force-pushed the allow_multiple_dates branch from cc3f553 to 7094b9d Compare February 16, 2025 22:02
@LeWimbes
Copy link
Contributor Author

I gave it some thought, and so far the best I can come up with is an array of dictionaries:

#let cvEntryComplex(
  society: "Society",
  location: "Location",
  logo: "",
  tags: (),
  positions: ((title: "Title", date: "Date(s)", description: "Description")),
  metadata: metadata,
  awesomeColors: awesomeColors,
) = {
  [TODO]
}

As I mentioned earlier, it might even make sense to include the location in this dictionary. (Maybe even the tags?)
One thing that's definitely a must as far as I can see is that display_entry_society_first must be true for any of this to work.

@yunanwg yunanwg force-pushed the allow_multiple_dates branch from 7094b9d to bcdfaf0 Compare February 17, 2025 10:38
Implement a new function `cvEntryContinued` that allows for creating continued entries in the CV with flexible styling and layout options. The function supports:
- Customizable entry details (title, society, date, location)
- Optional logo display
- Styling for tags and descriptions
- Conditional layout based on metadata settings

Signed-off-by: yunanwg <[email protected]>
@yunanwg
Copy link
Owner

yunanwg commented Feb 17, 2025

So I've added a new function cvEntryContinued, which is basically a replicate of cvEntry, but with logo, and A line ripped off. Here is the visual with and without logo.

CleanShot 2025-02-17 at 12 00 23@2x
CleanShot 2025-02-17 at 12 00 16@2x

Do you think it's a viable approach?

@yunanwg
Copy link
Owner

yunanwg commented Feb 17, 2025

I have the impression that my implementation might not be exactly what you had in mind. Do tell me what you think and how we can better consolidate these less-frequent features!

@LeWimbes
Copy link
Contributor Author

Actually, I like your approach, since users don't have to construct some complex array/dictionary monster.
The only thing that doesn't look so great to me is having that gap on the left where the logo is for the first position. On the other hand, if the position is simply placed below the logo, some space is wasted:
image

I tried to get rid of the big gap between the society and the first title, but at least v(-beforeEntrySkip) didn't do the trick.

@LeWimbes
Copy link
Contributor Author

Actually, I just noticed a minor issue with this modular setup: since it's several different tables, if the dates are of different lengths, the descriptions don't line up nicely:

image

@yunanwg
Copy link
Owner

yunanwg commented Feb 17, 2025

Actually, I like your approach, since users don't have to construct some complex array/dictionary monster. The only thing that doesn't look so great to me is having that gap on the left where the logo is for the first position. On the other hand, if the position is simply placed below the logo, some space is wasted: image

I tried to get rid of the big gap between the society and the first title, but at least v(-beforeEntrySkip) didn't do the trick.

Understandable, as I noticed this too. It can be an easy fix, just put logo in the level of A line instead against A and B lines; my concern however is that this will be a breaking change for existing users as it will modify the size and the placement of the logo.

Actually, I just noticed a minor issue with this modular setup: since it's several different tables, if the dates are of different lengths, the descriptions don't line up nicely:

image

This one can be fixed too by persisting the length of the B table, currently it was set as 1fr if I am not wrong.

@LeWimbes
Copy link
Contributor Author

LeWimbes commented Feb 18, 2025

Understandable, as I noticed this too. It can be an easy fix, just put logo in the level of A line instead against A and B lines; my concern however is that this will be a breaking change for existing users as it will modify the size and the placement of the logo.

I'm not entirely sure what you meant by that, but I believe I circumvented the issue by adding v(-10pt) at the end of cvEntryStart.

This one can be fixed too by persisting the length of the B table, currently it was set as 1fr if I am not wrong.

Instead of fixing the width of the first column, I opted to constrain the second column since dates tend to have a more predictable length. While I only speak English among English, Chinese, French, and Italian, I tried to find the longest possible date formats across these languages (with the help of LLMs).
Since fixing a single width for all languages would result in wasted space for some, I introduced a dateWidth function that determines the maximum width I could come up with per language.
Please feel free to let me know of mistakes or adjust it yourself if you have better insights into these languages!

image

@yunanwg
Copy link
Owner

yunanwg commented Feb 19, 2025

I'm not entirely sure what you meant by that, but I believe I circumvented the issue by adding v(-10pt) at the end of cvEntryStart.

I think that the introduction of cvEntryStart solves my concern -- let me rephrase that -- my concern was that changing the way how logos and titles are organized would bring breaking changes for current users; but since we don't change the cvEntry function I think it's good.

Appreciated the fix of the column length for dates! I will review the changes right away.

@yunanwg yunanwg marked this pull request as ready for review February 21, 2025 10:48
@yunanwg yunanwg merged commit e44134b into yunanwg:main Feb 21, 2025
1 check passed
@LeWimbes LeWimbes deleted the allow_multiple_dates branch February 21, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants