You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Example issue:## mdsection include that works:
{% mdsection_include 'description.md' '## Heading' heading_level=3 %}
## layered mdsection include that causes an issue:
{{ ssp.system_characteristics.description }}
## embedded moustache templates dont work:
{% for control in catalog_interface.get_all_controls_from_catalog(false) %}
{{ ssp_md_writer.get_control_response(control.id, 2, true) }}
{% endfor %}
description.md:
# Description of System
File to include in authored output.
## Heading
Include this part
Steps to reproduce the behavior:
Copy above files into the appropriate places in a trestle root
See error related to the {{ ssp.system_characteristics.description }} include: trestle.core.commands.author.jinja:94 ERROR: Error while generating markdown via Jinja template: unexpected char '&' at 156
Update that description in the SSP to be: "{ mdsection_include 'author-output/description.md' '## Heading' heading_level=3 %}"
Run trestle author jinja again with the same parameters
See error related to the control response: trestle.core.commands.author.jinja:94 ERROR: Error while generating markdown via Jinja template: expected token 'end of print statement', got 'param'
Update the control response in the SSP to remove one of the opening {
Run trestle author jinja again with the same parameters
This time, output will complete and you will see at least a hint as to why the mdsection_include didn't work, with the quotes around the filename and heading to include being escaped. I do not know why the control response template didn't work.
Expected behavior
I should be able to use jinja templates within oscal fields, especially those that insert parameters that are set on the control.
Environment
OS: [e.g. iOS] docker
Python version: 3.11.9
Installed packages: compliance-trestle 3.4.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When using
trestle author jinja
to create documents from an ssp/profile combination, any jinja tags within the OSCAL result in jinja errors.To Reproduce
SSP
Profile
Jinja templates
template.md:description.md:
Steps to reproduce the behavior:
trestle author jinja -i template.md -ssp ssp -p profile -o output.md
{{ ssp.system_characteristics.description }}
include:trestle.core.commands.author.jinja:94 ERROR: Error while generating markdown via Jinja template: unexpected char '&' at 156
"{ mdsection_include 'author-output/description.md' '## Heading' heading_level=3 %}"
trestle author jinja
again with the same parameterstrestle.core.commands.author.jinja:94 ERROR: Error while generating markdown via Jinja template: expected token 'end of print statement', got 'param'
{
trestle author jinja
again with the same parametersmdsection_include
didn't work, with the quotes around the filename and heading to include being escaped. I do not know why the control response template didn't work.Expected behavior
I should be able to use jinja templates within oscal fields, especially those that insert parameters that are set on the control.
Environment
The text was updated successfully, but these errors were encountered: