Replies: 3 comments 10 replies
-
I would say in principle: yes, the See the relevant paragraph in the official Jinja2 documentation |
Beta Was this translation helpful? Give feedback.
-
@Andre601 The documentation on |
Beta Was this translation helpful? Give feedback.
-
If could be useful for someone else reading this: since using Jekyll (and now porting the project(s) to MKDocs) I use(d) to include HTML tables mixed with Liquid/Jinja template, loading variables from YAML/JSON files. |
Beta Was this translation helpful? Give feedback.
-
From my research so far have I found out that I could use the
{% include <file> %}
syntax to include a separate file from the defined includes directory.My question now is, if I can provide values to said syntax which would replace specific values within the targeted file.
I'll give a quick example of what my goal is:
I have a file called
img_table.md
which contains the following markdown (Note that I'm not sure about the syntax here regarding the values I want to have replaced)I would now like to use this file in
{% include img_table.md %}
and have the{{ image }}
and{{ description }}
syntaxes replaced with whatever values I provide in the include.Is this doable? I'm fairly new to jinja2, macros and python in general and I'm not confident enough to try it completely on my own...
Beta Was this translation helpful? Give feedback.
All reactions