-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
event/slamSlam IssuesSlam Issuesexempt-from-stalehelp wantedExtra attention is neededExtra attention is neededmarkdown / AuthorRelates to trestle markdown functionalityRelates to trestle markdown functionalitypythonPull requests that update Python codePull requests that update Python code
Description
Issue description / feature objectives
Presently, when there is an issue with trestle author jinja there is no ability to debug. For example, issue #1953.
Proposed:
Include the following in trestle/core/commands/author/jinja.py:
def jinja_debug_filter(value):
print(f"DEBUG: {value}") # Print to console for debugging
return value # Return the original value to maintain template flow
Then, where ever jinja Environment is created, for example:
jinja_env = Environment(
loader=FileSystemLoader(template_folder), extensions=extensions(), trim_blocks=True, autoescape=True
)
Follow with this code:
jinja_env.filters['debug'] = jinja_debug_filter
This will enable templates do add debugging.
In template:
{{"group.id:"~group.id|debug}}
In produced markdown:
group.id:AC.2
Caveats / Assumptions
Commensurate test cases and documentation.
Completion Criteria
Metadata
Metadata
Assignees
Labels
event/slamSlam IssuesSlam Issuesexempt-from-stalehelp wantedExtra attention is neededExtra attention is neededmarkdown / AuthorRelates to trestle markdown functionalityRelates to trestle markdown functionalitypythonPull requests that update Python codePull requests that update Python code
Type
Projects
Status
New
Status
Todo