jskherman / imprecv

A no-frills curriculum vitae (CV) template using Typst and YAML to version control CV data.
Apache License 2.0
319 stars 38 forks source link

feat: allow omitting of dates from date ranges #15

Closed Aparaxium closed 2 months ago

Aparaxium commented 7 months ago

Allows the user to omit dates in date ranges using the logic:

#let daterange(start, end) = {
    if start != none and end != none [
        #start #sym.dash.en #end
    ]
    if start == none and end != none [
        #end
    ]
    if start != none and end == none [
        #start #sym.dash.en Present
    ]
}
jskherman commented 7 months ago

Hi @Aparaxium, can you give some example cases where omitting dates (both dates and just one of the dates) in places that have date ranges would be valuable? So far, a valid case has been brought to attention in issue #10 where someone would need to hide their length of stay in an educational institution.

For the use case of having the end date of "present", it can just be included in the YAML file as a value as mentioned in issue #4.

Aparaxium commented 7 months ago

Hello,

Initially I had intended to remove the dates from the projects fields because I found it difficult to remember when I started on many of them. I then extrapolated this to every date range field.

I understand if this is something you don't want to include or want the implementation details to be changed, however i took care to try to make sure it would handle every case and it remains optional for the user.

Here are some other reasons to exclude dates:

Aparaxium commented 7 months ago

Hello,

I just realized that the json schema needs to be updated to facilitate this.

jskherman commented 7 months ago

I see, thanks for expanding. The context for me is a lot clearer now.

On a side note, over the implementation, I've looked over the utils.daterange() and all seems good to merge (now to just solve the merge conflict...). Thank you for also updating the JSON schema.

Let me know if it is all good for merging :>

jskherman commented 2 months ago

Added in lines 44-54 of utils.typ but unmerged here because of recent changes/conflicts in repo.