Method: IsoDoc::Function::Utils#populate_template

Defined in:
lib/isodoc/function/utils.rb

#populate_template(docxml, _format = nil) ⇒ Object



166
167
168
169
170
171
172
173
174
175
# File 'lib/isodoc/function/utils.rb', line 166

def populate_template(docxml, _format = nil)
  meta = @meta
    .get
    .merge(@labels ? { labels: @labels } : {})
    .merge(@meta.labels ? { labels: @meta.labels } : {})
    .merge(fonts_options || {})
  liquid(docxml).render(meta.stringify_all_keys
    .transform_values { |v| empty2nil(v) })
    .gsub("<", "<").gsub(">", ">").gsub("&", "&")
end