onixpro / mkdocs-drawio-file

Embeding files of Diagrams.net (Draw.io) into MkDocs
23 stars 6 forks source link

Failing when used in conjunction with gen-files and mkdocstring plugin #6

Closed madeinoz67 closed 1 year ago

madeinoz67 commented 1 year ago

when this plugin is used in conjunction with gen-files auto page generating plugin and mkdocstring, the plugin fails.

gen-files plugin is used to autogenerate doc pages for code reference documentation from the source, but doesn't create the .md files just the site files

ERROR    -  mkdocstrings: No module named 'main<script type="text/javascript" src="https://viewer'
ERROR    -  Error reading page 'reference/main.md':
ERROR    -  Could not collect 'main<script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js"></script>'

A possible solution would be an option to ignore a doc path

e.g. "reference/" in this case

plugins:
 - drawio_file:
      exclude: 
         - reference/*
pawamoy commented 1 year ago

It looks like mkdocstrings finds a line like ::: main<script type="text/javascript" src="https://viewer in your Markdown sources, and I'm not sure why. This plugin for DrawIO does not use this syntax, at least it's not mentioned in the README. Looking at ::: main<script..., is it possible that you're trying to reference a main package, and a newline is missing, concatenating the next <script thing?

tuunit commented 1 year ago

@pawamoy please try again with the latest release as it completely changes how the files are parsed.

pawamoy commented 1 year ago

I'll ask @madeinoz67 to try again instead: I'm just here to try and help :slightly_smiling_face:

madeinoz67 commented 1 year ago

is now working many thanks.

I saw there was a version update when I updated my deps via poetry and came here to check :)

tuunit commented 1 year ago

I'm happy to hear that my changes fixes this issue as well :)