mirror of https://github.com/Nonannet/pyladoc.git
arguments for inject_to_template in "to_pdf" function and code style issues fixed
This commit is contained in:
parent
5ac7659f01
commit
664a08b2dc
|
@ -709,10 +709,9 @@ class DocumentWriter():
|
||||||
True if the PDF file was successfully created
|
True if the PDF file was successfully created
|
||||||
"""
|
"""
|
||||||
content = self.to_latex(font_family, table_renderer, figure_scale)
|
content = self.to_latex(font_family, table_renderer, figure_scale)
|
||||||
latex_code = inject_to_template({'CONTENT': content},
|
latex_code = inject_to_template({'CONTENT': content} | fields_dict,
|
||||||
latex_template_path,
|
latex_template_path,
|
||||||
internal_template = 'templates/default_template.tex',
|
internal_template='templates/default_template.tex')
|
||||||
fields_dict = fields_dict)
|
|
||||||
|
|
||||||
if font_family == 'sans-serif':
|
if font_family == 'sans-serif':
|
||||||
latex_code = latex.inject_latex_command(latex_code, '\\renewcommand{\\familydefault}{\\sfdefault}')
|
latex_code = latex.inject_latex_command(latex_code, '\\renewcommand{\\familydefault}{\\sfdefault}')
|
||||||
|
|
|
@ -28,6 +28,7 @@ def test_inject_to_template_html():
|
||||||
assert "<!-- some comment -->" in result # Keep unrelated HTML comments
|
assert "<!-- some comment -->" in result # Keep unrelated HTML comments
|
||||||
assert "<title>Test Title</title>" in result
|
assert "<title>Test Title</title>" in result
|
||||||
|
|
||||||
|
|
||||||
def test_inject_to_template_latex():
|
def test_inject_to_template_latex():
|
||||||
template = """
|
template = """
|
||||||
\\documentclass[a4paper,12pt]{article}
|
\\documentclass[a4paper,12pt]{article}
|
||||||
|
|
Loading…
Reference in New Issue