Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative links to .drawio files and 'use_directory_urls: true' do not behave well #12

Open
noltedennis opened this issue Sep 14, 2023 · 3 comments

Comments

@noltedennis
Copy link

noltedennis commented Sep 14, 2023

Assume a directory structure for the mkdocs project is as follows:
/
├── docs
│ ├── media
│ │ └── test.drawio
│ ├── test
│ │ └── test3
│ │ └── index.md
└── mkdocs.yml

Notably,

  1. there exists a separate media directory and
  2. pages are potentially nested and are named index.md. This is important, because with use_directory_urls: true (mkdocs default), their url will be stripped off the index.html in the rendering process.

Then, in order to get a successful build, one must reference the drawio file in index.md with an extra ../ (correct would be ../../media.test.drawio), i.e. it must instead be referenced as:
![](../../../media/test.drawio)

In addition, mkdocs will issue a warning in the build pipeline for each .drawio file linked this way, because mkdocs itself cannot locate the file. This largely stems from the following LOC:

if src.startswith("../"):
src = src[3:]

@noltedennis
Copy link
Author

I'll hopefully be able to provide a pull request for this in the near future.

@noltedennis
Copy link
Author

I'll hopefully be able to provide a pull request for this in the near future.

Pull request provided.

@tuunit
Copy link
Contributor

tuunit commented Jan 5, 2025

I was in touch with Sergey the original author and he will not maintain this repo / package anymore.

The changes have been merged to the new repo: https://github.com/tuunit/mkdocs-drawio

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 a pull request may close this issue.

2 participants