adsfolio.cv.template
User-defined CV templates for LaTeX, HTML, Markdown, or plain text.
A template has five parts: a header, a section start, one entry per
publication, a section end, and a footer. The header and footer appear once.
The section parts appear around each of the two sections. Each part is text with {name} placeholders.
Only the names listed in HEADER_FIELDS, SECTION_FIELDS, and
ENTRY_FIELDS are replaced. All other braces stay as written, so LaTeX such
as \textit{{title}} or \begin{itemize} needs no doubled braces.
Values that come from ADS are escaped for the output format chosen by
CVTemplate.escape. Text that the user writes is never escaped: the template
itself, the name-highlight markup (me_fmt), the author separator, status
notes, and marker symbols.
- class adsfolio.cv.template.CVTemplate(header='', section='', entry='', section_end='', footer='', escape='none', group=True)[source]
Bases:
objectText templates and the escaping rule for one output format.
- Parameters:
header (str) – Template text. Empty parts are omitted from the output. section and section_end surround each section, for example to open and close a list.
section (str) – Template text. Empty parts are omitted from the output. section and section_end surround each section, for example to open and close a list.
entry (str) – Template text. Empty parts are omitted from the output. section and section_end surround each section, for example to open and close a list.
section_end (str) – Template text. Empty parts are omitted from the output. section and section_end surround each section, for example to open and close a list.
footer (str) – Template text. Empty parts are omitted from the output. section and section_end surround each section, for example to open and close a list.
escape (str) –
"latex","html", or"none". Selects how ADS values are escaped before they replace placeholders.group (bool) – True splits the list into First-authored and Co-authored sections. False makes one section, named Publications, in the input order.
- class adsfolio.cv.template.TemplatePreset(label, template, me_fmt, author_sep, filename)[source]
Bases:
objectA complete starting point for one output format.
- Parameters:
label (str)
template (adsfolio.cv.template.CVTemplate)
me_fmt (str)
author_sep (str)
filename (str)
- template: adsfolio.cv.template.CVTemplate
- adsfolio.cv.template.fill_template(text, values)[source]
Replace known
{name}placeholders in text with values.Placeholders whose names are not keys of values stay unchanged.
- Parameters:
text (str)
values (collections.abc.Mapping[str, str])
- Return type: