Unable to use common filters in custom templates

I intended to write my own templates for C generation, so I went ahead and copied the contents of lang/c/templates to a new directory. Before attempting to modify them, I tried to generate C headers with these new templates. The command I am running is as follows (I am testing with the public_regulated_data_types):

nnvg --target-language c --target-endianness=little --enable-serialization-asserts --templates templates public_regulated_data_types/reg --lookup-dir public_regulated_data_types/uavcan

If I simply remove --templates, all is well and it generates normally. However, after adding the template directory, I get the following:

nunavut.jinja.jinja2.exceptions.TemplateAssertionError: no filter named 'remove_blank_lines'

What am I missing? I can’t seem to make this work at all. The documentation suggests that I should be able to use these just fine.

I think this might be worthy of opening a new issue on GitHub. Sorry.

Ironically, I was writing the issue on GitHub and then decided it might be better off here. I’ll go ahead and open one there.

For potential future readers, the GitHub issue: Unable to use common filters in custom templates · Issue #310 · OpenCyphal/nunavut · GitHub

A fix is building now: fix for #310 by thirtytwobits · Pull Request #311 · OpenCyphal/nunavut · GitHub

Thanks for reporting this.

1 Like

Thank you for fixing it so quickly!

NP. Fix is now release: nunavut · PyPI