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: object

Text 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.

entry: str = ''
escape: str = 'none'
footer: str = ''
group: bool = True
header: str = ''
section: str = ''
section_end: str = ''
class adsfolio.cv.template.TemplatePreset(label, template, me_fmt, author_sep, filename)[source]

Bases: object

A complete starting point for one output format.

Parameters:
author_sep: str
filename: str
label: str
me_fmt: 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:
Return type:

str

adsfolio.cv.template.render_template_document(first_docs, co_docs, cfg)[source]

Render both publication sections with the configured template.

Raises:

ValueError – If the configuration has no entry template.

Parameters:
Return type:

str