themes: add new design options (`seperator_between_connections` and `use_icons_for_connections`)

This commit is contained in:
Sina Atalay 2024-06-06 17:32:38 +03:00
parent 9deb39246d
commit 3bac4eea32
6 changed files with 88 additions and 10 deletions

View File

@ -280,6 +280,22 @@ class ThemeOptions(pydantic.BaseModel):
title="Text Alignment",
description="The alignment of the text. The default value is justified.",
)
seperator_between_connections: str = pydantic.Field(
default="",
title="Seperator Between Connections",
description=(
"The separator between the connections in the header. The default value is"
" empty string."
),
)
use_icons_for_connections: bool = pydantic.Field(
default=True,
title="Use Icons for Connections",
description=(
"If this option is set to true, then icons will be used for the connections"
" in the header. The default value is true."
),
)
margins: Margins = pydantic.Field(
default=Margins(),
title="Margins",

View File

@ -1,3 +1,10 @@
\newcommand{\AND}{\unskip
\cleaders\copy\ANDbox\hskip\wd\ANDbox
\ignorespaces
}
\newsavebox\ANDbox
\sbox\ANDbox{<<design.seperator_between_connections>>}
((* if not design.disable_last_updated_date *))
\placelastupdatedtext
((* endif *))
@ -10,12 +17,24 @@
\normalsize
((* for connection in cv.connections *))
((* if design.use_icons_for_connections *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>}
((*- else -*))
{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}
\kern <<design.margins.header.horizontal_between_connections>>
((*- endif -*))}%
((* else *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{<<connection["clean_url"]|escape_latex_characters>>}
((*- else -*))
<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}%
((* endif *))
((* if not loop.last *))
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
\AND%
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
((* endif *))
((* endfor *))
\end{header}

View File

@ -3,7 +3,7 @@
\ignorespaces
}
\newsavebox\ANDbox
\sbox\ANDbox{$|$}
\sbox\ANDbox{<<design.seperator_between_connections>>}
((* if not design.disable_last_updated_date *))
\placelastupdatedtext
@ -16,16 +16,24 @@
\normalsize
((* for connection in cv.connections *))
((* if design.use_icons_for_connections *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>}
((*- else -*))
{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}%
((* else *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{<<connection["clean_url"]|escape_latex_characters>>}
((*- else -*))
<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}%
((* endif *))
((* if not loop.last *))
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
((* if not loop.last *))
\AND%
((* endif *))
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
((* endif *))
((* endfor *))
\end{header}

View File

@ -162,6 +162,22 @@ class EngineeringresumesThemeOptions(ThemeOptions):
title="Text Alignment",
description="The alignment of the text. The default value is left-aligned.",
)
seperator_between_connections: str = pydantic.Field(
default="$|$",
title="Seperator Between Connections",
description=(
"The separator between the connections in the header. The default value is"
" empty string."
),
)
use_icons_for_connections: bool = pydantic.Field(
default=False,
title="Use Icons for Connections",
description=(
"If this option is set to true, then icons will be used for the connections"
" (like phone, email, and website). The default value is false."
),
)
margins: MarginsForEngineeringresumes = pydantic.Field(
default=MarginsForEngineeringresumes(),
title="Margins",

View File

@ -62,13 +62,13 @@
((* if cv.social_networks *))
((* for network in cv.social_networks *))
\social[<<network.network|lower()>>]{<<network.username>>}
\social[<<network.network|lower()|replace(" ", "")>>]{<<network.username>>}
((* endfor *))
((* endif *))
% 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
% \social[twitter]{ji\_doe} % optional, remove / comment the line if not wanted
% \social[twitter]{ji\_doe} % optional, remove / comment the line if not wanted
% \social[github]{jdoe} % optional, remove / comment the line if not wanted
% \social[gitlab]{jdoe} % optional, remove / comment the line if not wanted
% \social[stackoverflow]{0000000/johndoe} % optional, remove / comment the line if not wanted

View File

@ -1,3 +1,10 @@
\newcommand{\AND}{\unskip
\cleaders\copy\ANDbox\hskip\wd\ANDbox
\ignorespaces
}
\newsavebox\ANDbox
\sbox\ANDbox{<<design.seperator_between_connections>>}
((* if not design.disable_last_updated_date *))
\placelastupdatedtext
((* endif *))
@ -9,12 +16,24 @@
\normalsize
((* for connection in cv.connections *))
((* if design.use_icons_for_connections *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{\color{black}{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>}
((*- else -*))
{\color{black}{\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>}
((*- endif -*))}
\kern <<design.margins.header.horizontal_between_connections>>
{\color{black}\footnotesize<<connection["latex_icon"]>>}\hspace*{0.13cm}<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}%
((* else *))
\mbox{((*- if connection["url"] -*))
\hrefWithoutArrow{<<connection["url"]>>}{<<connection["clean_url"]|escape_latex_characters>>}
((*- else -*))
<<connection["placeholder"]|escape_latex_characters>>
((*- endif -*))}%
((* endif *))
((* if not loop.last *))
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
\AND%
\kern <<design.margins.header.horizontal_between_connections|divide_length_by(2)>>%
((* endif *))
((* endfor *))
\end{header}