diagrams / diagrams-pandoc

A pandoc filter to express diagrams inline using the haskell EDSL diagrams.
BSD 3-Clause "New" or "Revised" License
37 stars 9 forks source link

Absolute path in image tag #9

Closed cdupont closed 7 years ago

cdupont commented 8 years ago

Hi, I've integrated diagrams-pandoc with my blog. Thanks! I have one problem with the images generated:

The problem is that the HTML page generated is not necessarily in the web root directory. So the code generated should be:

<img src="/images/bbb63a1006746c4a.png" />

or

<img src="../../../images/bbb63a1006746c4a.png" />

The image could also be encoded as image data URI.

For the moment I added a boolean field "pathSeparator" in Opts. I add a slash to the image name in function insertDiagrams:

if (_absolutePath opts) then pathSeparator : imgName else imgName

If you like this solution I can make a pull request.

bergey commented 8 years ago

This sounds good. A PR would be great. Can you expose _absolutePath in the command-line interface also?

byorgey commented 7 years ago

Closed by #13.