X Tutup
Skip to content

CV filtering with tags#654

Draft
akib1689 wants to merge 25 commits intorendercv:mainfrom
akib1689:main
Draft

CV filtering with tags#654
akib1689 wants to merge 25 commits intorendercv:mainfrom
akib1689:main

Conversation

@akib1689
Copy link
Contributor

@akib1689 akib1689 commented Jan 30, 2026

Overview

This PR introduces a tag based CV filtering system that allows you to generate different versions of you CV from a single YAML file. I came up with this solution to solve a specific need of mine: tailor different CV for specific audiences (like academic, backend, devops) without maintaining multiple files or worse! multiple git branches.

Key features

Tags on entry types

  • Every CV entry now supports an optional tags field.
  • New TextEntry type for tagged text entries.

Tags on highlights

Individual entries in the highlights can now have tags allowing granular control.

highlights:
  - "Always included highlight"  # No tags = always included
  - content: "Academic-focused achievement"
    tags: [academic]
  - content: "Industry-focused achievement"
    tags: [industry]

Version definitions

Now, you can define versions with include and/or exclude tag filters

versions:
  - name: academic
    include: [research, publications, teaching]
  - name: industry
    exclude: [academic]
  - name: devops
    include: [infrastructure, cloud]
    exclude: [deprecated]

Permissive filtering

  • Entries or highlights without tags are always included
  • Only entries with tags are subjected to filtering
  • Empty sections are always excluded from output.

How to use

  • Step 1: Add tags to your entries
cv:
  sections:
    experience:
      - tags: [industry, software]
        company: TechCorp
        position: Senior Engineer
        highlights:
          - "Led team of 10 engineers"
          - content: "Published internal white paper"
            tags: [academic]
      
      - tags: [academic, research]
        company: University Lab
        position: Research Assistant
        highlights:
          - "Published 3 papers in top venues"
    
    publications:
      - tags: [academic]
        title: "Deep Learning for XYZ"
        authors: ["John Doe"]
        journal: NeurIPS 2023
  • Step 2: define versions
versions:
  - name: academic
    include: [academic, research, publications]
  
  - name: industry
    exclude: [academic]
  
  - name: ml-focused
    include: [machine-learning, deep-learning]
    exclude: [outdated]
  • Generate specific version
# Generate the academic version
rendercv render my_cv.yaml --version academic

# Generate the industry version
rendercv render my_cv.yaml -V industry

# Generate without filtering (all entries)
rendercv render my_cv.yaml

Filtering logic

  • Include Filter: Entry must have at least one of the specified tags
  • Exclude Filter: Entry must NOT have any of the excluded tags
  • Combined: If both are specified, include is applied first, then exclude
  • Permissive: Entries without tags pass all filters automatically

Backward Compatibility

This feature is fully backward compatible:

  • Existing YAML files work without modifications
  • Entries without tags are always included
  • The --version flag is optional

Fixes: #164

- Introduced the TextEntry model with support for content and optional tags.
- Added tests for TextEntry to validate creation, required fields, and tag handling.
- Updated existing tests to accommodate the new TextEntry model.
- Implemented comprehensive tests for the filter module, ensuring correct behavior for include/exclude logic.
- Added tests for the Version model to validate include/exclude tag functionality.
- Enhanced test coverage for filtering RenderCV models by version, ensuring original models remain unchanged.
fix: correct exclude tag in Version model and tests
feat: enhance version description and improve highlight processing fo…
@akib1689
Copy link
Contributor Author

@sinaatalay Please share your feed back regarding this implementation.

@sinaatalay
Copy link
Member

Thank you for your contribution. I will review it as soon as possible.

@sinaatalay
Copy link
Member

Thank you, but I think this feature makes the schema too complicated. While it adds the functionality, it also makes the schema and editor suggestions much more complex, even for users who won’t use this feature.

Also, what do you think about having AI handle all of this for you in a new file with a single prompt?

If we want this feature, we need to come up with a strong UX design that doesn’t make the schema significantly more complicated. This approach also introduces rendering concerns into the schema and validation. Currently, the schema doesn’t consider the rendering side at all.

@sinaatalay sinaatalay marked this pull request as draft February 16, 2026 11:37
@akib1689
Copy link
Contributor Author

I think we should gather more feedback. To me this feature should follow opt-out approach. the default schema should suggest the existing flow. Everything in this feature can be made optional.

@sinaatalay sinaatalay force-pushed the main branch 3 times, most recently from cff31ca to 2b08030 Compare February 17, 2026 14:04
@heavyimage
Copy link
Contributor

FWIW I love this idea.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter on content or sections

3 participants

X Tutup