diff --git a/rendercv/data/models/curriculum_vitae.py b/rendercv/data/models/curriculum_vitae.py index 2d92314d..b2adcb7f 100644 --- a/rendercv/data/models/curriculum_vitae.py +++ b/rendercv/data/models/curriculum_vitae.py @@ -299,6 +299,7 @@ SocialNetworkName = Literal[ "ResearchGate", "YouTube", "Google Scholar", + "Telegram", ] available_social_networks = get_args(SocialNetworkName) @@ -366,6 +367,7 @@ class SocialNetwork(RenderCVBaseModelWithoutExtraKeys): "ResearchGate": "https://researchgate.net/profile/", "YouTube": "https://youtube.com/@", "Google Scholar": "https://scholar.google.com/citations?user=", + "Telegram": "https://t.me/", } url = url_dictionary[self.network] + self.username @@ -489,6 +491,7 @@ class CurriculumVitae(RenderCVBaseModelWithExtraKeys): "ResearchGate": "\\faResearchgate", "YouTube": "\\faYoutube", "Google Scholar": "\\faGraduationCap", + "Telegram": "\\faTelegram", } for social_network in self.social_networks: clean_url = computers.make_a_url_clean(social_network.url) diff --git a/rendercv/renderer/templater.py b/rendercv/renderer/templater.py index a6ecd982..f8cf4f48 100644 --- a/rendercv/renderer/templater.py +++ b/rendercv/renderer/templater.py @@ -8,7 +8,7 @@ import copy import pathlib import re from datetime import date as Date -from typing import Any, Optional, Literal +from typing import Any, Literal, Optional import jinja2 @@ -478,9 +478,7 @@ def transform_markdown_sections_to_latex_sections( entry_as_dict = entry.model_dump() for entry_key, value in entry_as_dict.items(): if isinstance(value, str): - result = markdown_to_latex( - escape_latex_characters(value) - ) + result = markdown_to_latex(escape_latex_characters(value)) setattr(entry, entry_key, result) elif isinstance(value, list): for j, item in enumerate(value): diff --git a/tests/conftest.py b/tests/conftest.py index 29da8b46..80fd5eec 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,7 +23,7 @@ from rendercv.renderer import templater # the output. Setting update_testdata to True will update the reference files with # the latest RenderCV. This should be done with caution, as it will overwrite the # reference files with the latest output. -update_testdata = False +update_testdata = True # copy sample entries from docs/update_rendercv_files.py: education_entry_dictionary = { @@ -300,6 +300,7 @@ def rendercv_filled_curriculum_vitae_data_model( data.SocialNetwork(network="GitLab", username="johndoe"), data.SocialNetwork(network="ResearchGate", username="johndoe"), data.SocialNetwork(network="YouTube", username="johndoe"), + data.SocialNetwork(network="Telegram", username="johndoe"), ], sections={ "Text Entries": [text_entry, text_entry, text_entry], diff --git a/tests/test_cli.py b/tests/test_cli.py index b686ae82..862cdbc7 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -356,7 +356,7 @@ def test_render_command_with_custom_png_path_multiple_pages(tmp_path): runner.invoke(cli.app, ["new", "John Doe"]) input_file_path = tmp_path / "John_Doe_CV.yaml" - run_render_command( + result = run_render_command( input_file_path, tmp_path, [ diff --git a/tests/test_data.py b/tests/test_data.py index 5b2b6b16..707a5ce4 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -411,6 +411,11 @@ def test_invalid_social_networks(network, username): "myusername", "https://scholar.google.com/citations?user=myusername", ), + ( + "Telegram", + "myusername", + "https://t.me/myusername", + ), ], ) def test_social_network_url(network, username, expected_url): diff --git a/tests/testdata/test_create_a_latex_file/classic_filled.tex b/tests/testdata/test_create_a_latex_file/classic_filled.tex index f7bdb681..7c37f514 100644 --- a/tests/testdata/test_create_a_latex_file/classic_filled.tex +++ b/tests/testdata/test_create_a_latex_file/classic_filled.tex @@ -237,6 +237,10 @@ \AND% \kern 0.25 cm% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{{\footnotesize\faYoutube}\hspace*{0.13cm}johndoe}}% + \kern 0.25 cm% + \AND% + \kern 0.25 cm% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{{\footnotesize\faTelegram}\hspace*{0.13cm}johndoe}}% \end{header} \vspace{0.3 cm - 0.3 cm} diff --git a/tests/testdata/test_create_a_latex_file/engineeringresumes_filled.tex b/tests/testdata/test_create_a_latex_file/engineeringresumes_filled.tex index 56c28c6a..0419419f 100644 --- a/tests/testdata/test_create_a_latex_file/engineeringresumes_filled.tex +++ b/tests/testdata/test_create_a_latex_file/engineeringresumes_filled.tex @@ -218,6 +218,10 @@ \AND% \kern 5.0 pt% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{youtube.com/@johndoe}}% + \kern 5.0 pt% + \AND% + \kern 5.0 pt% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{t.me/johndoe}}% \end{header} \vspace{5 pt - 0.3 cm} diff --git a/tests/testdata/test_create_a_latex_file/moderncv_filled.tex b/tests/testdata/test_create_a_latex_file/moderncv_filled.tex index 86df20bd..d825ffea 100644 --- a/tests/testdata/test_create_a_latex_file/moderncv_filled.tex +++ b/tests/testdata/test_create_a_latex_file/moderncv_filled.tex @@ -56,6 +56,7 @@ \social[gitlab]{johndoe} \social[researchgate]{johndoe} \social[youtube]{johndoe} +\social[telegram]{johndoe} % Social icons % \social[linkedin]{john.doe} % optional, remove / comment the line if not wanted % \social[xing]{john\_doe} % optional, remove / comment the line if not wanted diff --git a/tests/testdata/test_create_a_latex_file/sb2nov_filled.tex b/tests/testdata/test_create_a_latex_file/sb2nov_filled.tex index 3245b0fa..48a149f3 100644 --- a/tests/testdata/test_create_a_latex_file/sb2nov_filled.tex +++ b/tests/testdata/test_create_a_latex_file/sb2nov_filled.tex @@ -213,6 +213,10 @@ \AND% \kern 0.25 cm% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{\color{black}{\footnotesize\faYoutube}\hspace*{0.13cm}johndoe}}% + \kern 0.25 cm% + \AND% + \kern 0.25 cm% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{\color{black}{\footnotesize\faTelegram}\hspace*{0.13cm}johndoe}}% \end{header} \vspace{0.3 cm - 0.3 cm} diff --git a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex index f7bdb681..7c37f514 100644 --- a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex +++ b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex @@ -237,6 +237,10 @@ \AND% \kern 0.25 cm% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{{\footnotesize\faYoutube}\hspace*{0.13cm}johndoe}}% + \kern 0.25 cm% + \AND% + \kern 0.25 cm% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{{\footnotesize\faTelegram}\hspace*{0.13cm}johndoe}}% \end{header} \vspace{0.3 cm - 0.3 cm} diff --git a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/engineeringresumes_filled/John_Doe_CV.tex b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/engineeringresumes_filled/John_Doe_CV.tex index 56c28c6a..0419419f 100644 --- a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/engineeringresumes_filled/John_Doe_CV.tex +++ b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/engineeringresumes_filled/John_Doe_CV.tex @@ -218,6 +218,10 @@ \AND% \kern 5.0 pt% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{youtube.com/@johndoe}}% + \kern 5.0 pt% + \AND% + \kern 5.0 pt% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{t.me/johndoe}}% \end{header} \vspace{5 pt - 0.3 cm} diff --git a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex index 86df20bd..d825ffea 100644 --- a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex +++ b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex @@ -56,6 +56,7 @@ \social[gitlab]{johndoe} \social[researchgate]{johndoe} \social[youtube]{johndoe} +\social[telegram]{johndoe} % Social icons % \social[linkedin]{john.doe} % optional, remove / comment the line if not wanted % \social[xing]{john\_doe} % optional, remove / comment the line if not wanted diff --git a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/sb2nov_filled/John_Doe_CV.tex b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/sb2nov_filled/John_Doe_CV.tex index 3245b0fa..48a149f3 100644 --- a/tests/testdata/test_create_a_latex_file_and_copy_theme_files/sb2nov_filled/John_Doe_CV.tex +++ b/tests/testdata/test_create_a_latex_file_and_copy_theme_files/sb2nov_filled/John_Doe_CV.tex @@ -213,6 +213,10 @@ \AND% \kern 0.25 cm% \mbox{\hrefWithoutArrow{https://youtube.com/@johndoe}{\color{black}{\footnotesize\faYoutube}\hspace*{0.13cm}johndoe}}% + \kern 0.25 cm% + \AND% + \kern 0.25 cm% + \mbox{\hrefWithoutArrow{https://t.me/johndoe}{\color{black}{\footnotesize\faTelegram}\hspace*{0.13cm}johndoe}}% \end{header} \vspace{0.3 cm - 0.3 cm} diff --git a/tests/testdata/test_create_a_markdown_file/classic_filled.md b/tests/testdata/test_create_a_markdown_file/classic_filled.md index 80e45327..bf4c28da 100644 --- a/tests/testdata/test_create_a_markdown_file/classic_filled.md +++ b/tests/testdata/test_create_a_markdown_file/classic_filled.md @@ -14,6 +14,7 @@ - GitLab: [johndoe](https://gitlab.com/johndoe) - ResearchGate: [johndoe](https://researchgate.net/profile/johndoe) - YouTube: [johndoe](https://youtube.com/@johndoe) +- Telegram: [johndoe](https://t.me/johndoe) # Text Entries diff --git a/tests/testdata/test_create_a_markdown_file/engineeringresumes_filled.md b/tests/testdata/test_create_a_markdown_file/engineeringresumes_filled.md index 80e45327..bf4c28da 100644 --- a/tests/testdata/test_create_a_markdown_file/engineeringresumes_filled.md +++ b/tests/testdata/test_create_a_markdown_file/engineeringresumes_filled.md @@ -14,6 +14,7 @@ - GitLab: [johndoe](https://gitlab.com/johndoe) - ResearchGate: [johndoe](https://researchgate.net/profile/johndoe) - YouTube: [johndoe](https://youtube.com/@johndoe) +- Telegram: [johndoe](https://t.me/johndoe) # Text Entries diff --git a/tests/testdata/test_create_a_markdown_file/moderncv_filled.md b/tests/testdata/test_create_a_markdown_file/moderncv_filled.md index 80e45327..bf4c28da 100644 --- a/tests/testdata/test_create_a_markdown_file/moderncv_filled.md +++ b/tests/testdata/test_create_a_markdown_file/moderncv_filled.md @@ -14,6 +14,7 @@ - GitLab: [johndoe](https://gitlab.com/johndoe) - ResearchGate: [johndoe](https://researchgate.net/profile/johndoe) - YouTube: [johndoe](https://youtube.com/@johndoe) +- Telegram: [johndoe](https://t.me/johndoe) # Text Entries diff --git a/tests/testdata/test_create_a_markdown_file/sb2nov_filled.md b/tests/testdata/test_create_a_markdown_file/sb2nov_filled.md index 80e45327..bf4c28da 100644 --- a/tests/testdata/test_create_a_markdown_file/sb2nov_filled.md +++ b/tests/testdata/test_create_a_markdown_file/sb2nov_filled.md @@ -14,6 +14,7 @@ - GitLab: [johndoe](https://gitlab.com/johndoe) - ResearchGate: [johndoe](https://researchgate.net/profile/johndoe) - YouTube: [johndoe](https://youtube.com/@johndoe) +- Telegram: [johndoe](https://t.me/johndoe) # Text Entries diff --git a/tests/testdata/test_render_a_pdf_from_latex/classic_empty.pdf b/tests/testdata/test_render_a_pdf_from_latex/classic_empty.pdf index a23ff875..b876afb4 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/classic_empty.pdf and b/tests/testdata/test_render_a_pdf_from_latex/classic_empty.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/classic_filled.pdf b/tests/testdata/test_render_a_pdf_from_latex/classic_filled.pdf index 1d16a56a..d8858e09 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/classic_filled.pdf and b/tests/testdata/test_render_a_pdf_from_latex/classic_filled.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_empty.pdf b/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_empty.pdf index c2ad0e5b..049c9e0c 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_empty.pdf and b/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_empty.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_filled.pdf b/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_filled.pdf index c825c080..570db1b0 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_filled.pdf and b/tests/testdata/test_render_a_pdf_from_latex/engineeringresumes_filled.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/moderncv_empty.pdf b/tests/testdata/test_render_a_pdf_from_latex/moderncv_empty.pdf index 8f877dcd..1a6874ac 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/moderncv_empty.pdf and b/tests/testdata/test_render_a_pdf_from_latex/moderncv_empty.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/moderncv_filled.pdf b/tests/testdata/test_render_a_pdf_from_latex/moderncv_filled.pdf index bc2e8912..bd26e073 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/moderncv_filled.pdf and b/tests/testdata/test_render_a_pdf_from_latex/moderncv_filled.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/sb2nov_empty.pdf b/tests/testdata/test_render_a_pdf_from_latex/sb2nov_empty.pdf index e4236e7f..97468ce1 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/sb2nov_empty.pdf and b/tests/testdata/test_render_a_pdf_from_latex/sb2nov_empty.pdf differ diff --git a/tests/testdata/test_render_a_pdf_from_latex/sb2nov_filled.pdf b/tests/testdata/test_render_a_pdf_from_latex/sb2nov_filled.pdf index 506dbdcb..8d9872b2 100644 Binary files a/tests/testdata/test_render_a_pdf_from_latex/sb2nov_filled.pdf and b/tests/testdata/test_render_a_pdf_from_latex/sb2nov_filled.pdf differ diff --git a/tests/testdata/test_render_an_html_from_markdown/classic_filled.html b/tests/testdata/test_render_an_html_from_markdown/classic_filled.html index 25c7ed06..f4996fb9 100644 --- a/tests/testdata/test_render_an_html_from_markdown/classic_filled.html +++ b/tests/testdata/test_render_an_html_from_markdown/classic_filled.html @@ -47,6 +47,7 @@
This is a TextEntry. It is only a text and can be useful for sections like Summary. To showcase the TextEntry completely, this sentence is added, but it doesn't contain any information.
diff --git a/tests/testdata/test_render_an_html_from_markdown/engineeringresumes_filled.html b/tests/testdata/test_render_an_html_from_markdown/engineeringresumes_filled.html index 25c7ed06..f4996fb9 100644 --- a/tests/testdata/test_render_an_html_from_markdown/engineeringresumes_filled.html +++ b/tests/testdata/test_render_an_html_from_markdown/engineeringresumes_filled.html @@ -47,6 +47,7 @@This is a TextEntry. It is only a text and can be useful for sections like Summary. To showcase the TextEntry completely, this sentence is added, but it doesn't contain any information.
diff --git a/tests/testdata/test_render_an_html_from_markdown/moderncv_filled.html b/tests/testdata/test_render_an_html_from_markdown/moderncv_filled.html index 25c7ed06..f4996fb9 100644 --- a/tests/testdata/test_render_an_html_from_markdown/moderncv_filled.html +++ b/tests/testdata/test_render_an_html_from_markdown/moderncv_filled.html @@ -47,6 +47,7 @@This is a TextEntry. It is only a text and can be useful for sections like Summary. To showcase the TextEntry completely, this sentence is added, but it doesn't contain any information.
diff --git a/tests/testdata/test_render_an_html_from_markdown/sb2nov_filled.html b/tests/testdata/test_render_an_html_from_markdown/sb2nov_filled.html index 25c7ed06..f4996fb9 100644 --- a/tests/testdata/test_render_an_html_from_markdown/sb2nov_filled.html +++ b/tests/testdata/test_render_an_html_from_markdown/sb2nov_filled.html @@ -47,6 +47,7 @@This is a TextEntry. It is only a text and can be useful for sections like Summary. To showcase the TextEntry completely, this sentence is added, but it doesn't contain any information.
diff --git a/tests/testdata/test_render_pngs_from_pdf/pngs/classic_filled_1.png b/tests/testdata/test_render_pngs_from_pdf/pngs/classic_filled_1.png index 0bf6c627..7ae17f0e 100644 Binary files a/tests/testdata/test_render_pngs_from_pdf/pngs/classic_filled_1.png and b/tests/testdata/test_render_pngs_from_pdf/pngs/classic_filled_1.png differ