Skip to content

Migrate cv.yml to RenderCV schema #2969

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

divergentrain
Copy link

The cv.yml will follow the RenderCV schema as the first step towards auto-generating CV PDFs from cv.yml or resume.json as discussed in #2787. The YAML file also supports markdown formatting to make it RenderCV friendly.

example_pdf.pdf updated to pdf generated by RenderCV using the example cv.yml file.

The existing cv.yml format would be deprecated after this PR.

Copy link

netlify bot commented Jan 19, 2025

Deploy Preview for relaxed-lollipop-b6bc17 ready!

Name Link
🔨 Latest commit 50f6b19
🔍 Latest deploy log https://app.netlify.com/projects/relaxed-lollipop-b6bc17/deploys/687e880df9543100087f6edb
😎 Deploy Preview https://deploy-preview-2969--relaxed-lollipop-b6bc17.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@divergentrain
Copy link
Author

divergentrain commented Jan 19, 2025

The deployed preview defaults to resume.json, so you can't actually see the preview there. But there is an issue with list-group-item:first-child having a top border when it shouldn't have that. I am unable to debug this.
2025-01-19T22:20:41,110015214+00:00

@george-gca
Copy link
Collaborator

I think I can took a look at it tomorrow.

@george-gca
Copy link
Collaborator

Sorry for the delay. Just looked at your code and found a fix.

@george-gca george-gca force-pushed the RenderCV-YAML-schema branch from 1b280c3 to df9198d Compare January 27, 2025 15:56
@george-gca
Copy link
Collaborator

Just tried to create an action to validate the yml against the schema, but it is failing. But maybe is because this schema is valid only to be used inside code editors?

@divergentrain
Copy link
Author

divergentrain commented Jan 27, 2025

The JSON Resume to RenderCV converter I was looking at was successfully using a different URL pointing to the same file to validate the schema. https://github.com/guruor/jsonresume-to-rendercv/blob/main/jsonresume_to_rendercv/converter.py

It seems that a new version of RenderCV has been released a couple of days ago with some changes and this cv.yml does not follow the new schema. This could be causing the errors.
I will take a look at this soon.

@divergentrain
Copy link
Author

Sorry for the delay.

I have fixed the rendering issues and updated the schema. However, the issues with validating the schema using actions were not caused by the file not following the schema, as the old file was still following the schema as per my editor. The update to the schema only added new entries, which I wasn't using in the old file.

@george-gca
Copy link
Collaborator

Have you figured it out why is it failing the schema action?

@divergentrain
Copy link
Author

divergentrain commented Feb 10, 2025

My guess is that it is some problem with the action itself, I will try some tests and see if it works.

@george-gca
Copy link
Collaborator

george-gca commented Feb 11, 2025

Maybe #3012 can also be tackled in this PR?

Edit: forget it, I thought the problem was in CV, not in bibliography.

@george-gca george-gca linked an issue Mar 2, 2025 that may be closed by this pull request
2 tasks
@jiuntian
Copy link
Contributor

jiuntian commented Mar 14, 2025

Thank you for your efforts on this! This improvement is valuable to the community. Regarding schema validation, I tested it and found that only a few small modifications are needed to make it work correctly.

  1. Add the missing required variable( /properties/design/required ), as this seems to incompatible with JSON schema format (of validator).
5390c5390,5393
-       "title": "Design"
---
+       "title": "Design",
+       "required": [
+         "theme"
+       ]
  1. Enable fixSchemas to handle certain unsupported formats (e.g., path, which is of type string).
    - name: Validate cv.yml 🧪
      uses: cardinalby/schema-validator-action@v3
      with:
        file: "_data/cv.yml"
        mode: "lax"
        schema: "rendercv-schema.json"
        fixSchemas: true
  1. Fix the cv.yml to ensure passing validation and successful CV generation.
    The version included in this PR failed to generate a valid CV using rendercv. However, when I tested with the example resume YAML from the RenderCV repository, it passed validation and successfully generated a CV.

edit: it is due to escaped characters in url of two publications entries, change the url and the validation can run successfully.

image

These are my patchy workarounds to make the CV YAML validation work. It might not be perfect, so feel free to refine or suggest improvements. I hope this contributes to the development of RenderCV support, as it is highly anticipated and could bring significant benefits to this project.

@george-gca
Copy link
Collaborator

Thanks @jiuntian, I'll take a look at this later.

@jiuntian
Copy link
Contributor

Thanks @george-gca

While I trying to made this to work on my own website, I also notice another incorrect variable name that made the sorting in CV failed.

Can check the following changes:
jiuntian@71c4368

@jiuntian
Copy link
Contributor

RenderCV renders CV sections dynamically based on the entry type, as described in the RenderCV documentation.I believe we can adopt a similar approach, instead of hardcoding specific sections. This would eliminate the need to modify the layout whenever the user wish to add a new section, especially since we’re planning to use the RenderCV schema for cv.yml.

I’ve implemented a dynamic layout for this project that renders CV sections based on the entry type defined by the RenderCV schema. Each entry type is detected by its mandatory fields and rendered using its own Liquid layout file.

You can view the commit on my personal website here: jiuntian@a890996. This implemented all currently available entry types: EducationEntry, ExperienceEntry, PublicationEntry, NormalEntry, OneLineEntry, BulletEntry, and TextEntry. Let me know if you think this proposal is useful, we can discuss how best to integrate it.

Copy link

stale bot commented May 23, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@george-gca
Copy link
Collaborator

@jiuntian I think that your solution would be really useful. Are you still willing to submit a PR?

@jiuntian
Copy link
Contributor

@george-gca I’d be happy to submit a PR once I have the capacity. I’ll keep you posted!

@divergentrain divergentrain force-pushed the RenderCV-YAML-schema branch from 67de8fa to 50f6b19 Compare July 21, 2025 18:33
@divergentrain
Copy link
Author

divergentrain commented Jul 21, 2025

I see the point in using the native section system of RenderCV rather than imitating the JSONresume like i did. I will now push a workflow for auto generation of RenderCV PDF which can be integrated into your solution.

As for the schema validation, the addition of #properties/design/required is one of the problems but there are many problems associated with it, such as a typo in the main code for section_title type, there is a type named "with-parial-line" instead of the type "with-partial-line" which is specified in the schema. Currently, using a local schema file with version lock of RenderCV in the workflows seems to be for the best. I will raise an issue on RenderCV repo to improve the schema in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RenderCV integration
4 participants