Skip to content

Conversation

@yves-chevallier
Copy link
Contributor

In Markdown, an image is inserted using:

![alt text](image.png)

In this plugin, however, the alt text, which can normally be used by other plugins to display a caption above or below the image or diagram—cannot be used for that purpose. Instead, it is used to select which page to render from the Draw.io diagram.

In some cases, the end user may still want to keep the alt text and use another way to specify which page to use.

Fortunately, with the attr_list Markdown extension enabled, it is possible to use the following syntax:

![alt text](image.png){ page="page name" }

This behavior can be enabled by setting the following option in your mkdocs.yml file:

plugins:
  - drawio:
      use_page_attribute: true

@tuunit
Copy link
Owner

tuunit commented Oct 8, 2025

@yves-chevallier I really appreciate all you already have contributed to your project but I don't think changing the default behaviour is a good idea. I rather have the plugin prefer the page attribute if it is set and otherwise still use the alt attribute without introducing the overhead of a new config flag.

Therefore I decided to go with this approach: #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants