Skip to main content
`Ctrl`+`K`

# pyladoc.inject_to_template

pyladoc.inject_to_template(fields_dict, template_path='', internal_template='', template_string='')

  injects content fields into a template. The placeholder <!–CONTENT–> will be replaced by the content. If the placeholder is prefixed with a ‘%’ comment character, this character will be replaced as well.

  Parameters:

    - fields_dict (`dict`[`str`, `str`]) – A dictionary with field names as keys and content as values

    - template_path (`str`) – Path to a template file

    - internal_template (`str`) – Path to a internal default template

    - template_string (`str`) – A template string to use directly

  Return type:

    `str`

  Returns:

    Template with included content