mirror of https://github.com/eyhc1/rendercv.git
docs: include themes' templates to reference documentation
This commit is contained in:
parent
0f81f49a0c
commit
15c4557285
|
@ -1,3 +1,10 @@
|
||||||
# Classic Theme
|
# Classic Theme
|
||||||
|
|
||||||
::: rendercv.themes.classic
|
{% for template_name, template in theme_templates["classic"].items() %}
|
||||||
|
## {{ template_name }}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{ template }}
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
# Engineeringresumes Theme
|
# Engineeringresumes Theme
|
||||||
|
|
||||||
::: rendercv.themes.engineeringresumes
|
{% for template_name, template in theme_templates["engineeringresumes"].items() %}
|
||||||
|
## {{ template_name }}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{ template }}
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
# Moderncv Theme
|
# Moderncv Theme
|
||||||
|
|
||||||
::: rendercv.themes.moderncv
|
{% for template_name, template in theme_templates["moderncv"].items() %}
|
||||||
|
## {{ template_name }}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{ template }}
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
# Sb2nov Theme
|
# Sb2nov Theme
|
||||||
|
|
||||||
::: rendercv.themes.sb2nov
|
{% for template_name, template in theme_templates["sb2nov"].items() %}
|
||||||
|
## {{ template_name }}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{ template }}
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import io
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
|
from time import thread_time_ns
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import pdfCropMargins
|
import pdfCropMargins
|
||||||
|
@ -162,6 +163,18 @@ def define_env(env):
|
||||||
|
|
||||||
env.variables["showcase_entries"] = entries_showcase
|
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():
|
def generate_entry_figures():
|
||||||
"""Generate an image for each entry type and theme."""
|
"""Generate an image for each entry type and theme."""
|
||||||
|
|
|
@ -125,8 +125,8 @@ def get_error_message_and_location_and_value_from_a_custom_error(
|
||||||
def handle_validation_error(exception: pydantic.ValidationError):
|
def handle_validation_error(exception: pydantic.ValidationError):
|
||||||
"""Take a Pydantic validation error and print the error messages in a nice table.
|
"""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
|
Pydantic's `ValidationError` object is a complex object that contains a lot of
|
||||||
information about the error. This function takes a ValidationError object and
|
information about the error. This function takes a `ValidationError` object and
|
||||||
extracts the error messages, locations, and the input values. Then, it prints them
|
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/).
|
in a nice table with [Rich](https://rich.readthedocs.io/en/latest/).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue