You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, if the source page contains a variable, mkdocs-macro-plugin is not rendering it as expected. For example:
mkdocs.yml:
extra:
internal-url: https://custom.url
source.md
<!-- --8<-- [start:func] -->
This is the internal url: {{ internal-url }}
<!-- --8<-- [end:func] -->
destination.md
The following text show the internal url:
--8<-- source.md:func
Expected result in destination page:
The following text show the internal url:
This is the internal url: https://custom.url
Current result in destination page:
The following text show the internal url:
This is the internal url: {{ internal-url }}
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!
The text was updated successfully, but these errors were encountered:
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.
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.
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!
The text was updated successfully, but these errors were encountered: