Closed siryugo closed 11 months ago
Welcome to this project and thank you!' first issue
@siryugo I would say, certainly yes. The simplest way would be to use the standard {% include ... %} command of Jinja2. That is, if you want to include the whole file.
Do you really need to include only a section of the file? If yes, and you are willing to write a Python function e.g. extract_snippet(filename, section)
, to be inserted in a main.py
file, that shouldn't be difficult.
Here are instructions on how to write a module.
@siryugo What is the status of that issue, for you?
Hi @fralau, thanks for your help! We have finally found a workaround for our specific need for now. Anyway, I will work on your solution in the next weeks. We can close the issue.
Thanks again!
Hi,
I'm currently using pymdown snippet extension to include an specific delimited part from one page into another using the section feature: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippet-sections
Unfortunately, if the source page contains a variable, mkdocs-macro-plugin is not rendering it as expected. For example:
mkdocs.yml:
source.md
destination.md
Expected result in destination page:
Current result in destination page:
I tried using the include jinja2 function as suggested in other issues but it appears we can only "include" the full page (which makes sense). That's why I tried using pymdown snippet extension but facing this issue.
Is this something possible to solve using mkdocs-macros plugin?
Thanks!