-p, --process View after all processing (Jinja2, inlining, line-
continuation joining).
The -l won’t do anything without -i or -p, and only works for Cylc’s own %include directive, not to Jinja2 Includes:
# This text is in jinja2.include
#++++ START INLINED INCLUDE FILE cylc.include
# This text is in cylc.include
#++++ END INLINED INCLUDE FILE cylc.include
[scheduler]
allow implicit tasks = True
[scheduling]
[[graph]]
R1 = foo
> cd ~/roses/[my workflow dir]
> cylc view -lp . | grep -i include
[no output]
I’ve checked and in my workflow there is a site/archer2.cylc file which is being successfully included.
I reckon I’m probably misunderstanding how this is supposed to work. What I’m naively expecting is some easy-to-spot indication - as mentioned above #++++ START INLINED INCLUDE FILE cylc.include - that the archer2.cylc has indeed been included (which it is).
I’m guessing that by " -p should work though!"@wxtim meant functionally (i.e. the file will be included), not that some indicator comment will be added as for native Cylc include file inlining mechanism.
Jinja2 includes are handled by the Jinja2 processor, so we don’t have control over the internals of that.
One thing you can do is add a Jinja2 print statement inside the Jinja2 include file, to print a Cylc comment (i.e. prefixed by # - so it doesn’t process to illegal Cylc syntax). Then if the file is included as you intend, the comment will appear in the processed flow.cylc.
# Included file: site/esnz.cylc
[runtime]
[[BIGTASK]]
platform = big_machine
# END Include: site/esnz.cylc
I’m almost tempted to suggest that we should add this to the user guide
We recommend using Cylc native %%include directives becuase you can use cylc view -l to understand where included configuration came from. If you choose to use Jinja2 includes, we recommend that each include file should have a comment at the start and end of the file indicating that a file has been included.