My use case is as follows (improved new version of this post):
Problem
Files:
# Input
content/foo.md
content/img/diagram.svg
# Output (out/ is a build directory that is gitignored and often cleared)
out/foo.html
out/img/diagram.svg
Command:
pandoc --standalone -o out/foo.html --extract-media=out content/foo.md
Input:
Image: ![](img/diagram.svg)
Actual output:
Image: <img src="out/img/diagram.svg" />
Desired output:
Image: <img src="img/diagram.svg" />
Possible solutions
Possible solution 1 – introduce a completely new and independent reader option extract-media-into where media paths (into the extraction directory out/) are always relative to the path specified via --output:
pandoc --standalone -o out/foo.html --extract-media-into=out content/foo.md
Possible solution 2 – introduce a flag that changes how extract-media operates:
pandoc --standalone -o out/foo.html --extract-media-relative-to-output --extract-media=out content/foo.md
Am I making sense? Or am I thinking about this wrong?