Closed joshbranham closed 10 months ago
I can see here in the source we load the markdown_inline_graphviz
plugin no matter what, which I think is the problem here. In our case we are not even using it, so being able to disable it would be helpful. Is there a path to do that?
I can also see someone forked that plugin (https://github.com/cesaremorel/markdown-inline-graphviz) and changed it to use the following to denote an image instead of conflicting with Liquid/Jinja {%
syntax. Anyway to use that instead of the other one?
```graphviz
Running into the same issue here actually. The plugin version you linked is the one used here by techdocs-core. While it has the new syntax it does not disable the legacy (conflicting) syntax.
I haven't yet found a workaround and this is certainly a blocker for me atm.
BTW, it seems this fork has continued some work and removed the legacy syntax so that it doesn't conflict.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bump
We are utilizing this plugin for our TechDocs generation for Backstage, too. When using Symfony Twig code like this
{% if areaname is defined and areaname is not empty %}
...
{% endif %}
it throws following error
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/markdown_inline_graphviz.py", line 68, in run
verbose: [docker/mkdocs] raise Exception('Command not supported: %s' % command)
verbose: [docker/mkdocs] Exception: Command not supported: endif
I was experiencing this same issue with twig template syntax, the way I managed to work around it was to just indent the twig markup inside of the code block.
```twig
{% if foo %}
{{ foo }}
{% endif %}
I did
{% if foo %}
{{ foo }}
{% endif %}
Can only chime into the choir here that using standard mkdocs
file:
site_name: 'Bifrost Docs'
exclude_docs: |
documentation-templates/
plugins:
- techdocs-core
the exclude is to NOT pick up the templates that are causing the rendering issue
I also observe that any liquid syntaxed markdown will throw an error on the keywords if
, else
, continue
and so on.
I've yet to find a way to make it not parse the liquid template but rather just render the markdown into html.
For now we circumvent it by excluding the template directory but I do see valid use-cases for liquid syntax'ed markdown being rendered without being parsed.
Should I open a separate issue on this matter?
We are utilizing this plugin for our TechDocs generation for Backstage. We have a few markdown files with liquid templates nested in code blocks/fences, and they are being parsed as functions by what appears to be
markdown_inline_graphviz
per the below trace.Example of a markdown block using this:
markdown_inline_graphviz: A Python Markdown extension replaces inline Graphviz definitions with inline SVGs or PNGs. Activate the inline_graphviz extension using the usage instructions.
verbose: [docker/mkdocs] ERROR - Error reading page 'public/guides/built-in-step-types.md': Command not supported: else verbose: [docker/mkdocs] Traceback (most recent call last): verbose: [docker/mkdocs] File "/usr/local/bin/mkdocs", line 8, in
verbose: [docker/mkdocs] sys.exit(cli())
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1130, in call
verbose: [docker/mkdocs] return self.main(args, kwargs)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1055, in main
verbose: [docker/mkdocs] rv = self.invoke(ctx)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
verbose: [docker/mkdocs] return _process_result(sub_ctx.command.invoke(sub_ctx))
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
verbose: [docker/mkdocs] return ctx.invoke(self.callback, ctx.params)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
verbose: [docker/mkdocs] return __callback(args, kwargs)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/main.py", line 181, in serve_command
verbose: [docker/mkdocs] serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, kwargs)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 63, in serve
verbose: [docker/mkdocs] config = builder()
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 58, in builder
verbose: [docker/mkdocs] build(config, live_server=live_server, dirty=dirty)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 292, in build
verbose: [docker/mkdocs] _populate_page(file.page, config, files, dirty)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 174, in _populate_page
verbose: [docker/mkdocs] page.render(config, files)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/mkdocs/structure/pages.py", line 175, in render
verbose: [docker/mkdocs] self.content = md.convert(self.markdown)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/markdown/core.py", line 261, in convert
verbose: [docker/mkdocs] self.lines = prep.run(self.lines)
verbose: [docker/mkdocs] File "/usr/local/lib/python3.8/site-packages/markdown_inline_graphviz.py", line 68, in run
verbose: [docker/mkdocs] raise Exception('Command not supported: %s' % command)
verbose: [docker/mkdocs] Exception: Command not supported: else
... plugins:
I opened this issue but I don't think it is a specific
mkdocs
issue https://github.com/mkdocs/mkdocs/issues/3067Also of note, if I remove
plugins
from our config file and runnpx @techdocs/cli serve -v
the error goes away (although the resulting documentation is blank, which I imagine is due to removing all plugins.)