Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/rendercv/cli/create_theme_command/create_theme_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def cli_command_create_theme(
create_init_file_for_theme(theme_name, new_theme_folder / "__init__.py")

# Build the panel
message = textwrap.dedent(f"""
message = textwrap.dedent(
f"""
[green]✓[/green] Created your custom theme: [purple]./{theme_name}[/purple]

What you can do with this theme:
Expand All @@ -52,7 +53,8 @@ def cli_command_create_theme(
To use your theme, set in your YAML input file:
[cyan] design:
[cyan] theme: {theme_name}
""").strip("\n")
"""
).strip("\n")

print(
rich.panel.Panel(
Expand Down
12 changes: 9 additions & 3 deletions src/rendercv/renderer/templater/model_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ def process_model(
rendercv_model.cv.name = apply_string_processors(
rendercv_model.cv.name, string_processors
)
rendercv_model.cv.headline = apply_string_processors(
rendercv_model.cv.headline, string_processors
)
if isinstance(rendercv_model.cv.headline, list):
rendercv_model.cv.headline = [
apply_string_processors(line, string_processors)
for line in rendercv_model.cv.headline
]
else:
rendercv_model.cv.headline = apply_string_processors(
rendercv_model.cv.headline, string_processors
)
rendercv_model.cv.connections = compute_connections(rendercv_model, file_type) # ty: ignore[unresolved-attribute]
rendercv_model.cv.top_note = render_top_note_template( # ty: ignore[unresolved-attribute]
rendercv_model.design.templates.top_note,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# {{ cv.name }}'s CV
{% endif %}

{% if cv.headline %}
{% if cv.headline is string %}
{{ cv.headline }}
{% else %}
{{ cv.headline|join(design.header.headline_separator) }}
{% endif %}
{% endif %}

{% if cv.phone %}
- Phone: {{cv.phone|replace("tel:", "")|replace("-"," ")}}
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions src/rendercv/renderer/templater/templates/typst/Header.j2.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
{% endif %}

{% if cv.headline %}
{% if cv.headline is string %}
#headline([{{ cv.headline }}])
{% else %}
#headline([{{ cv.headline|join(design.header.headline_separator) }}])
{% endif %}

{% endif %}
#connections(
Expand Down
2 changes: 1 addition & 1 deletion src/rendercv/schema/models/cv/cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Cv(BaseModelWithExtraKeys):
default=None,
examples=["John Doe", "Jane Smith"],
)
headline: str | None = pydantic.Field(
headline: str | list[str] | None = pydantic.Field(
default=None,
examples=["Software Engineer", "Data Scientist", "Product Manager"],
)
Expand Down
7 changes: 7 additions & 0 deletions src/rendercv/schema/models/design/classic_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ class Header(BaseModelWithoutExtraKeys):
+ length_common_description
+ " The default value is `0.7cm`.",
)
headline_separator: str = pydantic.Field(
default=" — ",
description=(
"Separator for the headline list items. The default value is ` — `"
" (em-dash)."
),
)
connections: Connections = pydantic.Field(
default_factory=Connections,
description="Contact information settings.",
Expand Down
1 change: 1 addition & 0 deletions tests/renderer/testdata/test_html/full.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<body>
<article class="markdown-body">
<h1>John Doe's CV</h1>
<p>AI Researcher and Entrepreneur</p>
<ul>
<li>Phone: +90 541 999 99 99</li>
<li>Email: <a href="mailto:[email protected]">[email protected]</a></li>
Expand Down
2 changes: 2 additions & 0 deletions tests/renderer/testdata/test_markdown/full.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# John Doe's CV

AI Researcher and Entrepreneur

- Phone: +90 541 999 99 99
- Email: [[email protected]](mailto:[email protected])
- Location: Istanbul, Turkey
Expand Down
1 change: 1 addition & 0 deletions tests/renderer/testdata/test_markdown/minimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@




# Experience
Software Engineer at Company X, 2020-2023