diff --git a/docs/reference/themes/classic.md b/docs/reference/themes/classic.md index 7aba0d4..2162871 100644 --- a/docs/reference/themes/classic.md +++ b/docs/reference/themes/classic.md @@ -1,3 +1,10 @@ # Classic Theme -::: rendercv.themes.classic +{% for template_name, template in theme_templates["classic"].items() %} +## {{ template_name }} + +```latex +{{ template }} +``` + +{% endfor %} diff --git a/docs/reference/themes/engineeringresumes.md b/docs/reference/themes/engineeringresumes.md index 6acc027..772e134 100644 --- a/docs/reference/themes/engineeringresumes.md +++ b/docs/reference/themes/engineeringresumes.md @@ -1,3 +1,10 @@ # Engineeringresumes Theme -::: rendercv.themes.engineeringresumes +{% for template_name, template in theme_templates["engineeringresumes"].items() %} +## {{ template_name }} + +```latex +{{ template }} +``` + +{% endfor %} diff --git a/docs/reference/themes/moderncv.md b/docs/reference/themes/moderncv.md index a8a7c52..431752e 100644 --- a/docs/reference/themes/moderncv.md +++ b/docs/reference/themes/moderncv.md @@ -1,3 +1,10 @@ # Moderncv Theme -::: rendercv.themes.moderncv +{% for template_name, template in theme_templates["moderncv"].items() %} +## {{ template_name }} + +```latex +{{ template }} +``` + +{% endfor %} diff --git a/docs/reference/themes/sb2nov.md b/docs/reference/themes/sb2nov.md index ff80062..32c22ca 100644 --- a/docs/reference/themes/sb2nov.md +++ b/docs/reference/themes/sb2nov.md @@ -1,3 +1,10 @@ # Sb2nov Theme -::: rendercv.themes.sb2nov +{% for template_name, template in theme_templates["sb2nov"].items() %} +## {{ template_name }} + +```latex +{{ template }} +``` + +{% endfor %} diff --git a/docs/update_rendercv_files.py b/docs/update_rendercv_files.py index 8258a36..3c68a19 100644 --- a/docs/update_rendercv_files.py +++ b/docs/update_rendercv_files.py @@ -7,6 +7,7 @@ import io import os import sys import shutil +from time import thread_time_ns from typing import Any import pdfCropMargins @@ -162,6 +163,18 @@ def define_env(env): env.variables["showcase_entries"] = entries_showcase + # for theme templates reference docs: + themes_path = rendercv_path / "themes" + theme_templates = dict() + for theme in dm.available_themes: + theme_templates[theme] = dict() + for theme_file in themes_path.glob(f"{theme}/*.tex"): + theme_templates[theme][ + theme_file.stem.replace(".j2", "") + ] = theme_file.read_text() + + env.variables["theme_templates"] = theme_templates + def generate_entry_figures(): """Generate an image for each entry type and theme.""" diff --git a/rendercv/cli.py b/rendercv/cli.py index 19cd3e6..9112ff5 100644 --- a/rendercv/cli.py +++ b/rendercv/cli.py @@ -125,8 +125,8 @@ def get_error_message_and_location_and_value_from_a_custom_error( def handle_validation_error(exception: pydantic.ValidationError): """Take a Pydantic validation error and print the error messages in a nice table. - Pydantic's ValidationError object is a complex object that contains a lot of - information about the error. This function takes a ValidationError object and + Pydantic's `ValidationError` object is a complex object that contains a lot of + information about the error. This function takes a `ValidationError` object and extracts the error messages, locations, and the input values. Then, it prints them in a nice table with [Rich](https://rich.readthedocs.io/en/latest/).