Add grouped subsections#694
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for grouped publication subsections (e.g., “Journal Articles”, “Conference Proceedings”) in CV sections, ensuring they validate correctly, render with subsection headings, and produce accurate nested validation error locations.
Changes:
- Extend the CV section schema to accept either a flat list of entries or a grouped mapping for
PublicationEntrysubsections, and exposesubsectionsin the renderable section model. - Update the templater/model pre-processing to render subsection headings and ensure subsection titles are processed consistently.
- Add test coverage + golden reference outputs for grouped-publications rendering across Typst/Markdown/HTML, plus docs/schema updates.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/schema/test_pydantic_error_handling.py | Adds coverage for nested schema locations when grouped publication entries fail validation. |
| tests/schema/models/cv/test_section.py | Adds validation tests for grouped publication subsections and rejection for non-publication grouped entries. |
| tests/schema/models/cv/test_cv.py | Adds CV-level test ensuring grouped publication sections create subsections as expected. |
| tests/renderer/testdata/test_typst/sb2nov_grouped_publications.typ | Golden Typst output for grouped publications (sb2nov theme). |
| tests/renderer/testdata/test_typst/moderncv_grouped_publications.typ | Golden Typst output for grouped publications (moderncv theme). |
| tests/renderer/testdata/test_typst/engineeringresumes_grouped_publications.typ | Golden Typst output for grouped publications (engineeringresumes theme). |
| tests/renderer/testdata/test_typst/engineeringclassic_grouped_publications.typ | Golden Typst output for grouped publications (engineeringclassic theme). |
| tests/renderer/testdata/test_typst/classic_grouped_publications.typ | Golden Typst output for grouped publications (classic theme). |
| tests/renderer/testdata/test_markdown/grouped_publications.md | Golden Markdown output for grouped publications. |
| tests/renderer/testdata/test_html/grouped_publications.html | Golden HTML output for grouped publications. |
| tests/renderer/test_typst.py | Adds Typst renderer test for grouped publications across all themes. |
| tests/renderer/test_markdown.py | Adds Markdown renderer test for grouped publications. |
| tests/renderer/test_html.py | Adds HTML renderer test for grouped publications. |
| tests/renderer/templater/test_model_processor.py | Ensures string processing (e.g., bold keywords) applies to subsection titles and entries. |
| tests/renderer/conftest.py | Adds a fixture producing a grouped-publications RenderCVModel used by renderer tests. |
| src/rendercv/schema/models/cv/section.py | Implements grouped publication section support, including subsection modeling and validation. |
| src/rendercv/schema/models/cv/cv.py | Updates sections field description/examples to document grouped publication mappings. |
| src/rendercv/renderer/templater/templates/typst/SubsectionHeading.j2.typ | Introduces Typst subsection heading template. |
| src/rendercv/renderer/templater/templates/markdown/SubsectionHeading.j2.md | Introduces Markdown subsection heading template. |
| src/rendercv/renderer/templater/templater.py | Renders grouped sections with subsection headings and per-subsection entries. |
| src/rendercv/renderer/templater/model_processor.py | Applies string processors to subsection titles during model preprocessing. |
| schema.json | Updates generated schema to include GroupedPublicationEntries and updated Section union. |
| docs/user_guide/yaml_input_structure/cv.md | Documents YAML structure for grouped publication subsections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Thanks a lot for your work. This is an interesting feature, but I think the right architecture for this would be creating a new entry type which accepts section titles and a list of entries below those section titles, just like the Entry name would be: SubsectionEntry. Something like this: cv:
sections:
publications:
- title: Subsection Heading
entries:
- A text entry.
- title: Another subsection
entries:
- name: A normal entry. |
|
Thanks @sinaatalay, I agree with this direction. I updated the implementation to use a first-class The new behavior is:
So the structure now looks like this: cv:
sections:
selected_work:
- title: Papers
entries:
- title: Example Paper
authors:
- Jane Doe
date: 2024
journal: Journal of Examples
- title: Projects
entries:
- name: Example Tool
summary: A small project entry.
- title: Summary
entries:
- Built support for subsection-based sections.or another example: cv:
sections:
publications:
- title: Co-First Author
entries:
- title: Example Journal Paper
authors:
- Jane Doe
- John Smith
date: 2024
journal: Genome Research
- title: Conferences
entries:
- title: Example Conference Paper
authors:
- Jane Doe
date: 2023
journal: RECOMB
- title: Preprints
entries:
- title: Example Preprint
authors:
- Jane Doe
date: 2025
journal: bioRxivThis keeps subsection nesting to one level, and a section still has to choose one top-level shape: either flat entries or subsection entries, but not both mixed together. |
|
Thank you. I'll review and merge this before v2.9 release. |
|
Hi @sinaatalay, are you planning to merge this PR? |
|
Hi @faridrashidi, sorry for the delay. I'm not able to work on the RenderCV package at the moment, but I'll merge this before v2.9. |
Summary
Following #545, this adds first-class support for grouped subsections inside a single
PublicationEntrysection.Users can now keep one top-level
Publicationsheading while grouping entries under subsection labels such asJournal Articles,Conference Proceedings, orPre-prints:This is scoped to publications only. Existing flat publication lists continue to work unchanged.
Changes
Extend section validation to accept either:
subsection_title -> list[PublicationEntry]Keep grouped subsection support limited to
PublicationEntryNormalize grouped publication sections into render sections with:
entry_type = "PublicationEntry"entriessubsectionsReuse section title formatting for subsection titles
Process subsection titles in the model processor
Render subsection headings in Markdown and Typst without changing publication entry layout
Skip empty grouped subsections during rendering
Add configurable subsection title spacing through:
Update user documentation and regenerate
schema.jsonTesting
Added test coverage for:
Verification