sytsereitsma / mdbook-plantuml

mdBook preprocessor to render PlantUML diagrams to png images in the book output directory
MIT License
76 stars 14 forks source link

Add slash to image URI #11

Closed rafasf closed 4 years ago

rafasf commented 4 years ago

As all diagrams are created in book/img we need to ensure that the browser always fetch the images from /img/.

If we don't specify that images are served from the root, the browser will expect to a "img" directory to exist at each sub-path.

Use case: Books organised as //, the diagram will be created in /img. So adding the slash to indicate that img is served from the root makes the browser look for the right path, regardless of which level the diagram is.

I wasn't able to easily create a test for it since it would require the file rendering to be successful to get to the code where the path is generated. If you have tips on how I can do it, I'm happy to add 😃

sytsereitsma commented 4 years ago

Thanks. I'm about to release the next version, I will add your change to it.