mirror of https://github.com/eyhc1/rendercv.git
Merge branch 'main' into jpg/mastodon
This commit is contained in:
commit
55abcd06e8
|
@ -115,7 +115,6 @@ def parse_date_string(date_string: str) -> Date | int:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f'The date string "{date_string}" is not in YYYY-MM-DD, YYYY-MM, or YYYY'
|
f'The date string "{date_string}" is not in YYYY-MM-DD, YYYY-MM, or YYYY'
|
||||||
" format."
|
" format."
|
||||||
" format."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(date, Date):
|
if isinstance(date, Date):
|
||||||
|
|
|
@ -265,59 +265,6 @@ def abbreviate_names(names: list[str]) -> str:
|
||||||
return abbreviated_names
|
return abbreviated_names
|
||||||
|
|
||||||
|
|
||||||
def abbreviate_name(name: list[str]) -> str:
|
|
||||||
"""Abbreviate a name by keeping the first letters of the first names.
|
|
||||||
|
|
||||||
This function is used as a Jinja2 filter.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```python
|
|
||||||
abbreviate_name("John Doe")
|
|
||||||
```
|
|
||||||
|
|
||||||
will return:
|
|
||||||
|
|
||||||
`#!python "J. Doe"`
|
|
||||||
|
|
||||||
Args:
|
|
||||||
name (str): The name to abbreviate.
|
|
||||||
Returns:
|
|
||||||
str: The abbreviated name.
|
|
||||||
"""
|
|
||||||
first_names = name.split(" ")[:-1]
|
|
||||||
first_names_initials = [first_name[0] + "." for first_name in first_names]
|
|
||||||
last_name = name.split(" ")[-1]
|
|
||||||
abbreviated_name = " ".join(first_names_initials) + " " + last_name
|
|
||||||
|
|
||||||
return abbreviated_name
|
|
||||||
|
|
||||||
|
|
||||||
def abbreviate_names(names: list[str]) -> str:
|
|
||||||
"""Abbreviate a list of names by keeping the first letters of the first names.
|
|
||||||
|
|
||||||
This function is used as a Jinja2 filter.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```python
|
|
||||||
abbreviate_names(["John Doe", "Jane Atalay"])
|
|
||||||
```
|
|
||||||
|
|
||||||
will return:
|
|
||||||
|
|
||||||
`#!python ["J. Doe", "J. Atalay"]`
|
|
||||||
|
|
||||||
Args:
|
|
||||||
names (list[str]): The names to abbreviate.
|
|
||||||
Returns:
|
|
||||||
str: The list of abbreviated names.
|
|
||||||
"""
|
|
||||||
abbreviated_names = []
|
|
||||||
for name in names:
|
|
||||||
abbreviated_names.append(abbreviate_name(name))
|
|
||||||
|
|
||||||
return abbreviated_names
|
|
||||||
|
|
||||||
|
|
||||||
def divide_length_by(length: str, divider: float) -> str:
|
def divide_length_by(length: str, divider: float) -> str:
|
||||||
r"""Divide a length by a number.
|
r"""Divide a length by a number.
|
||||||
|
|
||||||
|
@ -514,12 +461,6 @@ def run_latex(latex_file_path: str) -> str:
|
||||||
) as latex_process:
|
) as latex_process:
|
||||||
output, error = latex_process.communicate()
|
output, error = latex_process.communicate()
|
||||||
|
|
||||||
if latex_process.returncode != 0:
|
|
||||||
# Find the error line:
|
|
||||||
for line in output.split("\n"):
|
|
||||||
if line.startswith("! "):
|
|
||||||
error_line = line.replace("! ", "")
|
|
||||||
break
|
|
||||||
if latex_process.returncode != 0:
|
if latex_process.returncode != 0:
|
||||||
# Find the error line:
|
# Find the error line:
|
||||||
for line in output.split("\n"):
|
for line in output.split("\n"):
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
((# preamble: first column, second column, third column #))
|
((# preamble: first column, second column, third column #))
|
||||||
((# first column: p{0.55cm}; constant width, ragged left column #))
|
((# first column: p{0.55cm}; constant width, ragged left column #))
|
||||||
((# second column: K{<<theme_options.margins.entry_area.left_and_right>>}; variable width, justified column #))
|
((# second column: K{<<theme_options.margins.entry_area.left_and_right>>}; variable width, justified column #))
|
||||||
((# second column: K{<<theme_options.margins.entry_area.left_and_right>>}; variable width, justified column #))
|
|
||||||
((# third column: R{<<theme_options.date_and_location_width>>}; constant widthm ragged right column #))
|
((# third column: R{<<theme_options.date_and_location_width>>}; constant widthm ragged right column #))
|
||||||
\begin{tabularx}{\textwidth-<<theme_options.margins.entry_area.left_and_right|divide_length_by(0.5)>>-0.13cm}{L{0.85cm} K{<<theme_options.margins.entry_area.left_and_right>>} R{<<theme_options.date_and_location_width>>}}
|
\begin{tabularx}{\textwidth-<<theme_options.margins.entry_area.left_and_right|divide_length_by(0.5)>>-0.13cm}{L{0.85cm} K{<<theme_options.margins.entry_area.left_and_right>>} R{<<theme_options.date_and_location_width>>}}
|
||||||
\textbf{<<study_type if study_type is not none>>}
|
\textbf{<<study_type if study_type is not none>>}
|
||||||
|
|
21
schema.json
21
schema.json
|
@ -42,27 +42,6 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"ClassicThemeHeaderMargins": {
|
|
||||||
"properties": {
|
|
||||||
"vertical_between_name_and_connections": {
|
|
||||||
"default": "0.2 cm",
|
|
||||||
"description": "The vertical margin between the name of the person and the connections.",
|
|
||||||
"pattern": "\\d+\\.?\\d* *(cm|in|pt|mm|ex|em)",
|
|
||||||
"title": "Vertical Margin Between the Name and Connections",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"bottom": {
|
|
||||||
"default": "0.2 cm",
|
|
||||||
"description": "The bottom margin of the header, i.e., the vertical margin between the connections and the first section title.",
|
|
||||||
"pattern": "\\d+\\.?\\d* *(cm|in|pt|mm|ex|em)",
|
|
||||||
"title": "Bottom Margin",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"title": "ClassicThemeHeaderMargins",
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"ClassicThemeHighlightsAreaMargins": {
|
"ClassicThemeHighlightsAreaMargins": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"top": {
|
"top": {
|
||||||
|
|
Loading…
Reference in New Issue